Skip to content

Commit

Permalink
update outpost user readme
Browse files Browse the repository at this point in the history
  • Loading branch information
BiPhan4 committed Oct 30, 2024
1 parent 0b46104 commit 61520c9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 57 deletions.
34 changes: 5 additions & 29 deletions cross-contract/contracts/outpost-user/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,13 @@

A demonstration of how any contract can call the outpost's API in the same transaction.

To call the outpost:
This contract can save the address of the outpost to state.

### transaction
We can then call the outpost using the exact same API that the outpost itself uses.

`wasmd tx wasm execute <bech32_contract_address> <JsonObject> [flags] `

Example:

`wasmd tx wasm execute wasm1wug8sewp6cedgkmrmvhl3lf3tulagm9hnvy8p0rppz9yjw0g4wtqhs9hr8 <JsonObject> --gas 500000 --gas-prices 0.00uwsm --gas-adjustment 1.3 --from alice --keyring-backend test --output json -y --chain-id localwasm-1`

with JsonObject as:

```json
{
"call_outpost": {
"msg": {
"send_cosmos_msgs": {
"messages": [
{
"stargate": {
"type_url": "/canine_chain.filetree.MsgPostKey",
"value": "binary data here"
}
}
]
}
}
}
}

```
Under the hood, this contract simply makes a cross contract call to its deployed outpost, which
allows for seamless integration with jackal.js, and a smooth UX--i.e., any contract can
perform its core actions, and store data in a single wallet transaction.

A well annotated e2e test can be found at e2e/interchaintest/

Expand Down
41 changes: 13 additions & 28 deletions e2e/interchaintest/logs/test.log
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
INFO: 2024/10/30 13:04:57 Wasmd First light client is
INFO: 2024/10/30 13:04:57 [
{
"client_id": "07-tendermint-0",
"client_state": {
"chain_id": "puppy-1"
}
},
{
"client_id": "09-localhost",
"client_state": {
"chain_id": ""
}
}
]
INFO: 2024/10/30 13:04:57 Wasmd Second light client is
INFO: 2024/10/30 13:04:57 null
INFO: 2024/10/30 13:04:57 jackal first light client is
INFO: 2024/10/30 13:04:57 [
{
"client_id": "07-tendermint-0",
"client_state": {
"chain_id": "localwasm-1"
}
}
]
INFO: 2024/10/30 13:04:57 jackal second light client is
INFO: 2024/10/30 13:04:57 null
INFO: 2024/10/30 13:06:02 The sender of instantiate is wasmd-localwasm-1-bqt
INFO: 2024/10/30 13:06:14 [0x140007a6000]
INFO: 2024/10/30 13:07:14 outpost user address is: wasm1qg5ega6dykkxc307y25pecuufrjkxkaggkkxh7nad0vhyhtuhw3sq29c3m

INFO: 2024/10/30 13:07:19 The outpost address is: wasm1yyca08xqdgvjz0psg56z67ejh9xms6l436u8y58m82npdqqhmmtqas0cl7

INFO: 2024/10/30 13:07:19 The outpost owner is: data:"\"wasm1qg5ega6dykkxc307y25pecuufrjkxkaggkkxh7nad0vhyhtuhw3sq29c3m\""

INFO: 2024/10/30 13:07:30 The outpost state is: &{{jkl10f2wdw28qqlkn2afefq7tzw82ulu4hhsa3sgqs88x2yc9m4kwz5q6y3c6t channel-1} true}

INFO: 2024/10/30 13:07:30 The outpost jkl (ica) address is: jkl10f2wdw28qqlkn2afefq7tzw82ulu4hhsa3sgqs88x2yc9m4kwz5q6y3c6t

INFO: 2024/10/30 13:07:43 data:"\"{\\\"description\\\": \\\"outpost user note\\\", \\\"additional_info\\\": \\\"placeholder\\\"}\""

0 comments on commit 61520c9

Please sign in to comment.