Cli Module
Table of contents
Interfaces
- AirdropArgs
- DeployArgs
- DeployPollArgs
- DeployedContracts
- GenLocalStateArgs
- GenProofsArgs
- IGenKeypairArgs
- IRegisteredUserArgs
- MergeMessagesArgs
- MergeSignupsArgs
- PollContracts
- ProveOnChainArgs
- PublishArgs
- SignupArgs
- SubsidyData
- TallyData
- TopupArgs
- VerifyArgs
Functions
- airdrop
- checkVerifyingKeys
- deploy
- deployPoll
- deployVkRegistryContract
- fundWallet
- genKeyPair
- genLocalState
- genMaciPubKey
- genProofs
- getPoll
- isRegisteredUser
- mergeMessages
- mergeSignups
- proveOnChain
- publish
- setVerifyingKeys
- signup
- timeTravel
- topup
- verify
Functions
airdrop
▸ airdrop(AirdropArgs
): Promise
<void
>
Utility that can be used to get topup credits airdropped to the coordinator
Parameters
Name | Type | Description |
---|---|---|
AirdropArgs | AirdropArgs | The arguments for the airdrop command |
Returns
Promise
<void
>
Defined in
checkVerifyingKeys
▸ checkVerifyingKeys(CheckVerifyingKeysArgs
): Promise
<boolean
>
Command to confirm that the verifying keys in the contract match the local ones
Parameters
Name | Type | Description |
---|---|---|
CheckVerifyingKeysArgs | CheckVerifyingKeysArgs | The arguments for the checkVerifyingKeys command |
Returns
Promise
<boolean
>
Whether the verifying keys match or not
Note
see different options for zkey files to use specific circuits https://maci.pse.dev/docs/security/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing
Defined in
commands/checkVerifyingKeys.ts:28
deploy
▸ deploy(DeployArgs
): Promise
<DeployedContracts
>
Deploy MACI and related contracts
Parameters
Name | Type | Description |
---|---|---|
DeployArgs | DeployArgs | The arguments for the deploy command |
Returns
Promise
<DeployedContracts
>
The addresses of the deployed contracts
Defined in
deployPoll
▸ deployPoll(DeployPollArgs
): Promise
<PollContracts
>
Deploy a new Poll for the set of MACI's contracts already deployed
Parameters
Name | Type | Description |
---|---|---|
DeployPollArgs | DeployPollArgs | The arguments for the deployPoll command |
Returns
Promise
<PollContracts
>
The addresses of the deployed contracts
Defined in
deployVkRegistryContract
▸ deployVkRegistryContract(quiet
): Promise
<string
>
Deploy the vkRegistry contract
Parameters
Name | Type | Description |
---|---|---|
quiet | DeployVkRegistryArgs | whether to print the contract address |
Returns
Promise
<string
>
Defined in
commands/deployVkRegistry.ts:20
fundWallet
▸ fundWallet(«destructured»
): Promise
<void
>
Fund a new wallet with Ether
Parameters
Name | Type |
---|---|
«destructured» | FundWalletArgs |
Returns
Promise
<void
>
Defined in
genKeyPair
▸ genKeyPair(args
): Object
Generate a new Maci Key Pair and print it to the screen
Parameters
Name | Type | Description |
---|---|---|
args | IGenKeypairArgs | keypair generation params |
Returns
Object
- keypair
Name | Type |
---|---|
privateKey | string |
publicKey | string |
Defined in
genLocalState
▸ genLocalState(GenLocalStateArgs
): Promise
<void
>
Generate a local MACI state from the smart contracts events
Parameters
Name | Type | Description |
---|---|---|
GenLocalStateArgs | GenLocalStateArgs | The arguments for the genLocalState command |
Returns
Promise
<void
>
Defined in
genMaciPubKey
▸ genMaciPubKey(privkey
, quiet?
): string
Generate a new Maci Public key from a private key
Parameters
Name | Type | Default value | Description |
---|---|---|---|
privkey | string | undefined | - |
quiet | boolean | true | whether to log the output |
Returns
string
the public key serialized
Defined in
genProofs
▸ genProofs(GenProofsArgs
): Promise
<TallyData
>
Generate proofs for the message processing, tally and subsidy calculations
Parameters
Name | Type | Description |
---|---|---|
GenProofsArgs | GenProofsArgs | The arguments for the genProofs command |
Returns
Promise
<TallyData
>
The tally data
Note
see different options for zkey files to use specific circuits https://maci.pse.dev/docs/security/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing
Defined in
getPoll
▸ getPoll(args
): Promise
<IGetPollData
>
Get deployed poll from MACI contract
Parameters
Name | Type | Description |
---|---|---|
args | IGetPollArgs | The arguments for the get poll command |
Returns
Promise
<IGetPollData
>
poll data
Defined in
isRegisteredUser
▸ isRegisteredUser(IRegisteredArgs
): Promise
<{ isRegistered
: boolean
; stateIndex?
: string
}>
Checks if user is registered with public key
Parameters
Name | Type | Description |
---|---|---|
IRegisteredArgs | IRegisteredUserArgs | The arguments for the register check command |
Returns
Promise
<{ isRegistered
: boolean
; stateIndex?
: string
}>
user registered or not and state index
Defined in
mergeMessages
▸ mergeMessages(MergeMessagesArgs
): Promise
<void
>
Merge the message queue on chain
Parameters
Name | Type | Description |
---|---|---|
MergeMessagesArgs | MergeMessagesArgs | The arguments for the mergeMessages command |
Returns
Promise
<void
>
Defined in
mergeSignups
▸ mergeSignups(MergeSignupsArgs
): Promise
<void
>
Command to merge the signups of a MACI contract
Parameters
Name | Type | Description |
---|---|---|
MergeSignupsArgs | MergeSignupsArgs | The arguments for the mergeSignups command |
Returns
Promise
<void
>
Defined in
proveOnChain
▸ proveOnChain(ProveOnChainArgs
): Promise
<void
>
Command to prove the result of a poll on-chain
Parameters
Name | Type | Description |
---|---|---|
ProveOnChainArgs | ProveOnChainArgs | The arguments for the proveOnChain command |
Returns
Promise
<void
>
Defined in
publish
▸ publish(PublishArgs
): Promise
<string
>
Publish a new message to a MACI Poll contract
Parameters
Name | Type | Description |
---|---|---|
PublishArgs | PublishArgs | The arguments for the publish command |
Returns
Promise
<string
>
The ephemeral private key used to encrypt the message
Defined in
setVerifyingKeys
▸ setVerifyingKeys(SetVerifyingKeysArgs
): Promise
<void
>
Function that sets the verifying keys in the VkRegistry contract
Parameters
Name | Type | Description |
---|---|---|
SetVerifyingKeysArgs | SetVerifyingKeysArgs | The arguments for the setVerifyingKeys command |
Returns
Promise
<void
>
Note
see different options for zkey files to use specific circuits https://maci.pse.dev/docs/security/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing
Defined in
commands/setVerifyingKeys.ts:26
signup
▸ signup(args
): Promise
<ISignupData
>
Signup a user to the MACI contract
Parameters
Name | Type | Description |
---|---|---|
args | SignupArgs | The arguments for the signup command |
Returns
Promise
<ISignupData
>
The state index of the user and transaction hash
Defined in
timeTravel
▸ timeTravel(«destructured»
): Promise
<void
>
Utility to travel in time when using a local blockchain
Parameters
Name | Type |
---|---|
«destructured» | TimeTravelArgs |
Returns
Promise
<void
>
Defined in
topup
▸ topup(TopupArgs
): Promise
<void
>
Publish a topup message
Parameters
Name | Type | Description |
---|---|---|
TopupArgs | TopupArgs | The arguments for the topup command |
Returns
Promise
<void
>
Defined in
verify
▸ verify(VerifyArgs
): Promise
<void
>
Verify the results of a poll and optionally the subsidy results on-chain
Parameters
Name | Type | Description |
---|---|---|
VerifyArgs | VerifyArgs | The arguments for the verify command |
Returns
Promise
<void
>