Cli Module
Table of contents
Interfaces
- DeployArgs
- DeployPollArgs
- DeployedContracts
- GenLocalStateArgs
- GenProofsArgs
- IGenKeypairArgs
- IGetPollArgs
- IGetPollData
- IPublishBatchArgs
- IPublishBatchData
- IPublishMessage
- IRegisteredUserArgs
- ISignupData
- MergeMessagesArgs
- MergeSignupsArgs
- PollContracts
- ProveOnChainArgs
- PublishArgs
- SignupArgs
- TallyData
- VerifyArgs
Functions
- checkVerifyingKeys
- deploy
- deployPoll
- deployVkRegistryContract
- fundWallet
- genKeyPair
- genLocalState
- genMaciPubKey
- genProofs
- getPoll
- isRegisteredUser
- mergeMessages
- mergeSignups
- proveOnChain
- publish
- publishBatch
- setVerifyingKeys
- signup
- timeTravel
- verify
Functions
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/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing
Defined in
commands/checkVerifyingKeys.ts:27
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
commands/deploy.ts:25
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
commands/deployPoll.ts:21
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
commands/fundWallet.ts:9
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
commands/genKeyPair.ts:15
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
commands/genLocalState.ts:29
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
commands/genPubKey.ts:13
genProofs
▸ genProofs(GenProofsArgs
): Promise
<TallyData
>
Generate proofs for the message processing and tally 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/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing
Defined in
commands/genProofs.ts:40
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
commands/poll.ts:14
isRegisteredUser
▸ isRegisteredUser(IRegisteredArgs
): Promise
<{ isRegistered
: boolean
; stateIndex?
: string
; voiceCredits?
: 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
; voiceCredits?
: string
}>
user registered or not and state index, voice credit balance
Defined in
commands/signup.ts:94
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
commands/mergeMessages.ts:25
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
commands/mergeSignups.ts:20
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
commands/proveOnChain.ts:41
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
commands/publish.ts:24
publishBatch
▸ publishBatch(args
): Promise
<IPublishBatchData
>
Batch publish new messages to a MACI Poll contract
Parameters
Name | Type | Description |
---|---|---|
args | IPublishBatchArgs | The arguments for the publish command |
Returns
Promise
<IPublishBatchData
>
The ephemeral private key used to encrypt the message, transaction hash
Defined in
commands/publish.ts:145
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/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
commands/signup.ts:17
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
commands/timeTravel.ts:10
verify
▸ verify(VerifyArgs
): Promise
<void
>
Verify the results of a poll on-chain
Parameters
Name | Type | Description |
---|---|---|
VerifyArgs | VerifyArgs | The arguments for the verify command |
Returns
Promise
<void
>
Defined in
commands/verify.ts:19