Comments (1)
Cosmos GRPC supports reflections. One can leverage it to load proto files from live GRPC endpoints without access to source protobufs.
The following examples uses grpculrl
on CLI. We need to find a library to do the same programmatically during Atomkraft runtime.
Describing a query
$ grpcurl -plaintext <GRPC_IP:PORT> describe cosmos.staking.v1beta1.Query.Validator
cosmos.staking.v1beta1.Query.Validator is a method:
rpc Validator ( .cosmos.staking.v1beta1.QueryValidatorRequest ) returns ( .cosmos.staking.v1beta1.QueryValidatorResponse ) {
option (.google.api.http) = { get:"/cosmos/staking/v1beta1/validators/{validator_addr}" };
}
Performing the query
$ grpcurl -plaintext -d '{"validator_addr": "cosmosvaloper16k579jk6yt2cwmqx9dz5xvq9fug2tekvlu9qdv"}' <GRPC_IP:PORT> cosmos.staking.v1beta1.Query.Validator
{
"validator": {
"operatorAddress": "cosmosvaloper16k579jk6yt2cwmqx9dz5xvq9fug2tekvlu9qdv",
"consensusPubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"pTcg/QVBC+LzpR0BuynDpMkNh4tajyeKCOtmWMfkvFU="},
"status": "BOND_STATUS_BONDED",
"tokens": "3217496887306",
"delegatorShares": "3217818666723387338143077808531",
"description": {
"moniker": "Informal Systems",
...
The type_urls and proto files for Msg
types can be retrieved from cosmos.base.reflection.v1beta1.ReflectionService
and cosmos.base.reflection.v2alpha1.ReflectionService
.
Listing all tx msg types
$ grpcurl -plaintext <GRPC_IP:PORT> cosmos.base.reflection.v2alpha1.ReflectionService.GetTxDescriptor
{
"tx": {
"fullname": "cosmos.tx.v1beta1.Tx",
"msgs": [
{
"msgTypeUrl": "/ibc.core.channel.v1.MsgChannelOpenInit"
},
{
"msgTypeUrl": "/ibc.core.channel.v1.MsgChannelCloseConfirm"
...
Describing a tx msg type
$ grpcurl -plaintext <GRPC_IP:PORT> describe ibc.core.channel.v1.MsgChannelOpenInit
ibc.core.channel.v1.MsgChannelOpenInit is a message:
message MsgChannelOpenInit {
option (.gogoproto.equal) = false;
option (.gogoproto.goproto_getters) = false;
string port_id = 1 [(.gogoproto.moretags) = "yaml:\port_id\"];
.ibc.core.channel.v1.Channel channel = 2 [(.gogoproto.nullable) = false];
string signer = 3;
}
from atomkraft.
Related Issues (20)
- Adopt async runtime
- Failed GRPC connections with reduced block time
- Populate `.github` directory with useful templates and standard practices
- Installation instruction for pip are missing HOT 1
- Stuck at broadcasting when transaction fails
- Atomkraft with provenance binary (help needed) HOT 9
- MDX tests are failing non-deterministically on macOS runner HOT 2
- Upon starting testnet from Atomkraft " unsupported hash type ripemd160" error is received HOT 1
- Update existing .tla examples to follow the changes in the Apalache typesystem
- vscode plugins question HOT 1
- Fix report directory
- Improve location of test files for `test` command
- Improving CONTRIBUTING.md
- can't run `atomkraft` without `.atomkraft` directory HOT 4
- `atomkraft init` should generate a `.gitignore` file
- `atomkraft init` should generate a hello world project instead of an empty one
- "None" parsing error HOT 3
- Atomkraft gives Parsing error when apalache not installed HOT 1
- Bech32 address derivation failing on Ethermint chains
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atomkraft.