Skip to content

Commit 14309d1

Browse files
authored
Merge pull request #483 from ProvableHQ/rr-update-deploy-and-execute
Update deploy and execute sections
2 parents 5ccfb4d + 31c2dd4 commit 14309d1

File tree

4 files changed

+80
-7
lines changed

4 files changed

+80
-7
lines changed

documentation/cli/01_deploying.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,59 @@ title: Deploy Your Programs
44
sidebar_label: Deploy
55
---
66

7-
<!--TODO:-->
87

9-
Coming soon!
8+
The `leo deploy` command is used for deploying Leo program to a local devnet, Testnet, or Mainnet.
9+
10+
The following parameters need to be specified in either a `.env` file or as environment variables: the target network, the Private Key, and a node API endpoint.
11+
12+
An `.env` file should be formatted as follows:
13+
```bash
14+
NETWORK=testnet
15+
PRIVATE_KEY=APrivateKey1z...GPWH
16+
ENDPOINT=https://api.explorer.provable.com/v1
17+
```
18+
From the root of the Leo program directory, run the following command:
19+
```bash
20+
leo deploy
21+
```
22+
23+
Alternatively, the command syntax accomodates enviroment variables:
24+
```bash
25+
leo deploy --endpoint "{ENDPOINT} --private-key "{$PRIVATE_KEY}"
26+
```
27+
28+
If a Leo program includes local dependencies, the `--recursive flag` will automatically deploy all dependency programs in order.
29+
The following example program has one local dependency.
30+
31+
```bash
32+
example_program
33+
├── local_dependency
34+
│ ├── src
35+
│ │ └── main.leo
36+
│ ├── .env
37+
│ └── program.json
38+
├── src
39+
│ └── main.leo
40+
├── .env
41+
└── program.json
42+
```
43+
From the root of the `example_program` directory, run the following command:
44+
```bash
45+
leo deploy --recursive
46+
```
47+
48+
This will generate a deploy prompt for `local_dependency.aleo`.
49+
50+
```bash
51+
? Do you want to submit deployment of program `local_dependency.aleo` to network testnet via endpoint http://localhost:3030 using address aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px? (y/n) ›
52+
```
53+
54+
After deploying the dependency program, a second deploy prompt will appear for the main program.
55+
56+
```bash
57+
? Do you want to submit deployment of program `example_program.aleo` to network testnet via endpoint http://localhost:3030 using address aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px? (y/n) ›
58+
```
59+
60+
When deploying to either the Testnet or Mainnet using public credits, there is a 12 second delay between programs deployments. This ensures that programs are deployed in separate blocks and prevents the network from attempting to deploy multiple programs to the same blocks if sufficient funds are not available for the final deployment.
61+
62+

documentation/cli/02_executing.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ title: Run Your Programs
44
sidebar_label: Execute
55
---
66

7-
<!--TODO:-->
87

9-
Coming soon!
8+
The `leo execute` command is used to call functions from deployed programs. Under the hood, this commands downloads the program code from the specified network, synthesizes the program circuit, executes the function logic, generates proving verifying keys along with a zero-knowledge proof, and then submits a transaction object to the network.
9+
10+
The full syntax for the `leo execute` command is:
11+
```bash
12+
leo execute <method_name> [input_1] [input_2] ... [input_n] --program <program_name>.aleo --broadcast
13+
```
14+
As with the `leo deploy` command, you must specify the network, Private Key, and node endpoint parameters using either a `.env` file or environment variables.
15+
16+
Developers have the option to inspect a transaction object before it is broadcast to the network using the `--dry-run` flag in lieu of the `--broadcast` flag. Invoking this flag will print the transaction output to `stdout`.
17+
18+
```bash
19+
leo execute <methbod_name> [input_1] [input_2] ... [input_n] --program <program_name>.aleo --dry-run
20+
```
21+
22+
```bash
23+
{"type":"execute","id":"at1lmse7pr4h0n3lv9mvn262up7v0nhyulm9ygn3kwpxym9008deygs4elkl9","execution":{"transitions":[{"id":"au1w7n6ahdjmvj2nz9nu6zhzq35v93nguwhv3tzqeywhntrxytmngpqfhg5ss","program":"example_program.aleo","function":"main","inputs":[{"type":"public","id":"692634202775738788892756541276479310312882753688899140142743446375832543859field","value":"2u32"},{"type":"private","id":"8385995819199163615771507865968584985436639267963028732797694416477829379079field","value":"ciphertext1qyqru0tr39h8kzquxjr7xfrud98m47mawmnvj5xlfnypzyvhepf7xzsawdtkl"}],"outputs":[{"type":"private","id":"3124422272714190443592630115423959519403736569564003413462129091659624867451field","value":"ciphertext1qyq08lr8g88k20xp6k9fr34l07fjaaddmdpnfpmdlxwz3mr6xrfjzqqf5nfna"}],"tpk":"4367604861311133041917107666803824204733856429271239279390409648472266500776group","tcm":"7471894725277672051255805412199677748935089735919789147124444004458893515904field","scm":"1788545946703859533314929059553927884362701746091184516349398904143684696559field"}],"global_state_root":"sr1pezvtfwkhq742lzngn8sc89t5s0ez4u64ux73dw2c7kvk5tjnqxqcz79km","proof":"proof1qyqsqqqqqqqqqqqpqqqqqqqqqqqfzm7qyhzn32nrg30d85qg7725jy8rnrhx5sp2xgkkx3jjzp3rttmg2lra09573rttj5pp0wmpx0cpq8xvl6s6zl3p6fn9hdqsyg5x2rz234l5g9knp0x6faex4dqxcpfs28rgy9rcl9qj8963g333f4egfqvqay0anlee9jwl9276cnh0kuhem3cafhacdyvpa74y28kkeuudxgufxg5qfd5h2sy520kjl8u8qsqh8e9rxlwp6v9059z8zzz26ytdcd7zdsl4l4xp2vn6aaanr0695knljv369h0xvphmxns7m5k7tpuqhptx8z6nvemvt7muchne4rx2rfmpv0pedxf8ms33pxte0hnlpfpdvtjnckcpejzwqjez8y70cyasppxggphh6fqehee9u58lklg3a750gxtjxxfq0z0g2cx0zmkf30tkwwqhlke7vljyswks4lynp46lqqudm45k79s27wgjluza8sc8vq8ld9evrqmj7mz4s9wm9qts4qzajl2f3q6t2f5mv55ctfp0svj3sqq8l6ujt79v93smpkcry9uxd87tdkypz8n2v0p35zrtkjjwh697gu6lxj5fpmu2x94m5gth8hnfy6qsvr9mn5adppml6wyzur60cuegjdnduhytqptpd2630aq5chht4h93flg0yzfq3har5dtnqcgxc0up09p9nt045c5umvlzuxkgzupsfdkarg0rzqdyy6n93fyeh25zru9nh96n04hm0aajjt0tmkspfgza7zmf8tfkk88gcf7wse3f346x5qeh4s2fjsf8zcj7zkcqnmq3nwevq68rkp8n3jae8d2r8qmp5c8dp6rzhsnkzx2lhxk4jhtwcnevcuqjv5l63ujac63p34s0lpqq7cxqplptw40z23nzaag0cz6yqdceguu352cc83spfds8esu92t2mukc2l3428sy8lt99fat8hmx7dej5kacuvt5rqz9y4hpjf72ll4ppyyqjvt8lya4vqqn48906ra7rtnh6yljc20dajs44c4m8z6flcjz8srxdpxce8szs7u2ty6gagcjfujzcdda43rk0k8jcta59jrcrxygtztps86cddvjg6rmmcasg30mmgx9d808clkrm0kqranpnr3djrv4qvdhqxn74w3050l7q4j3guv7cmgyt8gefg8zp58nc8zvj67vhqccdqvqqqqqqqqqqpj990s7fz7fpur5rs6wxupkx74kf9n83eslsqj5l0sv6cvj6q82gphgq8xgzh2gv50yzckgxzayxsyqfjllqh2jdg0y6dxxtpvw7dezaum7yscyahyxre33d50jput3jwz24zwpxfudrwn36zrqvy5xg2fcqqyrvaynt8rrcqzwt3lfk92xdln9yh3w9l3r7hnnrulpnvjtzau7sdpl6822ced9ee240am4dwq75vu8l29f8jky86m8epuqe4wge63ue79txmq4vhlzwk758d066xmz3qyqqj3xtvg"}}
24+
```

documentation/cli/04_dependencies.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ or
2626
leo add credits
2727
```
2828

29-
If you are deplolying to mainnet, you will need to specify mainnet imports using the `--network` flag as follows:
29+
If you are deploying to mainnet, you will need to specify mainnet imports using the `--network` flag as follows:
3030

3131
```
3232
leo add credits --network mainnet
@@ -51,6 +51,11 @@ For the first imported dependency, a new `dependencies` field will be added to t
5151
}
5252
```
5353

54+
Dependencies can be removed using the `leo remove` command:
55+
```bash
56+
leo remove credits.aleo
57+
```
58+
5459
## Local development
5560
When deploying to a local devnet, specify the path for the local dependency as follows:
5661

@@ -76,7 +81,7 @@ The dependencies section in the `program.json` manifest should include the path:
7681
```
7782

7883
## Deploying to a program with local dependencies to a network.
79-
When deploying a program that uses local dependcies, use the following command:
84+
When deploying a program that uses local dependencies, use the following command:
8085
```bash
8186
leo deploy --recursive
8287
```

documentation/testing/03_devnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ leo deploy
104104
105105
After deploying your program, you can call methods using the following command syntax:
106106
```bash
107-
leo execute <method_name> [input1] [input2...] --program <program_name>.aleo --broadcast
107+
leo execute <method_name> [input_1] [input_2] ... [input_n] --program <program_name>.aleo --broadcast
108108
```
109109
110110
## API endpoints

0 commit comments

Comments
 (0)