DAO CLI
This document contains a comprehensive reference of Chia DAO CLI commands and options.
Chia DAOs are currently an alpha primitive. This means that DAOs are not yet ready for production use, but you can still test them on either a simulator or a testnet. We recommend against creating DAOs with this primitive on mainnet!
Prior to using the DAO alpha primitive, be sure to read the list of known issues.
Reference
add
Functionality: Create a wallet for an existing DAO
Usage: chia dao add [OPTIONS]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-wp | --wallet-rpc-port | INTEGER | False | Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml |
-f | --fingerprint | INTEGER | False | Set the fingerprint to specify which key to use |
-n | --name | TEXT | False | Set the DAO wallet name |
-t | --treasury-id | TEXT | True | The Treasury ID of the DAO you want to track |
-a | --filter-amount | INTEGER | False | The minimum number of votes a proposal needs before the wallet will recognise it [default: 1] |
-h | --help | None | False | Show a help message and exit |
Example
Start with a wallet with some XCH or TXCH:
chia wallet show
Response:
Chia Wallet:
-Total Balance: 1.0 txch (1000000000000 mojo)
-Pending Total Balance: 1.0 txch (1000000000000 mojo)
-Spendable: 1.0 txch (1000000000000 mojo)
-Type: STANDARD_WALLET
-Wallet ID: 1
Next, join a DAO by passing in its Treasury ID:
chia dao add -n "Test DAO Wallet" -t dfe486693cddf312eae141688e72a0b5f597df152f7f30dcb7c775d0ffaa1a56
At first, the response will indicate that the transaction is in process (you will need to choose your wallet fingerprint if more than one exists):
Adding wallet for DAO: dfe486693cddf312eae141688e72a0b5f597df152f7f30dcb7c775d0ffaa1a56
This may take awhile.
Eventually, you will receive a message indicating the Treasury ID and the three relevant wallets that have been created:
Successfully created DAO Wallet
DAO Treasury ID: 0xdfe486693cddf312eae141688e72a0b5f597df152f7f30dcb7c775d0ffaa1a56
DAO Wallet ID: 2
CAT Wallet ID: 3
DAOCAT Wallet ID: 4
At this point, you can show each of these wallets by running chia wallet show
:
chia wallet show
Wallet height: 3181174
Sync status: Synced
Balances, fingerprint: 3046374920
Chia Wallet:
-Total Balance: 1.0 txch (1000000000000 mojo)
-Pending Total Balance: 1.0 txch (1000000000000 mojo)
-Spendable: 1.0 txch (1000000000000 mojo)
-Type: STANDARD_WALLET
-Wallet ID: 1
Test DAO Wallet:
-Total Balance: 1.0
-Pending Total Balance: 1.0
-Spendable: 1.0
-Type: DAO
-Treasury ID: dfe486693cddf312eae141688e72a0b5f597df152f7f30dcb7c775d0ffaa1a56
-Wallet ID: 2
CAT 07e809aa0324acaf...:
-Total Balance: 0.0 (0 mojo)
-Pending Total Balance: 0.0 (0 mojo)
-Spendable: 0.0 (0 mojo)
-Type: CAT
-Asset ID: 07e809aa0324acaf274ce1bb1502d18b31236ac46739e90ebf0a042dbbd2c882
-Wallet ID: 3
CAT 07e809aa0324acaf...:
-Total Balance: 0.0
-Pending Total Balance: 0.0
-Spendable: 0.0
-Type: DAO_CAT
-Asset ID: 07e809aa0324acaf274ce1bb1502d18b31236ac46739e90ebf0a042dbbd2c882
-Wallet ID: 4
From here, you can add funds, create proposals, vote on proposals, etc.
add_funds
Functionality: Send funds to a DAO treasury
Usage: chia dao add_funds [OPTIONS]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-wp | --wallet-rpc-port | INTEGER | False | Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml |
-f | --fingerprint | INTEGER | False | Set the fingerprint to specify which key to use |
-i | --wallet-id | INTEGER | True | ID of the DAO Treasury Wallet |
-w | --funding-wallet-id | INTEGER | True | The ID of the wallet to send funds from (must be of type STANDARD_WALLET ) |
-a | --amount | TEXT | True | The amount of funds to send, in XCH or CATs |
-m | --fee | TEXT | False | Set the fees per transaction, in XCH [default: 0] |
--reuse, --reuse-puzhash | None | False | Set either of these flags to reuse the existing address for the change [default: not set] | |
--new-address, --generate-new-puzhash | None | False | Set either of these flags to generate a new puzzle hash / address for the change [default: not set] | |
-ma | --min-coin-amount, --min-amount | TEXT | False | Ignore coins worth less then this much XCH or CAT units |
-l | --max-coin-amount, --max-amount | TEXT | False | Ignore coins worth more then this much XCH or CAT units |
--exclude-coin | TEXT | False | Exclude the coin with this ID from being spent | |
--exclude-amount | TEXT | False | Exclude any coins with this XCH or CAT amount from being included | |
-h | --help | None | False | Show a help message and exit |
Example
Start by showing the current wallet status:
chia wallet show
Response:
Chia Wallet:
-Total Balance: 2.999987147234 txch (2999987147234 mojo)
-Pending Total Balance: 2.999987147234 txch (2999987147234 mojo)
-Spendable: 2.999987147234 txch (2999987147234 mojo)
-Type: STANDARD_WALLET
-Wallet ID: 1
Profile 1:
-Total Balance: 1.0
-Pending Total Balance: 1.0
-Spendable: 1.0
-Type: DAO
-Treasury ID: dfe486693cddf312eae141688e72a0b5f597df152f7f30dcb7c775d0ffaa1a56
-Wallet ID: 3
CAT 07e809aa0324acaf...:
-Total Balance: 100.0 (100000 mojo)
-Pending Total Balance: 100.0 (100000 mojo)
-Spendable: 100.0 (100000 mojo)
-Type: CAT
-Asset ID: 07e809aa0324acaf274ce1bb1502d18b31236ac46739e90ebf0a042dbbd2c882
-Wallet ID: 4
CAT 07e809aa0324acaf...:
-Total Balance: 0.0
-Pending Total Balance: 0.0
-Spendable: 0.0
-Type: DAO_CAT
-Asset ID: 07e809aa0324acaf274ce1bb1502d18b31236ac46739e90ebf0a042dbbd2c882
-Wallet ID: 5
Add funds from the main Chia Wallet (ID 1
) to the DAO Wallet (ID 3
).
Note that the Wallet IDs
shown here are only examples; yours may differ.
chia dao add_funds -i 2 --funding-wallet-id 1 -a 2 -m 0.00001
Response:
Transaction submitted to nodes: [{'peer_id': 'b3d9de85d29931c10050b56c7afb91c99141943fc81ff2d1a8425e52be0d08ab', 'inclusion_status': 'SUCCESS', 'error_msg': None}]
Run 'chia wallet get_transaction -f 3261611401 -tx 0x180ea0da4b8fbe4e696480ff5fa819fbcc8ae069362127c73cf09acecbd378c2' to get status
After a few minutes, verify that the transaction was processed successfully:
chia wallet get_transaction -f 3261611401 -tx 0x180ea0da4b8fbe4e696480ff5fa819fbcc8ae069362127c73cf09acecbd378c2
Response:
Transaction 180ea0da4b8fbe4e696480ff5fa819fbcc8ae069362127c73cf09acecbd378c2
Status: Confirmed
Amount sent: 2 TXCH
To address: txch179tr6euaunzt425l6kyrzgrzyzv572w7820ptan47k3w77x6267s09j0km
Created at: 2023-09-13 21:41:08
At this point, 2 TXCH has been removed from wallet 1
and added to wallet 3
, which can be verified by running balance
:
chia dao balance -i 2
Response:
XCH: 2.0
balance
Functionality: Get the asset balances for a DAO treasury
Usage: chia dao balance [OPTIONS]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-wp | --wallet-rpc-port | INTEGER | False | Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml |
-f | --fingerprint | INTEGER | False | Set the fingerprint to specify which key to use |
-i | --wallet-id | INTEGER | True | ID of the wallet to use |
-h | --help | None | False | Show a help message and exit |
Example
chia dao balance -i 2
Response:
XCH: 2.0