Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2a20579
added execution for proof-less transactions
Roee-87 Nov 6, 2025
268f8fc
fixed build errors
Roee-87 Nov 6, 2025
c27246a
added docstring to devnode_execute
Roee-87 Nov 6, 2025
9c8566a
added flag to ExecuteOptions for devnode transactions
Roee-87 Nov 6, 2025
9ccf673
cleanup
Roee-87 Nov 6, 2025
cbbaef5
added program to process in devnode_execute
Roee-87 Nov 6, 2025
df6b0f9
added evaluation check for devnode execution
Roee-87 Nov 6, 2025
256cc22
fixed indentations
Roee-87 Nov 7, 2025
48e053f
ran cargo fmt
Roee-87 Nov 7, 2025
f4dda32
added code for devnode deployments
Roee-87 Nov 14, 2025
e3f56da
set edition to 0 for devnode deploy
Roee-87 Nov 14, 2025
ffe8043
added method for fetching program edition
Roee-87 Nov 19, 2025
aea94c2
added code for generating deployment txn without certificate
Roee-87 Nov 19, 2025
c30da85
ran cargo fmt
Roee-87 Nov 19, 2025
b83918f
revert changes to index.js
Roee-87 Nov 20, 2025
60d724d
removed snarkvm dev features from Cargo.toml
Roee-87 Nov 24, 2025
dadb68e
added consts for devnode vkey and cert
Roee-87 Nov 24, 2025
8e77c2d
updated snarkvm rev
Roee-87 Nov 24, 2025
1fdc0f3
refactored assert! in devnode deploy
Roee-87 Nov 24, 2025
12a137d
added devnode upgrade
Roee-87 Nov 24, 2025
1abc681
refactored to include separate execution and deployment methods for d…
Roee-87 Nov 24, 2025
9044cff
ran cargo fmt
Roee-87 Nov 24, 2025
3204a23
updated devnode deploy
Roee-87 Nov 24, 2025
635ca62
pulled in latest main
Roee-87 Nov 24, 2025
031da5f
Delete .env
Roee-87 Nov 24, 2025
d98b7e6
Delete create-leo-app/template-node/.env
Roee-87 Nov 24, 2025
9994ac8
added devnode upgrade to program manager and updated docs
Roee-87 Nov 24, 2025
91e536b
updated build devnode upgrade method
Roee-87 Nov 24, 2025
2ecc9a1
fixed docstrings
Roee-87 Nov 25, 2025
98e4baf
fixed docstrings
Roee-87 Nov 25, 2025
fba72b9
added create-leo-app example
Roee-87 Nov 25, 2025
b9f68eb
fixed typo
Roee-87 Nov 25, 2025
5e14c26
updated readme
Roee-87 Nov 25, 2025
8be8621
replaced log! with log
Roee-87 Nov 25, 2025
f75dabe
regenerated docs
Roee-87 Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions create-leo-app/template-devnode-js/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Aleo Local Development Server + Node.js

## Initializing a Leo Devnode server
Note: Prior to the release of Leo 4.4.0, the Leo CLI should be installed from the following commit in order to use the Devnode tool: [5baf94e](https://github.com/ProvableHQ/leo/pull/28982/commits/5baf94e491189b89dca7c981c2b79dfc6af1d108)

The Leo Devnode server is designed to enable developers to rapidly iterate on their Aleo program design. Deployment transactions do not require key synthesis or certificate generation and execution transitions do not require proofs.

To initialize a Devnode server, run the following command:
```bash
leo devnode start --private-key APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
```
with optional `--verbosity` feature flag with settings `0, 1, and 2`.

There is an additional command which lets users "fast-forward" a specified number of blocks:
```
leo devnode advance N
```
for an integer `N`.

The default setting will initialize the server to the latest Consensus Version.

To terminate the Devnode, simply use `ctrl + c`.

## Example
The example code in the `index.js` file deploys a sample program to the Devnode, then submits an upgrade transaction which adds a new method to the existing program, and then submits an execution transaction that uses the new method.
The code can be run using:
```bash
yarn dev
```
Note: The Devnode support programs with dependencies, but the SDK's Devnode deploy method does not currently support nested deployments. Each dependency must be deployed independently using the `buildDevnodeDeploymentTransaction` method.




24 changes: 24 additions & 0 deletions create-leo-app/template-devnode-js/_gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
76 changes: 76 additions & 0 deletions create-leo-app/template-devnode-js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/usr/bin/env ts-node
import { Account, ProgramManager, initThreadPool, NetworkRecordProvider, AleoNetworkClient, getOrInitConsensusVersionTestHeights } from '@provablehq/sdk';

const program = `program test_program.aleo;

function main:
input r0 as u32.public;
input r1 as u32.private;
add r0 r1 into r2;
output r2 as u32.private;

constructor:
assert.eq program_owner aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px;`;

const upgraded_program = `program test_program.aleo;

function main:
input r0 as u32.public;
input r1 as u32.private;
add r0 r1 into r2;
output r2 as u32.private;

function new_transition:
input r0 as u32.private;
input r1 as u32.private;
add r0 r1 into r2;
output r2 as u32.private;

constructor:
assert.eq program_owner aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px;`;

async function main() {
// Initialize multi-threading to allow WASM execution.
await initThreadPool();
const heights = getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11");

const privateKey = "APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH";
const account = new Account({privateKey});
const networkClient = new AleoNetworkClient("http://localhost:3030");
const recordProvider = new NetworkRecordProvider(account, networkClient);

const programManager = new ProgramManager("http://localhost:3030", recordProvider );
programManager.setAccount(account);


const tx_1 = await programManager.buildDevnodeDeploymentTransaction({program: program, priorityFee: 0, privateFee: false});
console.log("Program deployed - response:", tx_1.toString());
await programManager.networkClient.submitTransaction(tx_1);

const tx_2 = await programManager.buildDevnodeUpgradeTransaction({program: upgraded_program, priorityFee: 0, privateFee: false});
await programManager.networkClient.submitTransaction(tx_2);
console.log("Program deployed - response:", tx_2);


const tx_3 = await programManager.buildDevnodeExecutionTransaction({
privateKey: account.privateKey(),
programName: "test_program.aleo",
functionName: "new_transition",
privateFee: false,
inputs: ["2u32", "4u32"],
priorityFee: 0.0,
edition: 0,
skipProof: true,
});
await programManager.networkClient.submitTransaction(tx_3);
console.log("Transaction submitted - response:", tx_3.toString());
}


main()
.then(_ => {
})
.catch(err => {
console.log(err)
process.exit(1)
});
12 changes: 12 additions & 0 deletions create-leo-app/template-devnode-js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "devnode-starter",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "node index.js"
},
"dependencies": {
"@provablehq/sdk": "^0.9.12"
}
}
Loading
Loading