You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/testing/03_devnet.md
+79-2Lines changed: 79 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,8 @@ A local devnet can be a heavyweight but reliable way to test your application on
8
8
9
9
## Setup
10
10
11
-
To run a local devnet, you'll need to install [snarkOS](https://developer.aleo.org/guides/introduction/getting_started#2-installing-snarkos).
11
+
To run a local devnet, you'll need to install [snarkOS](https://developer.aleo.org/guides/introduction/getting_started#2-installing-snarkos).
12
+
Be sure to use the latest [release](https://github.com/ProvableHQ/snarkOS/releases).
12
13
You'll also need `tmux` (instructions below) and the [devnet.sh](https://github.com/ProvableHQ/snarkOS/blob/staging/devnet.sh) script in the `snarkOS` repository.
13
14
14
15
<details><summary>macOS</summary>
@@ -49,7 +50,20 @@ sudo apt install tmux
49
50
50
51
### Runing the Devnet
51
52
52
-
Run the `devnet.sh` script and follow the prompts.
53
+
From the root of the SnarkOS repository, run the `devnet.sh` script and follow the prompts. Alternatively, you can copy the script to your project's directory.
54
+
55
+
```bash
56
+
Enter the total number of validators (default: 4):
57
+
Enter the total number of clients (default: 2):
58
+
Enter the network ID (mainnet = 0, testnet = 1, canary = 2) (default: 1):
59
+
Do you want to run 'cargo install --locked --path .' to build the binary? (y/n, default: y): n
60
+
Do you want to clear the existing ledger history? (y/n, default: n):
61
+
```
62
+
Note: The minimum number of validators to run a local devnet is 4.
63
+
64
+
If you have already installed the SnarkOS CLI, you do not need to build the binary.
65
+
66
+
Clearing the ledger history may be useful if you wish to redploy your program without changing the name. However, this will erase all transaction history and start a new instance of the Aleo blockchain from genesis.
53
67
54
68
`tmux` allows you to toggle between nodes in your local devnet. Here are some useful (default) commands:
The PRIVATE_KEY above is same one that is generated by default when you create a new Leo project using the `leo new` command. It will be seeded with ample test credits in the devnet.
98
+
To deploy your program, run the following command:
99
+
```bash
100
+
leo deploy
101
+
```
102
+
103
+
## Executing Transactions
104
+
105
+
After deploying your program, you can call methods using the following command syntax:
106
+
```bash
107
+
leo execute <method_name> [input1] [input2...] --program <program_name>.aleo --broadcast
108
+
```
109
+
110
+
## API endpoints
111
+
112
+
You can check your transactions by using the following API endpoint:
113
+
114
+
```bash
115
+
GET http://localhost:3030/testnet/transaction/{transaction_id}
116
+
```
117
+
118
+
The transaction API endpoint is instructive in verifying whether a transaction succeeded or failed. Since both successful and failed transaction execute a fee transaction, if only the fee transaction appears, that is a clear indication that the transaction has failed. Note that on the Testnet and on Mainnet, failed transactions still require a fee since the network is performing a computation.
119
+
120
+
A full list of API endpoints is available [here](https://developer.aleo.org/references/apis/public_api/)
121
+
122
+
## Record Scanning
123
+
124
+
You can use the SnarkOS CLI to view your Records using the following command syntax:
0 commit comments