Interaction with the network: CLI
For more information on the command usage, refer to its help screen: panacead --help.
Here is a list of useful panacead commands, including usage examples.

Keys

Key Types

There are three types of key representations that are used:
  • panacea
    • Derived from account keys generated by panacead keys add
    • Used to receive funds
    • e.g. panacea17kmacx3czkdnhtfueqzzxk9xqzapj453f23m5a
  • panaceavaloper
    • Used to associate a validator to it's operator
    • Used to invoke staking commands
    • e.g. panaceavaloper17kmacx3czkdnhtfueqzzxk9xqzapj453wg3mgr
  • panaceapub
    • Derived from account keys generated by panacead keys add
    • e.g. panaceapub1addwnpepqwk3j2j3knuyah89skh8wtn5kr4qx32nhql6hzjadzmre2xlfmvxgy39ln8
  • panaceavalconspub
    • Generated when the node is created with panacead init.
    • Get this value with panacead tendermint show-validator
    • e.g. panaceavalconspub1zcjduepqktkqqsl9rchj77v9vg0crc87grp9h2u5ggpdtvcq74kxlr29lgwsa3dr66

Generate Keys

You'll need an account private and public key pair (a.k.a. sk, pk respectively) to be able to receive funds, send txs, bond tx, etc.
To generate a new secp256k1 key:
1
panacead keys add <account_name>
Copied!
Previously, you had to enter a password to save it to disk, but you do not currently need to.
If you check your private keys, you'll now see <account_name>:
1
panacead keys show <account_name>
Copied!
View the validator operator's address via:
1
panacead keys show <account_name> --bech=val
Copied!
You can see all your available keys by typing:
1
panacead keys list
Copied!
View the validator pubkey for your node by typing:
1
panacead tendermint show-validator
Copied!
Note that this is the Tendermint signing key, not the operator key you will use in delegation transactions.
::: danger Warning We strongly recommend NOT using the same passphrase for multiple keys. The MediBloc team will not be responsible for the loss of funds. :::

Fees & Gas

Each transaction may either supply fees or gas prices, but not both. Most users will typically provide fees as this is the cost you will end up incurring for the transaction being included in the ledger.
Validator's have a minimum gas price configuration and they use this value when determining if they should include the transaction in a block during CheckTx, where gasPrices >= minGasPrices. Note, your transaction must supply fees that are greater than or equal to minimum fee which the validator requires.
Note: With such a mechanism in place, validators may start to prioritize txs by gasPrice in the mempool, so providing higher fees or gas prices may yield higher tx priority.
e.g.
1
panacead tx send ... --fees=1000000umed
Copied!
or
1
panacead tx send ... --gas-prices=500.0umed
Copied!

Account

Query Account

To view your account information:
1
panacead query account <account_panacea>
Copied!

Bank

Query balance

After receiving tokens to your address, you can view your account's balance by typing:
1
panacead query bank balances <account_panacea>
Copied!
::: warning Note When you query an account balance with zero tokens, you will get this error: account <account_panacea> does not exist. This can also happen if you fund the account before your node has fully synced with the chain. These are both normal.:::

Send Tokens

The following command could be used to send coins from one account to another:
1
panacead tx bank send \
2
<from_key_or_address> \
3
<to_address> \
4
<amount> \
5
--chain-id <chain_id> \
6
`
Copied!
where to_address is a key matching the format: panacea1y3mhszahwatjc3023datq46a0u2fv337tes4n9
::: warning Note The <amount> accepts the format <value|coin_name> -> ex) 10000000umed. :::
::: tip Note You may want to cap the maximum gas that can be consumed by the transaction via the --gas flag. If you pass --gas=auto, the gas supply will be automatically estimated before executing the transaction. Gas estimate might be inaccurate as state changes could occur in between the end of the simulation and the actual execution of a transaction, thus an adjustment is applied on top of the original estimate in order to ensure the transaction is broadcasted successfully. The adjustment can be controlled via the --gas-adjustment flag, whose default value is 1.0. :::
Now, view the updated balances of the origin and destination accounts:
1
panacead query bank balances <from_address>
2
panacead query bank balances <to_address>
Copied!
You can also check your balance at a given block by using the --height flag:
1
panacead query account <account_panacea> --height=<block_height>
Copied!
You can simulate a transaction without actually broadcasting it by appending the --dry-run flag to the command line:
1
panacead tx bank send \
2
<from_key_or_address> \
3
<to_address> \
4
<amount> \
5
--chain-id <chain_id> \
6
--dry-run
Copied!
Furthermore, you can build a transaction and print its JSON format to STDOUT by appending --generate-only to the list of the command line arguments:
1
panacead tx bank send \
2
<from_key_or_address> \
3
<to_address> \
4
<amount> \
5
--chain-id <chain_id> \
6
--generate-only > unsignedSendTx.json
Copied!
1
panacead tx sign \
2
--chain-id <chain_id> \
3
--from <key_name> \
4
unsignedSendTx.json > signedSendTx.json
Copied!
You can validate the transaction's signatures by typing the following:
1
panacead tx validate-signatures \
2
--chain-id <chain_id> \
3
signedSendTx.json
Copied!
You can broadcast the signed transaction to a node by providing the JSON file to the following command:
1
panacead tx broadcast --chain-id <chain_id> signedSendTx.json
Copied!

Query Transactions

Matching a set of events

You can use the transaction search command to query for transactions that match a specific set of events, which are added on every transaction.
Events are implemented in the Cosmos SDK as an alias of the ABCI Event type and take the form of: {eventType}.{attributeKey}={attributeValue}. Events can also be combined to query for a more specific result using the & symbol.
The command for querying transactions using a event is the following:
1
panacead query txs --events 'message.module=bank'
Copied!
And for using multiple events:
1
panacead query txs --events 'message.module=bank&tx.height=5'
Copied!
The pagination is supported as well via page and limit:
1
panacead query txs --events 'message.module=bank' --page 1 --limit 20
Copied!
::: tip Note
The action tag always equals the message type returned by the Type() function of the relevant message.
You can find a list of available tags on each module by looking at the /tags directory of each module. :::

Matching a transaction's hash

You can also query a single transaction by its hash using the following command:
1
panacead query tx [hash]
Copied!

Slashing

Unjailing

To unjail your jailed validator
1
panacead tx slashing unjail \
2
--from <validator-operator-addr> \
3
--chain-id <chain_id>
Copied!

Signing Info

To retrieve a validator's signing info:
1
panacead query slashing signing-info <validator-pubkey>
Copied!

Query Parameters

You can get the current slashing parameters via:
1
panacead query slashing params
Copied!

Staking

Create your validator

This guide assumes that you have already set up your full node by following the guide.
Your panaceavalconspub address (public key) can be used to create a new validator by staking tokens. You can find your validator public key by:
1
panacead tendermint show-validator
Copied!
Execute the following command to create your validator:
Don't use more umed than you have!
1
panacead tx staking create-validator \
2
--pubkey $(panacead tendermint show-validator) \
3
--moniker "choose a moniker" \
4
--chain-id <chain-id> \
5
--commission-rate "0.10" \
6
--commission-max-rate "0.20" \
7
--commission-max-change-rate "0.01" \
8
--min-self-delegation "1" \
9
--amount 10000000umed \
10
--fees "1000000umed" \
11
--from <key-name>
Copied!
  • pubkey: A public key associated with the Tendermint private key (which was generated by panacead init).
    The public key can be resolved by panacead tendermint show-validator in the node that you want to make as a validator.
    For details about various key types, please see this guide.
  • moniker: A validator nickname that will be displayed publicly
  • commission-rate: An initial commission rate on block rewards and fees charged to delegators
  • commission-max-rate: A maximum commission rate which this validator can charge. This cannot be changed after the
    create-validator transaction is processed.
  • commission-max-change-rate: A maximum daily increase of the validator commission. This cannot be changed after the
    create-validator transaction is processed. This is used to measure % point change over the commision-rate.
    E.g. 1% to 2% is a 100% rate increase, but only 1% point.
  • min-self-delegation: A strictly positive integer in umed that represents the minimum amount of self-delegated voting power
    your validator must always have. If the validator's self-delegated stake falls below this limit, their entire staking pool will unbond.
  • amount: An amount of your self-delegation
Note: A minimum amount of MEDs that must be delegated to be an active validator is 1med (1000000umed). In other words, validators cannot be in the active set, if their total stake (= self-bonded stake + delegators stake) is under 1med.
You can confirm that you are in the validator set by the following command:
1
panacead query staking validators
Copied!

Edit validator description

You can edit your validator's public description. This info is to identify your validator, and will be relied on by delegators to decide which validators to stake to. Make sure to provide input for every flag below. If a flag is not included in the command the field will default to empty (--moniker defaults to the machine name) if the field has never been set or remain the same if it has been set in the past.
The --from option specifies which validator you are editing.
1
panacead tx staking edit-validator \
2
--moniker "choose a new moniker" \
3
--website "https://example.com" \
4
--details "This is a detail description" \
5
--chain-id <chain_id> \
6
--commission-rate "0.15" \
7
--from <key_name> \
8
--fees "1000000umed"
Copied!
Note: The --commission-rate value must adhere to the following invariants:
  • Must be between 0 and the validator's commission-max-rate
  • Must not exceed the validator's commission-max-change-rate which is maximum % point change rate per day.
    In other words, a validator can only change its commission once per day and within commission-max-change-rate bounds.

Delegate to a Validator

You can delegate umed to a validator. These delegators can receive part of the validator's fee revenue.
Query Validators
You can query the list of all validators of a specific chain:
1
panacead query staking validators
Copied!
If you want to get the information of a single validator you can check it with:
1
panacead query staking validator <account_panaceaval>
Copied!

Bond Tokens

Here's how you can bond tokens to a validator (i.e. delegate):
1
panacead tx staking delegate \
2
<validator address> \
3
10000000umed \
4
--from <key_name> \
5
--chain-id <chain_id>
Copied!
<validator> is the operator address of the validator to which you intend to delegate. If you are running a local testnet, you can find this with:
1
panacead keys show [name] --bech val
Copied!
where [name] is the name of the key you specified when you initialized panacead.
While tokens are bonded, they are pooled with all the other bonded tokens in the network. Validators and delegators obtain a percentage of shares that equal their stake in this pool.
Query Delegations
Once submitted a delegation to a validator, you can see it's information by using the following command:
1
panacead query staking delegation <delegator_addr> <validator_addr>
Copied!
Or if you want to check all your current delegations with distinct validators:
1
panacead query staking delegations <delegator_addr>
Copied!
You can also get previous delegation(s) status by adding the --height flag.

Unbond Tokens

If for any reason the validator misbehaves, or you just want to unbond a certain amount of tokens, use this following command.
1
panacead tx staking unbond \
2
<account_panaceaval> \
3
10000umed \
4
--from <key_name> \
5
--chain-id <chain_id>
Copied!
The unbonding will be automatically completed when the unbonding period has passed.
Query Unbonding-Delegations
Once you begin an unbonding-delegation, you can see it's information by using the following command:
1
panacead query staking unbonding-delegation <delegator_addr> <validator_addr>
Copied!
Or if you want to check all your current unbonding-delegations with disctinct validators:
1
panacead query staking unbonding-delegations <account_panacea>
Copied!
Additionally, as you can get all the unbonding-delegations from a particular validator:
1
panacead query staking unbonding-delegations-from <account_panaceaval>
Copied!
To get previous unbonding-delegation(s) status on past blocks, try adding the --height flag.

Redelegate Tokens

A redelegation is a type delegation that allows you to bond illiquid tokens from one validator to another:
1
panacead tx staking redelegate \
2
<src validator address> \
3
<dst validator address> \
4
10000umed \
5
--from <key_name> \
6
--chain-id <chain_id>
Copied!
The redelegation will be automatically completed when the unbonding period has passed.
Query Redelegations
Once you begin an redelegation, you can see it's information by using the following command:
1
panacead query staking redelegation <delegator_addr> <src_val_addr> <dst_val_addr>
Copied!
Or if you want to check all your current unbonding-delegations with disctinct validators:
1
panacead query staking redelegations <account_panacea>
Copied!
Additionally, as you can get all the outgoing redelegations from a particular validator:
1
panacead query staking redelegations-from <account_panaceaval>
Copied!
To get previous redelegation(s) status on past blocks, try adding the --height flag.

Query Parameters

Parameters define high level settings for staking. You can get the current values by using:
1
panacead query staking params
Copied!
With the above command you will get the values for:
  • Unbonding time
  • Maximum numbers of validators
  • Maximum entries
  • Coin denomination for staking

Query Pool

A staking Pool defines the dynamic parameters of the current state. You can query them with the following command:
1
panacead query staking pool
Copied!
With the pool command you will get the values for:
  • Not-bonded and bonded tokens

Fee Distribution

Query distribution parameters

To check the current distribution parameters, run:
1
panacead query distribution params
Copied!

Query validator commission

To check the current outstanding commission for a validator, run:
1
panacead query distribution commission <validator_address>
Copied!

Query validator slashes

To check historical slashes for a validator, run:
1
panacead query distribution slashes <validator_address> <start_height> <end_height>
Copied!

Query delegator rewards

To check current rewards for a delegation (were they to be withdrawn), run:
1
panacead query distribution rewards <delegator_address> <validator_address>
Copied!

Query all delegator rewards

To check all current rewards for a delegation (were they to be withdrawn), run:
1
panacead query distribution rewards <delegator_address>
Copied!

Multisig transactions

Multisig transactions require signatures of multiple private keys. Thus, generating and signing a transaction from a multisig account involve cooperation among the parties involved. A multisig transaction can be initiated by any of the key holders, and at least one of them would need to import other parties' public keys into their Keybase and generate a multisig public key in order to finalize and broadcast the transaction.
For example, given a multisig key comprising the keys p1, p2, and p3, each of which is held by a distinct party, the user holding p1 would require to import both p2 and p3 in order to generate the multisig account public key:
1
panacead keys add \
2
p2 \
3
--pubkey=panaceapub1addwnpepqwk3j2j3knuyah89skh8wtn5kr4qx32nhql6hzjadzmre2xlfmvxgy39ln8
4
5
panacead keys add \
6
p3 \
7
--pubkey=panaceapub1addwnpepqvr594kcrv7y43l5laqtyxzg7s7f5ma9fvm6gjwsf3pp86j3wln676hwndf
8
9
panacead keys add \
10
p1p2p3 \
11
--multisig-threshold 2 \
12
--multisig p1,p2,p3
Copied!
A new multisig public key p1p2p3 has been stored, and its address will be used as signer of multisig transactions:
1
panacead keys show --address p1p2p3
Copied!
You may also view multisig threshold, pubkey constituents and respective weights by viewing the JSON output of the key or passing the --show-multisig flag:
1
panacead keys show p1p2p3 --output json
Copied!
The first step to create a multisig transaction is to initiate it on behalf of the multisig address created above:
1
panacead tx bank send panacea1ynkxl2d9yj9hh5jxt3m9s8nljh507tm5u66swq 10umed \
2
--from <multisig_address> \
3
--chain-id <chain_id> \
4
--generate-only > unsignedTx.json
Copied!
The file unsignedTx.json contains the unsigned transaction encoded in JSON. p1 can now sign the transaction with its own private key:
1
panacead tx sign \
2
unsignedTx.json \
3
--multisig <multisig_address> \
4
--from p1 \
5
--output-document p1signature.json \
6
--chain-id <chain_id>
Copied!
Once the signature is generated, p1 transmits both unsignedTx.json and p1signature.json to p2 or p3, which in turn will generate their respective signature:
1
panacead tx sign \
2
unsignedTx.json \
3
--multisig <multisig_address> \
4
--from p2 \
5
--output-document p2signature.json \
6
--chain-id <chain_id>
Copied!
p1p2p3 is a 2-of-3 multisig key, therefore one additional signature is sufficient. Any the key holders can now generate the multisig transaction by combining the required signature files:
1
panacead tx multisign \
2
unsignedTx.json \
3
p1p2p3 \
4
p1signature.json p2signature.json \
5
--output-document signedTx.json \
6
--chain-id <chain_id>
Copied!
The transaction can now be sent to the node:
1
panacead tx broadcast signedTx.json \
2
--chain-id <chain_id>
Copied!

Shells completion scripts

Completion scripts for popular UNIX shell interpreters such as Bash and Zsh can be generated through the completion command, which is available for both panacead.
If you want to generate Bash completion scripts run the following command:
1
panacead completion > panacead_completion
Copied!
If you want to generate Zsh completion scripts run the following command:
1
panacead completion --zsh > panacead_completion
Copied!
::: tip Note On most UNIX systems, such scripts may be loaded in .bashrc or .bash_profile to enable Bash autocompletion:
1
echo '. panacead_completion' >> ~/.bashrc
Copied!
Refer to the user's manual of your interpreter provided by your operating system for information on how to enable shell autocompletion. :::

AOL

Create Topic

You can create topic with this:
1
panacead tx aol create-topic \
2
--from <key_name> \
3
<topic>
Copied!

List Topics

You can query the list of topics belong to specific account:
panacead query aol list-topics <owner_panacea>
You can get the detail information of the topic with this:
1
panacead query aol get-topic <owner_panacea> <topic>
Copied!
Add Writer
You can add writer to the specific topic. the list of all validators of a specific chain:
1
panacead tx aol add-writer \
2
--from <key_name> \
3
<topic> \
4
<writer_panacea>
Copied!
::: tip Note that the topic owner is not a writer as default. You need to add your self to the topic as a writer. :::

List Writers

You can query the list of writers to the topic:
1
panacead query aol list-writers <owner_panacea> <topic>
Copied!
You can get the detail information of the writer with this:
1
panacead query aol get-writer <owner_panacea> <topic> <writer_panacea>
Copied!
where [name] is the name of the key you specified when you initialized panacead.
While tokens are bonded, they are pooled with all the other bonded tokens in the network. Validators and delegators obtain a percentage of shares that equal their stake in this pool.

Delete Writer

Owner can delete writer from the topic. After owner delete the writer, writer can not add record to the topic anymore.
1
panacead tx aol delete-writer \
2
--from <key_name> \
3
<topic> \
4
<writer_panacea>
Copied!
::: Note that only owner can delete writer from the topic :::

Add Record

Writer can add record to the topic with this:
1
panacead tx aol add-record \
2
--from <key_name> \
3
<owner_panacea> <topic> <key> <value>
Copied!

Get Record

You can query the record with this:
1
panacead query aol get-record <owner_panacea> <topic> <offset>
Copied!

DID

Create(Issue) a DID

1
panacead tx did create-did \
2
--chain-id <chain-id> \
3
--from <address>
Copied!
This doesn't require any parameter except chain-id and from. That is, it generates a Secp256k1 key-pair and derive a DID and a DID Document. The DID Document is stored in Panacea.
To store the key-pair safely in your local, the command will prompt you to enter a passphrase. The encrypted key-pair file will be stored in your ~/did_keystore directory.

Resolve a DID

1
panacead query did get-did <did>
Copied!
This returns a DID Document in JSON corresponding to that DID. If the DID doesn't exist, or was already deactivated, an error will be returned.

Update a DID

1
panacead tx did update-did <did> <key-id> <did-doc-path> \
2
--chain-id <chain-id> \
3
--from <address>
Copied!
A DID Document will be replaced to the new one written in a JSON file: <did-doc-path>. To prove that you are the DID owner, you must pass a <key-id> that is one of verificationMethods in the DID Document. Also, that command will prompt you to enter a passphrase of that key if the key-pair is stored in your keystore: ~/did_keystore. The key-pair will be used to make a signature so that Panacea can verify that you are the DID owner.

Deactivate a DID

1
panacead tx did deactivate-did <did> <key-id> \
2
--chain-id <chain-id> \
3
--from <address>
Copied!
Like updating a DID, a <key-id> must be specified and the corresponding key-pair should be used to make a signature so that Panacea can verify that you are the DID owner.
Deactivating a DID is not the same as deleting a DID. DIDs cannot be deleted permanently. They can just be deactivated. And DIDs cannot be reused to create another DID Documents forever.

Token

Issue a new token

A new token can be issued by the following command. Anyone can issue a new token with fee paid. After issuing, the token would appear in the issuer's account.
The symbol doesn't have to be unique. - followed by random 3 letters will be appended to the provided symbol to avoid uniqueness constraint. Those 3 letters are the first three letters of the Tx hash of the issue transaction. The generated symbol will be returned as a Tx response.
For more details of each parameter, please see the Token specification.
1
# Note that the total supply must be in micro unit without a denomination.
2
panacead tx token issue \
3
"my token" \
4
KAI \
5
1000000000 \
6
--mintable \
7
--from panacea126r28pr7sstg7yfmedv3qq4st4a4exlwccx2vc \
8
--chain-id testing
Copied!

Query a token

1
# List all token symbols
2
$ panacead query token list-tokens --chain-id testing
3
4
- KAI-0C5
5
- KAI-0EA
6
7
# Query a token
8
$ panacead query token get-token KAI-0EA
9
10
name: my secret token
11
symbol: KAI-0EA
12
totalsupply:
13
denom: ukai0ea
14
amount: "1000000000"
15
mintable: true
16
owneraddress: panacea126r28pr7sstg7yfmedv3qq4st4a4exlwccx2vc
Copied!

Query account balances and send tokens

Of course, the new token is visible in the account balance.
1
$ panacead query account panacea126r28pr7sstg7yfmedv3qq4st4a4exlwccx2vc
2
3
address: panacea126r28pr7sstg7yfmedv3qq4st4a4exlwccx2vc
4
coins:
5
- denom: ukai0c5
6
amount: "1000000000"
7
- denom: ukai0ea
8
amount: "999999900"
9
- denom: ukai62e
10
amount: "1000000000"
11
- denom: umed
12
amount: "99000000000000"
13
pubkey: panaceapub1addwnpepqf2m7rxgazcem4e6x4hjnwexeagrqjfdlkvz65e0jpxv5sn76jurgpqmpd5
14
accountnumber: 0
15
sequence: 6
Copied!
Also, the new token can be sent to other accounts. Note that the amount must be specified with the micro-denomination that contains the 3-letter suffix (without -).
1
panacead tx send <from-address> <to-address> 1000000ukai0ea
Copied!
Last modified 2mo ago