Skip to content
Merged
Show file tree
Hide file tree
Changes from 27 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
268 changes: 266 additions & 2 deletions docs/api_reference/sdk-src_program-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ programManager.setAccount(Account);
const priorityFee = 0.0;

// Create the deployment transaction.
const tx = await programManager.buildDeploymentTransaction({program: program, priorityFee: fee, privateFee: false});
const tx = await programManager.buildUpgradeTransaction({program: program, priorityFee: fee, privateFee: false});
await programManager.networkClient.submitTransaction(tx);

// Verify the transaction was successful
Expand Down Expand Up @@ -1536,6 +1536,138 @@ const baseFeeCredits = Number(baseFeeMicrocredits)/1000000;

---

### `buildDevnodeExecutionTransaction(options) ► Promise.<Transaction>`

![modifier: public](images/badges/modifier-public.svg)

Builds an execution transaction for submission to the a local devnode.
This method skips proof generation and is not meant for use with the mainnet or testnet Aleo networks.

Parameters | Type | Description
--- | --- | ---
__options__ | `ExecuteOptions` | *The options for the execution transaction.*
__*return*__ | `Promise.<Transaction>` | *- A promise that resolves to the transaction or an error.*

#### Examples

```javascript
/// Import the mainnet version of the sdk.
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";

// Create a new NetworkClient and RecordProvider.
const recordProvider = new NetworkRecordProvider(account, networkClient);
keyProvider.useCache(true);

// Initialize a program manager.
const programManager = new ProgramManager("http://localhost:3030", recordProvider);

// Build and execute the transaction
const tx = await programManager.buildDevnodeExecutionTransaction({
programName: "hello_hello.aleo",
functionName: "hello_hello",
priorityFee: 0.0,
privateFee: false,
inputs: ["5u32", "5u32"],
});

// Submit the transaction to the network
await programManager.networkClient.submitTransaction(tx.toString());

// Verify the transaction was successful
setTimeout(async () => {
const transaction = await programManager.networkClient.getTransaction(tx.id());
assert(transaction.id() === tx.id());
}, 10000);
```

---

### `buildDevnodeDeploymentTransaction(options) ► string`

![modifier: public](images/badges/modifier-public.svg)

Builds a deployment transaction with dummy certificates and verifier keys.
Intended for use with a local devnode.

Parameters | Type | Description
--- | --- | ---
__options__ | `DeployOptions` | *The options for the deployment transaction.*
__*return*__ | `string` | *The transaction id of the deployed program or a failure message from the network*

#### Examples

```javascript
/// Import the mainnet version of the sdk.
import { ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";

// Create a new NetworkClient, and RecordProvider
const recordProvider = new NetworkRecordProvider(account, networkClient);
keyProvider.useCache(true);

// Initialize a program manager with the key provider to automatically fetch keys for deployments
const program = "program hello_hello.aleo;\n\nfunction hello:\n input r0 as u32.public;\n input r1 as u32.private;\n add r0 r1 into r2;\n output r2 as u32.private;\n";
const programManager = new ProgramManager("http://localhost:3030", recordProvider);
programManager.setAccount(Account);

// Define a fee in credits
const priorityFee = 0.0;

// Create the deployment transaction.
const tx = await programManager.buildDevnodeDeploymentTransaction({program: program, fee: priorityFee, privateFee: false});
await programManager.networkClient.submitTransaction(tx);

// Verify the transaction was successful
setTimeout(async () => {
const transaction = await programManager.networkClient.getTransaction(tx.id());
assert(transaction.id() === tx.id());
}, 20000);
```

---

### `buildDevnodeUpgradeTransaction(options) ► string`

![modifier: public](images/badges/modifier-public.svg)

Builds a deployment transaction with dummy certificates and verifier keys for upgrading programs deployed on a local devnode.
This method is only intended for use with a local devnode.

Parameters | Type | Description
--- | --- | ---
__options__ | `DeployOptions` | *The options for the deployment transaction.*
__*return*__ | `string` | *The transaction id of the deployed program or a failure message from the network*

#### Examples

```javascript
/// Import the mainnet version of the sdk.
import { ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";

// Create a new NetworkClient, and RecordProvider
const recordProvider = new NetworkRecordProvider(account, networkClient);
keyProvider.useCache(true);

// Initialize a program manager with the key provider to automatically fetch keys for deployments
const program = "program hello_hello.aleo;\n\nfunction hello:\n input r0 as u32.public;\n input r1 as u32.private;\n add r0 r1 into r2;\n output r2 as u32.private;\n";
const programManager = new ProgramManager("http://localhost:3030", recordProvider);
programManager.setAccount(Account);

// Define a fee in credits
const priorityFee = 0.0;

// Create the deployment transaction.
const tx = await programManager.buildDevnodeUpgradeTransaction({program: program, fee: priorityFee, privateFee: false});
await programManager.networkClient.submitTransaction(tx);

// Verify the transaction was successful
setTimeout(async () => {
const transaction = await programManager.networkClient.getTransaction(tx.id());
assert(transaction.id() === tx.id());
}, 20000);
```

---

### `checkFee(address, feeAmount)`

![modifier: public](images/badges/modifier-public.svg)
Expand Down Expand Up @@ -1753,7 +1885,7 @@ programManager.setAccount(Account);
const priorityFee = 0.0;

// Create the deployment transaction.
const tx = await programManager.buildDeploymentTransaction({program: program, priorityFee: fee, privateFee: false});
const tx = await programManager.buildUpgradeTransaction({program: program, priorityFee: fee, privateFee: false});
await programManager.networkClient.submitTransaction(tx);

// Verify the transaction was successful
Expand Down Expand Up @@ -3052,3 +3184,135 @@ const baseFeeCredits = Number(baseFeeMicrocredits)/1000000;
```

---

### `buildDevnodeExecutionTransaction(options) ► Promise.<Transaction>`

![modifier: public](images/badges/modifier-public.svg)

Builds an execution transaction for submission to the a local devnode.
This method skips proof generation and is not meant for use with the mainnet or testnet Aleo networks.

Parameters | Type | Description
--- | --- | ---
__options__ | `ExecuteOptions` | *The options for the execution transaction.*
__*return*__ | `Promise.<Transaction>` | *- A promise that resolves to the transaction or an error.*

#### Examples

```javascript
/// Import the mainnet version of the sdk.
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";

// Create a new NetworkClient and RecordProvider.
const recordProvider = new NetworkRecordProvider(account, networkClient);
keyProvider.useCache(true);

// Initialize a program manager.
const programManager = new ProgramManager("http://localhost:3030", recordProvider);

// Build and execute the transaction
const tx = await programManager.buildDevnodeExecutionTransaction({
programName: "hello_hello.aleo",
functionName: "hello_hello",
priorityFee: 0.0,
privateFee: false,
inputs: ["5u32", "5u32"],
});

// Submit the transaction to the network
await programManager.networkClient.submitTransaction(tx.toString());

// Verify the transaction was successful
setTimeout(async () => {
const transaction = await programManager.networkClient.getTransaction(tx.id());
assert(transaction.id() === tx.id());
}, 10000);
```

---

### `buildDevnodeDeploymentTransaction(options) ► string`

![modifier: public](images/badges/modifier-public.svg)

Builds a deployment transaction with dummy certificates and verifier keys.
Intended for use with a local devnode.

Parameters | Type | Description
--- | --- | ---
__options__ | `DeployOptions` | *The options for the deployment transaction.*
__*return*__ | `string` | *The transaction id of the deployed program or a failure message from the network*

#### Examples

```javascript
/// Import the mainnet version of the sdk.
import { ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";

// Create a new NetworkClient, and RecordProvider
const recordProvider = new NetworkRecordProvider(account, networkClient);
keyProvider.useCache(true);

// Initialize a program manager with the key provider to automatically fetch keys for deployments
const program = "program hello_hello.aleo;\n\nfunction hello:\n input r0 as u32.public;\n input r1 as u32.private;\n add r0 r1 into r2;\n output r2 as u32.private;\n";
const programManager = new ProgramManager("http://localhost:3030", recordProvider);
programManager.setAccount(Account);

// Define a fee in credits
const priorityFee = 0.0;

// Create the deployment transaction.
const tx = await programManager.buildDevnodeDeploymentTransaction({program: program, fee: priorityFee, privateFee: false});
await programManager.networkClient.submitTransaction(tx);

// Verify the transaction was successful
setTimeout(async () => {
const transaction = await programManager.networkClient.getTransaction(tx.id());
assert(transaction.id() === tx.id());
}, 20000);
```

---

### `buildDevnodeUpgradeTransaction(options) ► string`

![modifier: public](images/badges/modifier-public.svg)

Builds a deployment transaction with dummy certificates and verifier keys for upgrading programs deployed on a local devnode.
This method is only intended for use with a local devnode.

Parameters | Type | Description
--- | --- | ---
__options__ | `DeployOptions` | *The options for the deployment transaction.*
__*return*__ | `string` | *The transaction id of the deployed program or a failure message from the network*

#### Examples

```javascript
/// Import the mainnet version of the sdk.
import { ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";

// Create a new NetworkClient, and RecordProvider
const recordProvider = new NetworkRecordProvider(account, networkClient);
keyProvider.useCache(true);

// Initialize a program manager with the key provider to automatically fetch keys for deployments
const program = "program hello_hello.aleo;\n\nfunction hello:\n input r0 as u32.public;\n input r1 as u32.private;\n add r0 r1 into r2;\n output r2 as u32.private;\n";
const programManager = new ProgramManager("http://localhost:3030", recordProvider);
programManager.setAccount(Account);

// Define a fee in credits
const priorityFee = 0.0;

// Create the deployment transaction.
const tx = await programManager.buildDevnodeUpgradeTransaction({program: program, fee: priorityFee, privateFee: false});
await programManager.networkClient.submitTransaction(tx);

// Verify the transaction was successful
setTimeout(async () => {
const transaction = await programManager.networkClient.getTransaction(tx.id());
assert(transaction.id() === tx.id());
}, 20000);
```

---
Loading
Loading