|
| 1 | +# Aligned CLI Documentation |
| 2 | + |
| 3 | +The Aligned CLI serves as an interface for users to interact with Aligned Layer. |
| 4 | + |
| 5 | +This document serves as a reference for the commands of the Aligned CLI. |
| 6 | + |
| 7 | +## Installation: |
| 8 | + |
| 9 | +1. Download and install Aligned from the Aligned GitHub repo `https://github.com/yetanotherco/aligned_layer`: |
| 10 | + |
| 11 | +```bash |
| 12 | +curl -L https://raw.githubusercontent.com/yetanotherco/aligned_layer/main/batcher/aligned/install_aligned.sh | bash |
| 13 | +``` |
| 14 | + |
| 15 | +2. A source command will be printed in your terminal after installation. Execute that command to update your shell environment. |
| 16 | + |
| 17 | +3. Verify that the installation was successful: |
| 18 | +```bash |
| 19 | +aligned --version |
| 20 | +``` |
| 21 | + |
| 22 | +## Help: |
| 23 | + |
| 24 | +To see the available commands, run: |
| 25 | +```bash |
| 26 | +aligned --help |
| 27 | +``` |
| 28 | + |
| 29 | +To see the usage of a command, run: |
| 30 | +```bash |
| 31 | +aligned [COMMAND] --help |
| 32 | +``` |
| 33 | + |
| 34 | +## CLI Commands |
| 35 | + |
| 36 | +### **submit** |
| 37 | + |
| 38 | +#### Description: |
| 39 | + |
| 40 | +Submit a proof to the Aligned Layer batcher. |
| 41 | + |
| 42 | +#### Command: |
| 43 | + |
| 44 | +`submit [OPTIONS] --proving_system <proving_system> --proof <proof_file_path>` |
| 45 | + |
| 46 | +#### Options: |
| 47 | +- `--batcher_url <batcher_connection_address>`: Websocket URL for the Aligned Layer batcher |
| 48 | + - Default: `ws://localhost:8080` |
| 49 | + - Mainnet: `wss://mainnet.batcher.alignedlayer.com` |
| 50 | + - Holesky: `wss://batcher.alignedlayer.com` |
| 51 | +- `--rpc_url <RPC_provider_url>`: User's Ethereum RPC provider connection address. |
| 52 | + - Default: `http://localhost:8545` |
| 53 | + - Mainnet: `https://ethereum-rpc.publicnode.com` |
| 54 | + - Holesky: `https://ethereum-holesky-rpc.publicnode.com` |
| 55 | + - Also, you can use your own Ethereum RPC providers. |
| 56 | +- `--proving_system <proving_system>`: Proof system of the submitted proof |
| 57 | + - Possible values: `GnarkPlonkBls12_381`, `GnarkPlonkBn254`, `Groth16Bn254`, `SP1`, `Risc0` |
| 58 | +- `--proof <proof_file_path>`: Path to the proof file. |
| 59 | +- `--public_input <public_input_file_path>`: Path to the public input file. |
| 60 | +- `--vk <verification_key_file_path>`: Path to the verification key file (required for specific proof systems). |
| 61 | +- `--vm_program <vm_program_code_file_path>`: Path to the VM program code file (required for some specific proof systems). |
| 62 | +- `--repetitions <n>`: Number of repetitions of the proof submission. |
| 63 | + - Default: `1` |
| 64 | +- `--proof_generator_addr <proof_generator_address>`: Proof generator address. |
| 65 | + - Default: `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266` (Anvil prefunded account 0) |
| 66 | +- `--aligned_verification_data_path <aligned_verification_data_directory_path>`: Directory for aligned verification data. |
| 67 | + - Default: `./aligned_verification_data/` |
| 68 | +- `--keystore_path <path_to_local_keystore>`: Path to the local keystore. |
| 69 | +- `--private_key <private_key>`: User's wallet private key. |
| 70 | +- `--max_fee <max_fee (ether)>`: Maximum fee in Ether to deposit into the contract. |
| 71 | + - Default: `0.0013ether` |
| 72 | +- `--nonce <n>`: Proof nonce. |
| 73 | + - By default, the nonce is set automatically. By setting the nonce manually, you can perform a proof replacement. |
| 74 | +- `--network <working_network_name>`: Network name to interact with. |
| 75 | + - Default: `devnet` |
| 76 | + - Possible values: `devnet`, `holesky`, `mainnet` |
| 77 | + |
| 78 | +#### Example: |
| 79 | +```bash |
| 80 | +aligned submit \ |
| 81 | +--proving_system Risc0 \ |
| 82 | +--proof ./scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci.proof \ |
| 83 | +--vm_program ./scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id.bin \ |
| 84 | +--public_input ./scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci.pub \ |
| 85 | +--repetitions <BURST_SIZE> \ |
| 86 | +--keystore_path <KEYSTORE_PATH> \ |
| 87 | +--batcher_url wss://batcher.alignedlayer.com \ |
| 88 | +--network holesky \ |
| 89 | +--rpc_url https://ethereum-holesky-rpc.publicnode.com \ |
| 90 | +--max_fee 0.0013ether |
| 91 | +``` |
| 92 | + |
| 93 | +--- |
| 94 | +### **verify-proof-onchain** |
| 95 | + |
| 96 | +#### Description: |
| 97 | + |
| 98 | +Check if a proof was verified by Aligned on Ethereum. |
| 99 | + |
| 100 | +#### Command: |
| 101 | + |
| 102 | +`verify-proof-onchain [OPTIONS] --aligned-verification-data <aligned_verification_data>` |
| 103 | + |
| 104 | +#### Options: |
| 105 | +- `--aligned-verification-data <aligned_verification_data>`: Path to the aligned verification data file. |
| 106 | +- `--rpc_url <RPC_provider_url>`: User's Ethereum RPC provider connection address. |
| 107 | + - Default: `http://localhost:8545` |
| 108 | + - Mainnet: `https://ethereum-rpc.publicnode.com` |
| 109 | + - Holesky: `https://ethereum-holesky-rpc.publicnode.com` |
| 110 | + - Also, you can use your own Ethereum RPC providers. |
| 111 | +- `--network <working_network_name>`: Network name to interact with. |
| 112 | + - Default: `devnet` |
| 113 | + - Possible values: `devnet`, `holesky`, `mainnet` |
| 114 | + |
| 115 | +#### Example: |
| 116 | +```bash |
| 117 | +aligned verify-proof-onchain \ |
| 118 | +--aligned-verification-data ./aligned_verification_data/<VERIFICATION_DATA_FILE> \ |
| 119 | +--network holesky \ |
| 120 | +--rpc_url https://ethereum-holesky-rpc.publicnode.com |
| 121 | +``` |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +### **get-vk-commitment** |
| 126 | + |
| 127 | +#### Description: |
| 128 | + |
| 129 | +Computes the verification data commitment from the verification data file. |
| 130 | + |
| 131 | +#### Command: |
| 132 | + |
| 133 | +`get-vk-commitment [OPTIONS] --verification_key_file <verification_key_file_path> --proving_system <proving_system>` |
| 134 | + |
| 135 | +#### Options: |
| 136 | +- `--verification_key_file <path_to_file>`: Path to the verification key file. |
| 137 | +- `--proving_system <proving_system>`: Proof system of the verification data file. |
| 138 | + - Possible values: `GnarkPlonkBls12_381`, `GnarkPlonkBn254`, `Groth16Bn254`, `SP1`, `Risc0` |
| 139 | +- `--output <path_to_file>`: File path to write the output. |
| 140 | + |
| 141 | +--- |
| 142 | + |
| 143 | +### deposit-to-batcher |
| 144 | + |
| 145 | +#### Description: |
| 146 | + |
| 147 | +Deposits Ethereum into the Aligned Layer's `BatcherPaymentService.sol` contract. |
| 148 | + |
| 149 | +#### Command: |
| 150 | + |
| 151 | +`deposit-to-batcher [OPTIONS] --keystore_path <path_to_local_keystore> --amount <amount_to_deposit>` |
| 152 | + |
| 153 | +#### Options: |
| 154 | +- `--keystore_path <path_to_local_keystore>`: Path to the local keystore. |
| 155 | +- `--rpc_url <RPC_provider_url>`: User's Ethereum RPC provider connection address. |
| 156 | + - Default: `http://localhost:8545` |
| 157 | + - Mainnet: `https://ethereum-rpc.publicnode.com` |
| 158 | + - Holesky: `https://ethereum-holesky-rpc.publicnode.com` |
| 159 | + - Also, you can use your own Ethereum RPC providers. |
| 160 | +- `--network <working_network_name>`: Network name to interact with. |
| 161 | + - Default: `devnet` |
| 162 | + - Possible values: `devnet`, `holesky`, `mainnet` |
| 163 | +- `--amount <amount (ether)>`: Amount of Ether to deposit. |
| 164 | + |
| 165 | +#### Example: |
| 166 | +```bash |
| 167 | +aligned deposit-to-batcher \ |
| 168 | +--network holesky \ |
| 169 | +--rpc_url https://ethereum-holesky-rpc.publicnode.com \ |
| 170 | +--amount 0.5ether \ |
| 171 | +--keystore_path <KEYSTORE_PATH> |
| 172 | +``` |
| 173 | + |
| 174 | +--- |
| 175 | + |
| 176 | +### **get-user-balance** |
| 177 | + |
| 178 | +#### Description: |
| 179 | + |
| 180 | +Retrieves the user's balance in the Aligned Layer's contract. |
| 181 | + |
| 182 | +#### Command: |
| 183 | + |
| 184 | +`get-user-balance [OPTIONS] --user_addr <user_ethereum_address>` |
| 185 | + |
| 186 | + |
| 187 | +#### Options: |
| 188 | +- `--network <working_network_name>`: Network name to interact with. |
| 189 | + - Default: `devnet` |
| 190 | + - Possible values: `devnet`, `holesky`, `mainnet` |
| 191 | +- `--rpc_url <RPC_provider_url>`: User's Ethereum RPC provider connection address. |
| 192 | + - Default: `http://localhost:8545` |
| 193 | + - Mainnet: `https://ethereum-rpc.publicnode.com` |
| 194 | + - Holesky: `https://ethereum-holesky-rpc.publicnode.com` |
| 195 | + - Also, you can use your own Ethereum RPC providers. |
| 196 | +- **`--user_addr`**: User's Ethereum address. |
| 197 | + |
| 198 | +#### Example: |
| 199 | +```bash |
| 200 | +aligned get-user-balance \ |
| 201 | +--user_addr <WALLET_ADDRESS> \ |
| 202 | +--network holesky \ |
| 203 | +--rpc_url https://ethereum-holesky-rpc.publicnode.com |
| 204 | +``` |
| 205 | + |
| 206 | +--- |
| 207 | + |
| 208 | +### **get-user-nonce** |
| 209 | + |
| 210 | + |
| 211 | +#### Description: |
| 212 | + |
| 213 | +Retrieves the user's current nonce from the batcher. |
| 214 | + |
| 215 | +#### Command: |
| 216 | + |
| 217 | +`get-user-nonce [OPTIONS] --user_addr <user_ethereum_address>` |
| 218 | + |
| 219 | +#### Options: |
| 220 | +- **`--batcher_url`**: Websocket URL for the Aligned Layer batcher. |
| 221 | + - Default: `ws://localhost:8080` |
| 222 | + - Mainnet: `wss://mainnet.batcher.alignedlayer.com` |
| 223 | + - Holesky: `wss://batcher.alignedlayer.com` |
| 224 | +- `--user_addr <user_address>`: User's Ethereum address. |
| 225 | + |
| 226 | +#### Example: |
| 227 | +```bash |
| 228 | +aligned get-user-nonce \ |
| 229 | +--user_addr <USER_ETH_ADDRESS> \ |
| 230 | +--batcher_url wss://batcher.alignedlayer.com |
| 231 | +``` |
0 commit comments