From 6609bbd80dd561e100c365975dcdc1103ad050b3 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 26 Sep 2024 17:19:06 +0200 Subject: [PATCH] WIP - add provider CLI, gRPC, REST docs --- docs/docs/build/modules/02-provider.md | 1253 +++++++++++++++++++++++- 1 file changed, 1248 insertions(+), 5 deletions(-) diff --git a/docs/docs/build/modules/02-provider.md b/docs/docs/build/modules/02-provider.md index 4b0d98365f..699a7e096b 100644 --- a/docs/docs/build/modules/02-provider.md +++ b/docs/docs/build/modules/02-provider.md @@ -950,6 +950,7 @@ simd query provider --help ``` ##### Consumer Genesis + The `consumer-genesis` command allows to query for consumer chain genesis state by consumer id ```bash @@ -1056,9 +1057,9 @@ provider: ``` ##### List Consumer Chains -The `list-consumer-chains` command allows to query consumer chains for provider chain. -An optional integer parameter can be passed for phase filtering of consumer chains, - (Registered=1|Initialized=2|Launched=3|Stopped=4|Deleted=5).` + +The `list-consumer-chains` command allows to query consumer chains supported by the provider chain. +An optional integer parameter can be passed for phase filtering of consumer chains, (Registered=1|Initialized=2|Launched=3|Stopped=4|Deleted=5).` ```bash interchain-security-pd query provider list-consumer-chains [phase] [limit] [flags] @@ -1096,6 +1097,7 @@ pagination: ``` ##### Validator Consumer Key Assignment + The `validator-consumer-key` command allows to query assigned validator consensus public key for a consumer chain ```bash @@ -1109,6 +1111,7 @@ interchain-security-pd query provider validator-consumer-key 3 cosmosvalcons1ezy ``` ##### Validator Provider Key + The `validator-provider-key` command allows to query validator consensus public key for the provider chain @@ -1130,6 +1133,7 @@ consumer_address: cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk ``` ##### Throttle State + The `throttle-state` command allows to query on-chain state relevant to slash packet throttling @@ -1152,6 +1156,7 @@ slash_meter_allowance: "1511" ``` ##### Registered Consumer Reward Denoms + The `registered-consumer-reward-denoms` command allows to query registered consumer reward denoms ```bash @@ -1173,6 +1178,7 @@ denoms: ``` ##### All Pairs Valconsensus Address + The `all-pairs-valconsensus-address` command allows to query all pairs of valconsensus address by consumer ID. ```bash @@ -1200,6 +1206,7 @@ pair_val_con_addr: ``` ##### Provider Parameters + The `params` command allows to query provider parameters information ```bash @@ -1284,6 +1291,7 @@ trusting_period_fraction: "0.66" ``` ##### Consumer Opted In Validators + The `consumer-opted-in-validators` command allows to query opted-in validators for a given consumer chain ```bash @@ -1306,6 +1314,7 @@ validators_provider_addresses: ``` ##### Consumer Validators + The `consumer-validators` command allows to query the last set consumer-validator set for a given consumer chain ```bash @@ -1365,6 +1374,7 @@ validators: ``` ##### Has to Validate + The `has-to-validate` command allows to query the consumer chains list a given validator has to validate ```bash @@ -1386,6 +1396,7 @@ consumer_ids: ``` ##### Validator Consumer Commission Rate + The `validator-consumer-commission-rate` command allows to query the consumer commission rate a validator charges on a consumer chain ```bash @@ -1405,6 +1416,7 @@ rate: "0.750000000000000000" ``` ##### Blocks Until Next Epoch + The `blocks-until-next-epoch` command allows to query the number of blocks until the next epoch begins and validator updates are sent to consumer chains ```bash @@ -1424,6 +1436,7 @@ blocks_until_next_epoch: "286" ``` ##### Consumer Id From Client Id + The `consumer-id-from-client-id` command allows to query the consumer id of the chain associated with the provided client id ```bash @@ -1443,6 +1456,7 @@ consumer_id: "0" ``` ##### Consumer Chain + The `consumer-chain` command allows to query the consumer chain associated with the consumer id ```bash @@ -1859,6 +1873,7 @@ where `infraction_header.json` contains: } ``` + ##### Submit Consumer Double Voting The `submit-consumer-misbehaviour` command allows to submit an IBC misbehaviour for a consumer chain. @@ -2076,10 +2091,1238 @@ where `consumer-misbehaviour.json` contains: ``` - ### gRPC A user can query the `provider` module using gRPC endpoints. +#### Consumer Genesis + +The `QueryConsumerGenesis` endpoint queries a consumer chain genesis state by consumer id. + +```bash +interchain_security.ccv.provider.v1.Query/QueryConsumerGenesis +``` + +Example: + +```bash +grpcurl -plaintext -d '{"consumer_id": "0"}' localhost:9090 \ + interchain_security.ccv.provider.v1.Query/QueryConsumerGenesis +``` + +Example Output: + + +```json +{ + "genesisState": { + "params": { + "enabled": true, + "blocksPerDistributionTransmission": "1500", + "ccvTimeoutPeriod": "2419200s", + "transferTimeoutPeriod": "3600s", + "consumerRedistributionFraction": "0.75", + "historicalEntries": "1000", + "unbondingPeriod": "2419200s", + "softOptOutThreshold": "0", + "retryDelayPeriod": "3600s" + }, + "provider": { + "clientState": { + "chainId": "provider", + "trustLevel": { + "numerator": "1", + "denominator": "3" + }, + "trustingPeriod": "57024s", + "unbondingPeriod": "86400s", + "maxClockDrift": "10s", + "frozenHeight": {}, + "latestHeight": { + "revisionHeight": "10" + }, + "proofSpecs": [ + { + "leafSpec": { + "hash": "SHA256", + "prehashValue": "SHA256", + "length": "VAR_PROTO", + "prefix": "AA==" + }, + "innerSpec": { + "childOrder": [ + 0, + 1 + ], + "childSize": 33, + "minPrefixLength": 4, + "maxPrefixLength": 12, + "hash": "SHA256" + } + }, + { + "leafSpec": { + "hash": "SHA256", + "prehashValue": "SHA256", + "length": "VAR_PROTO", + "prefix": "AA==" + }, + "innerSpec": { + "childOrder": [ + 0, + 1 + ], + "childSize": 32, + "minPrefixLength": 1, + "maxPrefixLength": 1, + "hash": "SHA256" + } + } + ], + "upgradePath": [ + "upgrade", + "upgradedIBCState" + ] + }, + "consensusState": { + "timestamp": "2024-09-26T08:19:42.708111Z", + "root": { + "hash": "xbZV/9QyM3PYzY/HyJAsNogaaJVJtyAGROTcXuqxHas=" + }, + "nextValidatorsHash": "/zLB6RSu9omrO5L0tnDK03hCOUibwl/7eeVC3hTP7so=" + }, + "initialValSet": [ + { + "pubKey": { + "ed25519": "E9bJ6bi7X9MG9s3djQ4MmBxshis9W15y7UzXCxp2Yuk=" + }, + "power": "100" + }, + { + "pubKey": { + "ed25519": "+9BFckSNCI1o/+S85HLjG3pYp1FIzmfYWVKmUH2njxs=" + }, + "power": "100" + }, + { + "pubKey": { + "ed25519": "62d2CCgWXYZHmlsCon2lzVgnu9gfubep2XRPlZKuLAQ=" + }, + "power": "100" + } + ] + }, + "newChain": true + } +} +``` + +#### List Consumer Chains + +The `QueryConsumerChains` endpoint queries consumer chains supported by the provider chain. +An optional integer parameter can be passed for phase filtering of consumer chains, (Registered=1|Initialized=2|Launched=3|Stopped=4|Deleted=5).` + +```bash +interchain_security.ccv.provider.v1.Query/QueryConsumerChains +``` + +Example: + +```bash +grpcurl -plaintext -d '{"phase": "1"}' localhost:9090 interchain_security.ccv.provider.v1.Query/QueryConsumerChains``` +``` + +Example Output: + +```json +{ + "chains": [ + { + "chainId": "pion-1", + "minPowerInTopN": "-1", + "phase": "CONSUMER_PHASE_REGISTERED", + "metadata": { + "name": "pion-1", + "description":"description of your chain and all other relevant information", + "metadata": "some metadata about your chain" + }, + "consumerId": "2" + }, + { + "chainId": "dash-2", + "minPowerInTopN": "-1", + "phase": "CONSUMER_PHASE_REGISTERED", + "metadata": { + "name": "dash-2", + "description":"description of your chain and all other relevant information", + "metadata": "some metadata about your chain" + }, + "consumerId": "4" + }, + ], + "pagination": { + "total": "6" + } +} +``` + +#### Validator Consumer Key Assignment + +The `QueryValidatorConsumerAddr` endpoint queries the address assigned by a validator for a consumer chain. + + +```bash +interchain_security.ccv.provider.v1.Query/QueryValidatorConsumerAddr +``` + +Example: + +```bash +grpcurl -plaintext -d '{"consumer_id": "0", "provider_address": ""}' localhost:9090 interchain_security.ccv.provider.v1.Query/QueryValidatorConsumerAddr +``` + +Example Output: + +```json +{ + "consumerAddress": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" +} +``` + +#### Validator Provider Key + +The `QueryValidatorProviderAddr` endpoint queries the provider chain address given a consumer chain validator address. + +```bash +interchain_security.ccv.provider.v1.Query/QueryValidatorConsumerAddr +``` + +Example: + +```bash +grpcurl -plaintext -d '{"consumer_id": "0", "provider_address": ""}' localhost:9090 interchain_security.ccv.provider.v1.Query/QueryValidatorConsumerAddr +``` + +Example Output: + +```json +{ + "providerAddress": "cosmosvalcons1h7zs5nwruzvhyzkktvhwypfuxlch6nrrw4jjmj" +} +``` + +#### Throttle State + +The `QueryThrottleState` queries the main on-chain state relevant to slash packet throttling. + +```bash +interchain_security.ccv.provider.v1.Query/QueryThrottleState +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 interchain_security.ccv.provider.v1.Query/QueryThrottleState +``` + +Example Output: + +```json +{ + "slashMeter": "15", + "slashMeterAllowance": "15", + "nextReplenishCandidate": "2024-09-26T14:27:38.066958Z" +} +``` + +##### Registered Consumer Reward Denoms + +The `QueryRegisteredConsumerRewardDenoms` command allows to query registered consumer reward denoms + +```bash +interchain_security.ccv.provider.v1.Query/QueryRegisteredConsumerRewardDenoms +``` + +Example: + +```bash +grpcurl -plaintext interchain_security.ccv.provider.v1.Query/QueryRegisteredConsumerRewardDenoms +``` + +Example Output: + +```json +{ + "denoms": [ + "ibc/0025F8A87464A471E66B234C4F93AEC5B4DA3D42D7986451A059273426290DD5", + "ibc/054892D6BB43AF8B93AAC28AA5FD7019D2C59A15DAFD6F45C1FA2BF9BDA22454", + "uatom" + ] +} +``` + +#### All Pairs Valconsensus Address + +The `QueryAllPairsValConsAddrByConsumer` endpoint queries the list of pair valconsensus address between provider and consumer chain. + +```bash +interchain_security.ccv.provider.v1.Query/QueryAllPairsValConsAddrByConsumer +``` + +Example: + +```bash +grpcurl -plaintext interchain_security.ccv.provider.v1.Query/QueryAllPairsValConsAddrByConsumer +``` + +Example Output: + +```bash +denoms: +- ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9 +- ibc/D549749C93524DA1831A4B3C850DFC1BA9060261BEDFB224B3B0B4744CD77A70 +``` + +#### Provider Parameters + +The `params` endpoint queries all current values of provider parameters. + +```bash +"/interchain_security/ccv/provider/params" +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/params +``` + +Example Output: + +```json +{ + "params": { + "templateClient": { + "trustLevel": { + "numerator": "1", + "denominator": "3" + }, + "trustingPeriod": "0s", + "unbondingPeriod": "0s", + "maxClockDrift": "10s", + "frozenHeight": {}, + "latestHeight": {}, + "proofSpecs": [ + { + "leafSpec": { + "hash": "SHA256", + "prehashValue": "SHA256", + "length": "VAR_PROTO", + "prefix": "AA==" + }, + "innerSpec": { + "childOrder": [ + 0, + 1 + ], + "childSize": 33, + "minPrefixLength": 4, + "maxPrefixLength": 12, + "hash": "SHA256" + } + }, + { + "leafSpec": { + "hash": "SHA256", + "prehashValue": "SHA256", + "length": "VAR_PROTO", + "prefix": "AA==" + }, + "innerSpec": { + "childOrder": [ + 0, + 1 + ], + "childSize": 32, + "minPrefixLength": 1, + "maxPrefixLength": 1, + "hash": "SHA256" + } + } + ], + "upgradePath": [ + "upgrade", + "upgradedIBCState" + ] + }, + "trustingPeriodFraction": "0.66", + "ccvTimeoutPeriod": "2419200s", + "slashMeterReplenishPeriod": "3600s", + "slashMeterReplenishFraction": "0.05", + "consumerRewardDenomRegistrationFee": { + "denom": "stake", + "amount": "10000000" + }, + "blocksPerEpoch": "5", + "numberOfEpochsToStartReceivingRewards": "24", + "maxProviderConsensusValidators": "180" + } +} +``` + +#### Consumer Opted In Validators + +The `opted_in_validators` endpoint queries opted-in validators for a given consumer chain + +```bash +/interchain_security/ccv/provider/opted_in_validators/{consumer_id} +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/opted_in_validators/0 +``` + +Example Output: + +```json +{ + "validatorsProviderAddresses": [ + "cosmosvalcons1znhu88l6dsvexunfem4u0392kwqyvdkrj66wph", + "cosmosvalcons1jnq3j55qe4f946qj8499w0tntxwz90atx26p4q", + "cosmosvalcons1h7zs5nwruzvhyzkktvhwypfuxlch6nrrw4jjmj" + ] +} +``` + +#### Consumer Validators + +The `consumer_validators` endpoint queries the latest set consumer-validator set for a given consumer ID +Note that this does not necessarily mean that the consumer chain is using this validator set at this exact moment because a VSCPacket could be delayed to be delivered on the consumer chain. + +```bash +/interchain_security/ccv/provider/consumer_validators/{consumer_id} +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/consumer_validators/0 +``` + +Example Output: + +```json +{ + "validators": [ + { + "providerAddress": "cosmosvalcons1znhu88l6dsvexunfem4u0392kwqyvdkrj66wph", + "consumerKey": { + "ed25519": "62d2CCgWXYZHmlsCon2lzVgnu9gfubep2XRPlZKuLAQ=" + }, + "rate": "0", + "consumerPower": "101", + "consumerCommissionRate": "100000000000000000", + "providerCommissionRate": "100000000000000000", + "description": { + "moniker": "bob" + }, + "providerOperatorAddress": "cosmosvaloper1a7u5k6f54ua3tptl9yn6u82yrvayet6sxn9ywn", + "status": "BOND_STATUS_BONDED", + "providerTokens": "101000000", + "providerPower": "101", + "validatesCurrentEpoch": true + }, + { + "providerAddress": "cosmosvalcons1jnq3j55qe4f946qj8499w0tntxwz90atx26p4q", + "consumerKey": { + "ed25519": "+9BFckSNCI1o/+S85HLjG3pYp1FIzmfYWVKmUH2njxs=" + }, + "rate": "0", + "consumerPower": "100", + "consumerCommissionRate": "100000000000000000", + "providerCommissionRate": "100000000000000000", + "description": { + "moniker": "coordinator" + }, + "providerOperatorAddress": "cosmosvaloper1jk2pp655zxy2gazhxj50s8jk3750y8np6wz4lm", + "status": "BOND_STATUS_BONDED", + "providerTokens": "100000000", + "providerPower": "100", + "validatesCurrentEpoch": true + }, + { + "providerAddress": "cosmosvalcons1h7zs5nwruzvhyzkktvhwypfuxlch6nrrw4jjmj", + "consumerKey": { + "ed25519": "Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=" + }, + "rate": "0", + "consumerPower": "100", + "consumerCommissionRate": "100000000000000000", + "providerCommissionRate": "100000000000000000", + "description": { + "moniker": "alice" + }, + "providerOperatorAddress": "cosmosvaloper19vfen9jn3uk3e6rrkt3pxansunujnlm40wpdvg", + "status": "BOND_STATUS_BONDED", + "providerTokens": "100000000", + "providerPower": "100", + "validatesCurrentEpoch": true + } + ] +} +``` -### REST \ No newline at end of file +#### Has to Validate + +The `consumer_chains_per_validator` endpoint queries a list of consumer chains that a given validator must validate. + +```bash +/interchain_security/ccv/provider/consumer_chains_per_validator/{provider_address} +``` + +Example: + +```bash +curl curl http://localhost:1317/interchain_security/ccv/provider/consumer_chains_per_validator/cosmosvalcons1znhu88l6dsvexunfem4u0392kwqyvdkrj66wph +``` + +Example Output: + +```json +{ + "consumerIds": [ + "0", + "2" + ] +} +``` + +#### Validator Consumer Commission Rate + +The `consumer_commission_rate` endpoint queries the consumer commission rate a validator charges on a consumer chain. + +```bash +/interchain_security/ccv/provider/consumer_commission_rate/{consumer_id}/{provider_address} +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/consumer_commission_rate/0/cosmosvalcons1znhu88l6dsvexunfem4u0392kwqyvdkrj66wph +``` + +Example Output: + +```json +{ + "rate": "0.750000000000000000" +} +``` + +#### Blocks Until Next Epoch + +The `blocks_until_next_epoch` command allows to query the number of blocks until the next epoch begins and validator updates are sent to consumer chains + +```bash +/interchain_security/ccv/provider/blocks_until_next_epoch +``` + +Example: + +```bash +interchain-security-pd query provider blocks-until-next-epoch +``` + +Example Output: + +```json +{ + "blocks_until_next_epoch":"1" +} +``` + +#### Consumer Id From Client Id + +The `consumer-id-from-client-id` command allows to query the consumer id of the chain associated with the provided client id + +```bash +interchain-security-pd query provider consumer-id-from-client-id [client-id] [flags] +``` + +Example: + +```bash +interchain-security-pd query provider consumer-id-from-client-id 07-tendermint-0 +``` + +Example Output: + +```bash +consumer_id: "0" +``` + +#### Consumer Chain + +The `consumer-chain` command allows to query the consumer chain associated with the consumer id + +```bash +interchain-security-pd query provider consumer-chain [consumer-id] [flags] +``` + +Example: + +```bash +interchain-security-pd query provider consumer-chain 0 +``` + +```bash +chain_id: pion-1 +consumer_id: "0" +init_params: + binary_hash: YmluX2hhc2g= + blocks_per_distribution_transmission: "1000" + ccv_timeout_period: 2419200s + consumer_redistribution_fraction: "0.75" + distribution_transmission_channel: "" + genesis_hash: Z2VuX2hhc2g= + historical_entries: "10000" + initial_height: + revision_height: "1" + revision_number: "0" + spawn_time: "2024-09-26T06:55:14.616054Z" + transfer_timeout_period: 3600s + unbonding_period: 1209600s +metadata: + description: description of your chain and all other relevant information + metadata: some metadata about your chain + name: pion-1 +owner_address: cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn +phase: CONSUMER_PHASE_LAUNCHED +power_shaping_params: + allow_inactive_vals: false + allowlist: [] + denylist: [] + min_stake: "0" + top_N: 100 + validator_set_cap: 0 + validators_power_cap: 0 +``` + +### REST + +A user can query the `provider` module using REST endpoints. + + +#### Consumer Genesis + +The `consumer_genesis` endpoint queries a consumer chain genesis state by consumer id. + +```bash +interchain_security.ccv.provider.v1.Query/QueryConsumerGenesis +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/consumer_genesis/0 +``` + +Example Output: + + +```json +{ + "genesisState": { + "params": { + "enabled": true, + "blocksPerDistributionTransmission": "1500", + "ccvTimeoutPeriod": "2419200s", + "transferTimeoutPeriod": "3600s", + "consumerRedistributionFraction": "0.75", + "historicalEntries": "1000", + "unbondingPeriod": "2419200s", + "softOptOutThreshold": "0", + "retryDelayPeriod": "3600s" + }, + "provider": { + "clientState": { + "chainId": "provider", + "trustLevel": { + "numerator": "1", + "denominator": "3" + }, + "trustingPeriod": "57024s", + "unbondingPeriod": "86400s", + "maxClockDrift": "10s", + "frozenHeight": {}, + "latestHeight": { + "revisionHeight": "10" + }, + "proofSpecs": [ + { + "leafSpec": { + "hash": "SHA256", + "prehashValue": "SHA256", + "length": "VAR_PROTO", + "prefix": "AA==" + }, + "innerSpec": { + "childOrder": [ + 0, + 1 + ], + "childSize": 33, + "minPrefixLength": 4, + "maxPrefixLength": 12, + "hash": "SHA256" + } + }, + { + "leafSpec": { + "hash": "SHA256", + "prehashValue": "SHA256", + "length": "VAR_PROTO", + "prefix": "AA==" + }, + "innerSpec": { + "childOrder": [ + 0, + 1 + ], + "childSize": 32, + "minPrefixLength": 1, + "maxPrefixLength": 1, + "hash": "SHA256" + } + } + ], + "upgradePath": [ + "upgrade", + "upgradedIBCState" + ] + }, + "consensusState": { + "timestamp": "2024-09-26T08:19:42.708111Z", + "root": { + "hash": "xbZV/9QyM3PYzY/HyJAsNogaaJVJtyAGROTcXuqxHas=" + }, + "nextValidatorsHash": "/zLB6RSu9omrO5L0tnDK03hCOUibwl/7eeVC3hTP7so=" + }, + "initialValSet": [ + { + "pubKey": { + "ed25519": "E9bJ6bi7X9MG9s3djQ4MmBxshis9W15y7UzXCxp2Yuk=" + }, + "power": "100" + }, + { + "pubKey": { + "ed25519": "+9BFckSNCI1o/+S85HLjG3pYp1FIzmfYWVKmUH2njxs=" + }, + "power": "100" + }, + { + "pubKey": { + "ed25519": "62d2CCgWXYZHmlsCon2lzVgnu9gfubep2XRPlZKuLAQ=" + }, + "power": "100" + } + ] + }, + "newChain": true + } +} +``` + +#### List Consumer Chains + +The `QueryConsumerChains` endpoint queries consumer chains supported by the provider chain. +An optional integer parameter can be passed for phase filtering of consumer chains, (Registered=1|Initialized=2|Launched=3|Stopped=4|Deleted=5).` + +```bash +interchain_security.ccv.provider.v1.Query/QueryConsumerChains/{phase} +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/consumer_chains/3 +``` + +Example Output: + +```json +{ + "chains": [ + { + "chainId": "pion-1", + "minPowerInTopN": "-1", + "phase": "CONSUMER_PHASE_REGISTERED", + "metadata": { + "name": "pion-1", + "description":"description of your chain and all other relevant information", + "metadata": "some metadata about your chain" + }, + "consumerId": "2" + }, + { + "chainId": "dash-2", + "minPowerInTopN": "-1", + "phase": "CONSUMER_PHASE_REGISTERED", + "metadata": { + "name": "dash-2", + "description":"description of your chain and all other relevant information", + "metadata": "some metadata about your chain" + }, + "consumerId": "4" + }, + ], + "pagination": { + "total": "6" + } +} +``` + +#### Validator Consumer Key Assignment + +The `validator_consumer_addr` endpoint queries the address assigned by a validator for a consumer chain. + + +```bash +/interchain_security/ccv/provider/validator_consumer_addr/{consumer_id}/{provider_address} +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/validator_consumer_addr/0/cosmosvalcons1h7zs5nwruzvhyzkktvhwypfuxlch6nrrw4jjmj +``` + +Example Output: + +```json +{ + "consumerAddress": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" +} +``` + +#### Validator Provider Key + +The `validator_provider_addr` endpoint queries the provider chain address given a consumer chain validator address. + +```bash +/interchain_security/ccv/provider/validator_provider_addr/{consumer_id}/{consumer_address} +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/validator_provider_addr/0/cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk +``` + +Example Output: + +```json +{ + "providerAddress": "cosmosvalcons1h7zs5nwruzvhyzkktvhwypfuxlch6nrrw4jjmj" +} +``` + +#### Throttle State + +The `throttle_state` queries the main on-chain state relevant to slash packet throttling. + +```bash +"/interchain_security/ccv/provider/throttle_state" +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/throttle_state +``` + +Example Output: + +```json +{ + "slashMeter": "15", + "slashMeterAllowance": "15", + "nextReplenishCandidate": "2024-09-26T14:27:38.066958Z" +} +``` + +#### Registered Consumer Reward Denoms + +The `registered_consumer_reward_denoms` command allows to query registered consumer reward denoms + +```bash +interchain_security/ccv/provider/registered_consumer_reward_denoms +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/registered_consumer_reward_denoms +``` + +Example Output: + +```json +{ + "denoms": [ + "ibc/0025F8A87464A471E66B234C4F93AEC5B4DA3D42D7986451A059273426290DD5", + "ibc/054892D6BB43AF8B93AAC28AA5FD7019D2C59A15DAFD6F45C1FA2BF9BDA22454", + "uatom" + ] +} +``` + +#### All Pairs Valconsensus Address + +The `address_pairs` endpoint queries the list of pair valconsensus address between provider and consumer chain. + +```bash +interchain_security/ccv/provider/address_pairs/{consumer_id} +``` + +Example: + +```bash +curl http://localhost:1317/interchain_security/ccv/provider/address_pairs/0 +``` + +Example Output: + +```bash +denoms: +- ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9 +- ibc/D549749C93524DA1831A4B3C850DFC1BA9060261BEDFB224B3B0B4744CD77A70 +``` + +#### Provider Parameters + +The `QueryParams` endpoint queries all current values of provider parameters + +```bash +interchain_security.ccv.provider.v1.Query/QueryParams +``` + +Example: + +```bash +grpcurl -plaintext interchain_security.ccv.provider.v1.Query/QueryParams +``` + +Example Output: + +```json +{ + "params": { + "templateClient": { + "trustLevel": { + "numerator": "1", + "denominator": "3" + }, + "trustingPeriod": "0s", + "unbondingPeriod": "0s", + "maxClockDrift": "10s", + "frozenHeight": {}, + "latestHeight": {}, + "proofSpecs": [ + { + "leafSpec": { + "hash": "SHA256", + "prehashValue": "SHA256", + "length": "VAR_PROTO", + "prefix": "AA==" + }, + "innerSpec": { + "childOrder": [ + 0, + 1 + ], + "childSize": 33, + "minPrefixLength": 4, + "maxPrefixLength": 12, + "hash": "SHA256" + } + }, + { + "leafSpec": { + "hash": "SHA256", + "prehashValue": "SHA256", + "length": "VAR_PROTO", + "prefix": "AA==" + }, + "innerSpec": { + "childOrder": [ + 0, + 1 + ], + "childSize": 32, + "minPrefixLength": 1, + "maxPrefixLength": 1, + "hash": "SHA256" + } + } + ], + "upgradePath": [ + "upgrade", + "upgradedIBCState" + ] + }, + "trustingPeriodFraction": "0.66", + "ccvTimeoutPeriod": "2419200s", + "slashMeterReplenishPeriod": "3600s", + "slashMeterReplenishFraction": "0.05", + "consumerRewardDenomRegistrationFee": { + "denom": "stake", + "amount": "10000000" + }, + "blocksPerEpoch": "5", + "numberOfEpochsToStartReceivingRewards": "24", + "maxProviderConsensusValidators": "180" + } +} +``` + +#### Consumer Opted In Validators + +The `QueryConsumerChainOptedInValidators` endpoint queries opted-in validators for a given consumer chain + +```bash +interchain_security.ccv.provider.v1.Query/QueryConsumerChainOptedInValidators +``` + +Example: + +```bash +grpcurl -plaintext -d '{"consumer_id": "0"}' localhost:9090 interchain_security.ccv.provider.v1.Query/QueryConsumerChainOptedInValidators +``` + +Example Output: + +```json +{ + "validatorsProviderAddresses": [ + "cosmosvalcons1znhu88l6dsvexunfem4u0392kwqyvdkrj66wph", + "cosmosvalcons1jnq3j55qe4f946qj8499w0tntxwz90atx26p4q", + "cosmosvalcons1h7zs5nwruzvhyzkktvhwypfuxlch6nrrw4jjmj" + ] +} +``` + +#### Consumer Validators + +The `QueryConsumerValidators` endpoint queries the latest set consumer-validator set for a given consumer ID +Note that this does not necessarily mean that the consumer chain is using this validator set at this exact moment because a VSCPacket could be delayed to be delivered on the consumer chain. + +```bash +interchain_security.ccv.provider.v1.Query/QueryConsumerValidators +``` + +Example: + +```bash +grpcurl -plaintext -d '{"consumer_id": "0"}' localhost:9090 interchain_security.ccv.provider.v1.Query/QueryConsumerValidators +``` + +Example Output: + +```json +{ + "validators": [ + { + "providerAddress": "cosmosvalcons1znhu88l6dsvexunfem4u0392kwqyvdkrj66wph", + "consumerKey": { + "ed25519": "62d2CCgWXYZHmlsCon2lzVgnu9gfubep2XRPlZKuLAQ=" + }, + "rate": "0", + "consumerPower": "101", + "consumerCommissionRate": "100000000000000000", + "providerCommissionRate": "100000000000000000", + "description": { + "moniker": "bob" + }, + "providerOperatorAddress": "cosmosvaloper1a7u5k6f54ua3tptl9yn6u82yrvayet6sxn9ywn", + "status": "BOND_STATUS_BONDED", + "providerTokens": "101000000", + "providerPower": "101", + "validatesCurrentEpoch": true + }, + { + "providerAddress": "cosmosvalcons1jnq3j55qe4f946qj8499w0tntxwz90atx26p4q", + "consumerKey": { + "ed25519": "+9BFckSNCI1o/+S85HLjG3pYp1FIzmfYWVKmUH2njxs=" + }, + "rate": "0", + "consumerPower": "100", + "consumerCommissionRate": "100000000000000000", + "providerCommissionRate": "100000000000000000", + "description": { + "moniker": "coordinator" + }, + "providerOperatorAddress": "cosmosvaloper1jk2pp655zxy2gazhxj50s8jk3750y8np6wz4lm", + "status": "BOND_STATUS_BONDED", + "providerTokens": "100000000", + "providerPower": "100", + "validatesCurrentEpoch": true + }, + { + "providerAddress": "cosmosvalcons1h7zs5nwruzvhyzkktvhwypfuxlch6nrrw4jjmj", + "consumerKey": { + "ed25519": "Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=" + }, + "rate": "0", + "consumerPower": "100", + "consumerCommissionRate": "100000000000000000", + "providerCommissionRate": "100000000000000000", + "description": { + "moniker": "alice" + }, + "providerOperatorAddress": "cosmosvaloper19vfen9jn3uk3e6rrkt3pxansunujnlm40wpdvg", + "status": "BOND_STATUS_BONDED", + "providerTokens": "100000000", + "providerPower": "100", + "validatesCurrentEpoch": true + } + ] +} +``` + +#### Has to Validate + +The `QueryConsumerChainsValidatorHasToValidate` endpoint queries a list of consumer chains that a given validator must validate. + +```bash +interchain_security.ccv.provider.v1.Query/QueryConsumerChainsValidatorHasToValidate +``` + +Example: + +```bash +grpcurl -plaintext -d '{"provider_address": "cosmosvalcons1znhu88l6dsvexunfem4u0392kwqyvdkrj66wph"}' localhost:9090 interchain_security.ccv.provider.v1.Query/QueryConsumerChainsValidatorHasToValidate +``` + +Example Output: + +```json +{ + "consumerIds": [ + "0", + "2" + ] +} +``` + +#### Validator Consumer Commission Rate + +The `QueryValidatorConsumerCommissionRate` endpoint queries the consumer commission rate a validator charges on a consumer chain. + +```bash +interchain_security.ccv.provider.v1.Query/QueryValidatorConsumerCommissionRate +``` + +Example: + +```bash +grpcurl -plaintext -d '{"consumer_id": "0", "provider_address": "cosmosvalcons1h7zs5nwruzvhyzkktvhwypfuxlch6nrrw4jjmj"}' localhost:29190 interchain_security.ccv.provider.v1.Query/QueryValidatorConsumerCommissionRate +``` + +Example Output: + +```json +{ + "rate": "750000000000000000" +} +``` + +#### Blocks Until Next Epoch + +The `blocks-until-next-epoch` command allows to query the number of blocks until the next epoch begins and validator updates are sent to consumer chains + +```bash +interchain-security-pd query provider blocks-until-next-epoch [flags] +``` + +Example: + +```bash +interchain-security-pd query provider blocks-until-next-epoch +``` + +Example Output: + +```bash +blocks_until_next_epoch: "286" +``` + +#### Consumer Id From Client Id + +The `consumer-id-from-client-id` command allows to query the consumer id of the chain associated with the provided client id + +```bash +interchain-security-pd query provider consumer-id-from-client-id [client-id] [flags] +``` + +Example: + +```bash +interchain-security-pd query provider consumer-id-from-client-id 07-tendermint-0 +``` + +Example Output: + +```bash +consumer_id: "0" +``` + +#### Consumer Chain + +The `consumer-chain` command allows to query the consumer chain associated with the consumer id + +```bash +interchain-security-pd query provider consumer-chain [consumer-id] [flags] +``` + +Example: + +```bash +interchain-security-pd query provider consumer-chain 0 +``` + +```bash +chain_id: pion-1 +consumer_id: "0" +init_params: + binary_hash: YmluX2hhc2g= + blocks_per_distribution_transmission: "1000" + ccv_timeout_period: 2419200s + consumer_redistribution_fraction: "0.75" + distribution_transmission_channel: "" + genesis_hash: Z2VuX2hhc2g= + historical_entries: "10000" + initial_height: + revision_height: "1" + revision_number: "0" + spawn_time: "2024-09-26T06:55:14.616054Z" + transfer_timeout_period: 3600s + unbonding_period: 1209600s +metadata: + description: description of your chain and all other relevant information + metadata: some metadata about your chain + name: pion-1 +owner_address: cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn +phase: CONSUMER_PHASE_LAUNCHED +power_shaping_params: + allow_inactive_vals: false + allowlist: [] + denylist: [] + min_stake: "0" + top_N: 100 + validator_set_cap: 0 + validators_power_cap: 0 +``` \ No newline at end of file