Skip to content

Commit

Permalink
Add a demo scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehsan-saradar committed Jul 9, 2022
1 parent 503c980 commit e21dd75
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 0 deletions.
45 changes: 45 additions & 0 deletions demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
### Start the two instances of demo chain with following commands

```bash
ignite chain serve -c sender.yml --reset-once
```

```bash
`ignite chain serve -c receiver.yml --reset-once`
```

### Configure and start the relayer

```bash
ignite relayer configure -a \
--source-rpc "http://localhost:26659" \
--source-faucet "http://localhost:4500" \
--source-port "interquery" \
--source-gasprice "0.0stake" \
--source-gaslimit 5000000 \
--source-prefix "cosmos" \
--source-version "icq-1" \
--target-rpc "http://localhost:26559" \
--target-faucet "http://localhost:4501" \
--target-port "icqhost" \
--target-gasprice "0.0stake" \
--target-gaslimit 300000 \
--target-prefix "cosmos" \
--target-version "icq-1"
```

```bash
ignite relayer connect
```

### Send the query to "receiver" chain

```bash
interchain-query-demod tx interquery send-query-all-balances channel-0 cosmos1ez43ye5qn3q2zwh8uvswppvducwnkq6w6mthgl --chain-id=sender --node=tcp://localhost:26659 --home ~/.sender --from alice
```

### See the result of packet 1

```bash
interchain-query-demod query interquery query-state 1 --chain-id=sender --node=tcp://localhost:26659
```
31 changes: 31 additions & 0 deletions receiver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
accounts:
- name: alice
mnemonic: cruise scene law sea push expose scorpion wire trick repair wave quote task dose inner denial alpha favorite certain blouse motion flash split lunch
coins: ["20000000atom", "2000000000stake"]
- name: bob
mnemonic: lizard garlic canyon winner cheese tent drip task because ecology clay bridge junk critic track artefact gather harsh deliver unit vacant earth diesel stool
coins: ["10000000atom", "1000000000stake"]
validator:
name: alice
staked: "100000000stake"
faucet:
host: ":4501"
name: bob
coins: ["1000000atom", "100000000stake"]
host:
rpc: ":26559"
p2p: ":26662"
prof: ":6062"
grpc: ":9096"
grpc-web: ":8092"
api: ":1312"
frontend: ":8082"
dev-ui: ":12352"
genesis:
chain_id: "receiver"
app_state:
interchainquery:
params:
allow_queries: ["/cosmos.bank.v1beta1.Query/AllBalances"]
init:
home: "$HOME/.receiver"
26 changes: 26 additions & 0 deletions sender.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
accounts:
- name: alice
mnemonic: edge victory hurry slight dog exit company bike hill erupt shield aspect turkey retreat stairs summer sadness crush absorb draft viable orphan chuckle exhibit
coins: ["20000000atom", "2000000000stake"]
- name: bob
coins: ["10000000atom", "1000000000stake"]
validator:
name: alice
staked: "100000000stake"
faucet:
host: ":4500"
name: bob
coins: ["1000000atom", "100000000stake"]
host:
rpc: ":26659"
p2p: ":26661"
prof: ":6061"
grpc: ":9095"
grpc-web: ":8091"
api: ":1311"
frontend: ":8081"
dev-ui: ":12351"
genesis:
chain_id: "sender"
init:
home: "$HOME/.sender"
7 changes: 7 additions & 0 deletions x/interquery/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/gogo/protobuf/proto"
)

func RegisterCodec(cdc *codec.LegacyAmino) {
Expand All @@ -18,6 +20,11 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
)
// this line is used by starport scaffolding # 3

// For printing purposes
registry.RegisterImplementations((*proto.Message)(nil),
&banktypes.QueryAllBalancesRequest{},
&banktypes.QueryAllBalancesResponse{},
)
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}

Expand Down

0 comments on commit e21dd75

Please sign in to comment.