diff --git a/website/versioned_docs/version-v2.0_alpha/developers-references/typescript-code/cli.md b/website/versioned_docs/version-v2.0_alpha/developers-references/typescript-code/cli.md index f3179d80a5..b710d363c6 100644 --- a/website/versioned_docs/version-v2.0_alpha/developers-references/typescript-code/cli.md +++ b/website/versioned_docs/version-v2.0_alpha/developers-references/typescript-code/cli.md @@ -7,14 +7,9 @@ sidebar_position: 3 # Command-line interface -MACI provides a command-line interface that allows for effective deployment and -testing. Applications that build on top of MACI, such as -[clr.fund](https://clr.fund/), implement their own web UIs. +MACI provides a command-line interface that allows for effective deployment and testing. Applications that build on top of MACI, such as [clr.fund](https://clr.fund/), implement their own web UIs. -Note that all the example commands default to a local Ethereum testnet at -`http://localhost:8545`, and use the Ethereum private key -`0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3`. Do not -send any real funds to the address generated by this key. +Note that all the example commands default to a local Ethereum testnet at `http://localhost:8545`, and use the Ethereum private key `0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3`. Do not send any real funds to the address generated by this key. For testing purposes, you can run: @@ -25,31 +20,45 @@ pnpm run hardhat > Note that you will need a hardhat.config file in your current directory to be able to run the cli. +:::info +If you are looking to use MACI's cli to deploy the smart contracts, we recommend you instead use the smart contract tasks for a better experience. Please refer to the [deployment section](/docs/quick-start/deployment) for more information. +::: + ## Subcommands -| Command | Description | Options | -| -------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `create` | Deploy the contracts | `-i, --initialVoiceCredits `: The initial voice credits
`-p, --initialVoiceCreditsProxyAddress `: The initial voice credits proxy contract address
`-g, --signupGatekeeperAddress `: The signup gatekeeper contract address
`-ph3, --poseidonT3Address `: The PoseidonT3 contract address
`-ph4, --poseidonT4Address `: The PoseidonT4 contract address
`-ph5, --poseidonT5Address `: The PoseidonT5 contract address
`-ph6, --poseidonT6Address `: The PoseidonT6 contract address
`-g, --signupGatekeeperAddress `: The signup gatekeeper contract address
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL
`-s, --stateTreeDepth `: The state tree depth
`-uq, --use-quadratic-voting`: Whether to use quadratic voting | -| `checkVerifyingKeys` | Check that the verifying keys in the contract match the local ones | `-uq, --use-quadratic-voting"`: Whether to use quadratic voting
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL
`-vk, --vk-contract `: The VkRegistry contract address
`-s, --state-tree-depth `: The state tree depth
`-i, --int-state-tree-depth `: The intermediate state tree depth
`-m, --msg-tree-depth `: The message tree depth
`-v, --vote-option-tree-depth `: The vote option tree depth
`-b, --msg-batch-depth `: The message batch depth
`-p, --process-messages-zkey `: The process messages zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-t, --tally-votes-zkey `: The tally votes zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)) | -| `genMaciPubKey` | Generate a new MACI public key | `-sk, --privkey `: The private key
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `genMaciKeyPair` | Generate a new MACI key pair | `-sp, --seed `: seed value for keypair
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `airdrop` | Airdrop topup credits to the coordinator | `-a, --amount `: The amount of topup
`-x, --maci-address `: The MACI contract address
`-o, --poll-id `: Poll id
`-t, --token-address `: The token address
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `deployVkRegistry` | Deploy a new verification key registry contract | `-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `show` | Show the deployed contract addresses | `-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `deployPoll` | Deploy a new poll | `-vk, --vkRegistryAddress `: The vk registry contract address
`-t, --duration `: The poll duration in seconds
`-i, --int-state-tree-depth `: The int state tree depth
`-b, --msg-batch-depth `: The message tree sub depth
`-m, --msg-tree-depth `: The message tree depth
`-v, --vote-option-tree-depth `: The vote option tree depth
`-pk, --pubkey `: The coordinator public key
`-uq, --use-quadratic-voting"`: Whether to use quadratic voting
`-x, --maci-address `: The MACI contract address
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `setVerifyingKeys` | Set the verifying keys | `-s, --state-tree-depth `: The state tree depth
`-i, --int-state-tree-depth `: The intermediate state tree depth
`-m, --msg-tree-depth `: The message tree depth
`-v, --vote-option-tree-depth `: The vote option tree depth
`-b, --msg-batch-depth `: The message batch depth
`-pqv, --process-messages-zkey-qv `: The process messages qv zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-tqv, --tally-votes-zkey-qv `: The tally votes qv zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-pnqv, --process-messages-zkey-non-qv `: The process messages non-qv zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-tnqv, --tally-votes-zkey-non-qv `: The tally votes qv zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-uq, --use-quadratic-voting"`: Whether to use quadratic voting
`-k, --vk-registry `: The vk registry contract address
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `publish` | Publish a new message to a MACI Poll contract | `-p, --pubkey `: The MACI public key which should replace the user's public key in the state tree
`-x, --maci-address `: The MACI contract address
`-sk, --privkey `: Your serialized MACI private key
`-i, --state-index `: The user's state index
`-v, --vote-option-index `: The vote option index
`-n, --nonce `: The message nonce
`-s, --salt `: The message salt
`-o, --poll-id `: The poll id
`-w, --new-vote-weight `: The new vote weight
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `mergeMessages` | Merge the message accumulator queue | `-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL
`-x, --maci-address `: The MACI contract address
`-o, --poll-id `: The poll id
`-n, --num-queue-ops `: The number of queue operations | -| `mergeSignups` | Merge the signups accumulator queue | `-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL
`-x, --maci-address `: The MACI contract address
`-o, --poll-id `: The poll id
`-n, --num-queue-ops `: The number of queue operations | -| `timeTravel` | Fast-forward the time (only works for local hardhat testing) | `-s, --seconds `: The number of seconds to fast-forward
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `extractVkToFile` | Extract verification keys (vKey) from zKey files | `-pqv, --process-messages-zkey-qv `: The path of processMessagesQv zkey files
`-tqv, --tally-votes-zkey-qv `: The path of tallyVotesQv zkey files
`-pnqv, --process-messages-zkey-non-qv `: The path of processMessagesNonQv zkey files
`-tnqv, --tally-votes-zkey-non-qv `: The path of tallyVotesNonQv zkey files
| -| `signup` | Sign up to a MACI contract | `-p, --pubkey `: The MACI public key
`-x, --maci-address `: The MACI contract address
`-s, --sg-data `: The signup gateway data
`-i, --ivcp-data `: The initial voice credit proxy data
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `isRegisteredUser` | Checks if user is registered with public key | `-p, --pubkey `: The MACI public key
`-x, --maci-address `: The MACI contract address
`-q, --quiet`: Whether to print values to the console | -| `topup` | Top up an account with voice credits | `-a, --amount `: The amount of topup
`-x, --maci-address `: The MACI contract address
`-i, --state-index `: State leaf index
`-o, --poll-id `: Poll id
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `fundWallet` | Fund a wallet with Ether | `-a, --amount `: The amount of Ether
`-w, --address
`: The address to fund
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `verify` | Verify the results of a poll on-chain | `-o, --poll-id `: The poll id
`-t, --tally-file `: The tally file with results, per vote option spent credits, spent voice credits total
`-x, --maci-address `: The MACI contract address
`-tc, --tally-contract `: The tally contract address
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL | -| `genProofs` | Generate the proofs for a poll | `-sk, --privkey `: Your serialized MACI private key
`-x, --maci-address `: The MACI contract address
`-o, --poll-id `: The poll id
`-t, --tally-file `: The tally file
`-r, --rapidsnark `: The path to the rapidsnark binary
`-wp, --process-witnessgen `: The path to the process witness generation binary
`-pd, --process-witnessdat `: The path to the process witness dat file
`-wt, --tally-witnessgen `: The path to the tally witness generation binary
`-td, --tally-witnessdat `: The path to the tally witness dat file
`-zp, --process-zkey `-zt, --tally-zkey `: The path to the tally zkey
`-q, --quiet`: Whether to print values to the console
`-p, --rpc-provider `: The rpc provider URL
`-f, --output `: The output directory for proofs
`-tx, --transaction-hash :` Transaction hash of MACI contract creation
`-w, --wasm`: Whether to use the wasm binaries
`-pw, --process-wasm `: The path to the process witness generation wasm binary
`-tw, --tally-wasm `: The path to the tally witness generation wasm binary
`-st, --state-file `: The path to the state file containing the serialized maci state
`-sb, --start-block `: The block number to start looking for events from
`-eb, --end-block `: The block number to end looking for events from
`-bb, --blocks-per-batch `: The number of blocks to process per batch
`-uq, --use-quadratic-voting`: Whether to process messages and tally votes using quadratic voting or not | -| `proveOnChain` | Prove the results of a poll on chain | `-o, --poll-id `: The poll id
`-q, --quiet`: Whether to print values to the console
`-r, --rpc-provider `: The rpc provider URL
`-x, --maci-address `: The MACI contract address
`-p, --message-processor-address `: The message processor contract address
`-t, --tally-contract `: The tally contract address
`-f, --proof-dir `: The proof output directory from the genProofs subcommand | +For a full list of MACI CLI's commands, please run the following: + +```bash +maci-cli --help +``` + +For detailed information about each command please run: + +```bash +maci-cli --help +``` + +| Command | Description | +| -------------------- | ------------------------------------------------------------------ | +| `create` | Deploy the contracts | +| `deployVkRegistry` | Deploy a new VkRegistry contract | +| `setVerifyingKeys` | Set the verifying keys | +| `deployPoll` | Deploy a new poll | +| `checkVerifyingKeys` | Check that the verifying keys in the contract match the local ones | +| `genMaciPubKey` | Generate a new MACI public key | +| `genMaciKeyPair` | Generate a new MACI key pair | +| `show` | Show the deployed contract addresses | +| `publish` | Publish a new message to a MACI Poll contract | +| `mergeMessages` | Merge the message accumulator queue | +| `mergeSignups` | Merge the signups accumulator queue | +| `timeTravel` | Fast-forward the time (only works for local hardhat testing) | +| `extractVkToFile` | Extract verification keys (vKey) from zKey files | +| `signup` | Sign up to a MACI contract | +| `isRegisteredUser` | Checks if user is registered with public key | +| `fundWallet` | Fund a wallet with Ether | +| `verify` | Verify the results of a poll on-chain | +| `genProofs` | Generate the proofs for a poll | +| `proveOnChain` | Prove the results of a poll on chain | ## Public and private key format