leo execute
You can execute a transition function by using the leo execute command. This differs from the leo run command in that a transaction and proof of execution are produced, and optionally can be broadcasted to the network.
To execute a Leo transition function with inputs from the command line, run the following command:
leo execute <TRANSITION_NAME> <INPUTS>
where <TRANSITION_NAME> is the name of the transition or async transition function to execute and <INPUTS>is a list of inputs to the program separated by spaces.
This command requires having a funded account.
Under the hood, this command synthesizes the program circuit and generates proving and verifying keys.
Leo ... statements before dead code elimination.
Leo ... statements after dead code elimination.
Leo The program checksum is: '[...]'.
Leo β
Compiled '{PROGRAM_NAME}.aleo' into Aleo instructions.
π’ Using the following consensus heights: 0,2950000,4800000,6625000,6765000,7600000,8365000,9173000,9800000
To override, pass in `--consensus-heights` or override the environment variable `CONSENSUS_VERSION_HEIGHTS`.
Attempting to determine the consensus version from the latest block height at {ENDPOINT}...
π Execution Plan Summary
ββββββββββββββββββββββββββββββββββββββββββββββ
π§ Configuration:
Private Key: {PRIVATE_KEY}
Address: {ADDRESS}
Endpoint: {ENDPOINT}
Network: {NETWORK}
Consensus Version: {CONSENSUS_VERSION}
π― Execution Target:
Program: {PROGRAM_NAME}.aleo
Function: {FUNCTION_NAME}
Source: remote
πΈ Fee Info:
Priority Fee: {PRIORITY_FEE} ΞΌcredits
Fee Record: no (public fee) | {FEE RECORD}
βοΈ Actions:
- Program and its dependencies will be downloaded from the network.
- Transaction will NOT be printed to the console.
- Transaction will NOT be saved to a file.
- Transaction will NOT be broadcast to the network.
π Execution Summary for {PROGRAM_NAME}.aleo
ββββββββββββββββββββββββββββββββββββββββββββββ
π° Cost Breakdown (credits)
Transaction Storage: ...
Onβchain Execution: ...
Priority Fee: ...
Total Fee: ...
ββββββββββββββββββββββββββββββββββββββββββββββ
β‘οΈ Outputs
β’ {OUTPUT_0}
β’ {OUTPUT_1}
...
See the Executing guide for more details.
Flags:β
--private-key <PRIVATE_KEY>β
Specifies the private key to use for the deployment. Overrides any $PRIVATE_KEY environment variable set manually or in a .env file.
--network <NETWORK>β
Specifies the network to deploy to. Overrides any NETWORK environment variable set manually or in a .env file. Valid network names are testnet, mainnet, and canary.
--endpoint <ENDPOINT>β
The endpoint to deploy to. Overrides any ENDPOINT environment variable set manually or in a .env file.
Common Endpoints:
| Network | Endpoint |
|---|---|
| Devnet (local) | https://localhost:3030 |
| Testnet | https://api.explorer.provable.com/v1 |
| Mainnet | https://api.explorer.provable.com/v1 |
--devnetβ
Specifies whether the network being deployed to is a devnet. If not set, defaults to the DEVNET environment variable.
This flag requires a devnet to be running locally. See INSERT DEVNET GUIDE HERE for more information
-printβ
Prints the transaction to the terminal/stdout in JSON format.
-broadcastβ
Broadcasts the transaction to the network upon successful execution. Without passing this flag, the transaction will just be generated locally.
--save <SAVE>β
Saves the transaction to the directory located at the <SAVE> path.
-yβ
--yesβ
The CLI will ask for manual confirmation on several steps throughout the deployment process. Setting this flag automatically agrees to all confirmations.
Do not use this feature unless you know what you are doing!
--priority-fees <PRIORITY_FEES>β
Specifes the priority fee for the deployment transaction(s) delimited by | and used in order. The fees are in microcredits and must either be valid u64 or default. Defaults to 0.
1 Credit == 1,000,000 Microcreditss
-f <FEE_RECORDS>β
--fee-records <FEE_RECORDS>β
Specifes the record(s) to pay for fees privately, delimited by | and used in order. The fees must either be valid plaintext, ciphertext, or default. If not specified, then transaction fees will be public.
--consensus-heights <CONSENSUS_HEIGHTS>β
Specifies the consensus heights to use, delimited by ,. This should only be set if you are using a custom devnet.
The following will enable Consensus_V0 at block 0, Consensus_V1 at block 1, etc.:
--consensus-heights 0,1,2,3....
--consensus-version <CONSENSUS_VERSION>β
Specifies the consensus version to use. If one is not provided, the CLI will attempt to determine it from the latest block.
--max-wait <MAX_WAIT>β
Specifies the number of seconds to wait for a block to appear when searching for a transaction. Defaults to 8 seconds.
--blocks-to-check <BLOCKS_TO_CHECK>β
Specifies the number of blocks to look at when searching for a transaction. Defaults to 12 blocks
Options:
--base-fees <BASE_FEES>
[UNUSED] Base fees in microcredits, delimited by `|`, and used in order. The fees must either be valid `u64` or `default`. Defaults to automatic calculation.
--offline
Enables offline mode.
--enable-ast-spans
Enable spans in AST snapshots.
--enable-dce
Enables dead code elimination in the compiler.
--conditional-block-max-depth <CONDITIONAL_BLOCK_MAX_DEPTH>
Max depth to type check nested conditionals. [default: 10]
--disable-conditional-branch-type-checking
Disable type checking of nested conditional branches in finalize scope.
--enable-initial-ast-snapshot
Write an AST snapshot immediately after parsing.
--enable-all-ast-snapshots
Writes all AST snapshots for the different compiler phases.
--ast-snapshots <AST_SNAPSHOTS>...
Comma separated list of passes whose AST snapshots to capture.
--build-tests
Build tests along with the main program and dependencies.
--no-cache
Don't use the dependency cache.
--no-local
Don't use the local source code.