From 2acd632f6d624957bf8c2b8b8daea8ed908f1b7d Mon Sep 17 00:00:00 2001 From: Conor Schaefer Date: Mon, 11 Mar 2024 15:43:02 -0700 Subject: [PATCH] docs: update deimos ibc channel for osmosis We had a few chain halts on the `v0.68.x` release series. As of `v0.69.0`, "channel-0" is the correct value for relaying to Osmosis testnet. Added mention of the slick new `pcli query ibc channels` to the docs. Also overhauled the dev docs for how to test IBC functionality interactively, since that knowledge has mostly been communicated via pairing session, but not yet fully written down. We no longer use `rly`, neither for running relayer instances nor for ad-hoc CLI transfers. Instead, we can use `hermes` for both roles. Linked out to wiki docs on the high-churn hermes relayer config steps, since we're updating those frequently. --- docs/guide/book.toml | 3 + docs/guide/src/dev/ibc.md | 109 +++++++++++++++-------------- docs/guide/src/pcli/transaction.md | 39 ++++------- 3 files changed, 72 insertions(+), 79 deletions(-) diff --git a/docs/guide/book.toml b/docs/guide/book.toml index 7909dbded2..f2652f8691 100644 --- a/docs/guide/book.toml +++ b/docs/guide/book.toml @@ -24,3 +24,6 @@ additional-js =["theme/js/mermaid.min.js", "theme/js/mermaid-init.js"] # [output.linkcheck] # follow-web-links = false # warning-policy = "ignore" +# +# The buf.build website doesn't support HTTP HEAD calls, returning 405. +# exclude = ['buf\.build'] diff --git a/docs/guide/src/dev/ibc.md b/docs/guide/src/dev/ibc.md index 04f6807911..894cce65e3 100644 --- a/docs/guide/src/dev/ibc.md +++ b/docs/guide/src/dev/ibc.md @@ -3,6 +3,61 @@ This guide explains how to work with IBC functionality while developing Penumbra. +## Making Penumbra -> Osmosis outbound transfers, via pcli +See the [IBC user docs](../pcli/transaction.md#ibc-withdrawals) for how to use +`pcli` to make an outbound IBC withdrawal, to a different testnet. + +## Making Osmosis -> Penumbra inbound transfers, via hermes + +Transferring from Osmosis to Penumbra requires making an Osmosis transaction. +The `osmosisd` CLI tooling unfortunately does not work for IBC transfers. +To move funds from a Penumbra chain to an Osmosis testnet, use the `hermes` binary +from the [Penumbra fork](https://github.com/penumbra-zone/hermes). What you'll need: + +* a local checkout of Hermes +* your own osmosis wallet, with funds from the testnet faucet +* channel info for both chains (consult `pcli query ibc channels`) +* a penumbra address + +You should use your own Osmosis wallet, with funds from the testnet faucet, +and configure Hermes locally on your workstation with key material. Do *not* +reuse the Hermes relayer instance, as sending transactions from its wallets +while it's relaying can break things. + +```bash +# Hop into the hermes repo and build it: +cargo build --release + +# Edit `config-penumbra-osmosis.toml` with your Penumbra wallet SpendKey, +# and make sure the Penumbra chain id is correct. +# Add your osmosis seed phrase to the file `mnemonic-osmosis-transfer`, +# then import it: +cargo run --release --bin hermes -- \ + --config config-penumbra-osmosis.toml keys add \ + --chain osmo-test-5 --mnemonic-file ./mnemonic-osmosis-transfer + +# Then run a one-off command to trigger an outbound IBC transfer, +# from Osmosis to Penumbra: +cargo run --release --bin hermes -- \ + --config ./config-penumbra-osmosis.toml tx ft-transfer \ + --dst-chain --src-chain osmo-test-5 --src-port transfer \ + --src-channel --denom uosmo --amount 100 \ + --timeout-height-offset 10000000 --timeout-seconds 10000000 \ + --receiver +``` + +You can view account history for the shared Osmosis testnet account here: +[https://www.mintscan.io/osmosis-testnet/account/osmo1kh0fwkdy05yp579d8vczgharkcexfw582zj488](https://www.mintscan.io/osmosis-testnet/account/osmo1kh0fwkdy05yp579d8vczgharkcexfw582zj488). +Change the address at the end of the URL to your account to confirm that your test transfer worked. + +## Updating Hermes config for a new testnet +See the [procedure in the wiki](https://github.com/penumbra-zone/penumbra/wiki/Updating-Hermes) +for up to date information. + +Use the [IBC user docs](../pcli/transaction.md#ibc-withdrawals) to make a test transaction, +to ensure that relaying is working. In the future, we should consider posting the newly created +channel to the IBC docs guide, so community members can use it. + ## Working with a local devnet ``` -{ - "state": 3, - "ordering": 1, - "counterparty": { - "port_id": "transfer", - "channel_id": "channel-5077" - }, - "connection_hops": [ - "connection-6" - ], - "version": "ics20-1", - "port_id": "transfer", - "channel_id": "channel-2" -} -``` - -The output above shows that the IBC channel id on Penumbra is 2, and on Osmosis it's 5077. -There's one more piece of information we need to make an IBC withdrawal: the appropriate IBC -timeout height, which is composed of two values: `-`. -For the Osmosis testnet, as of 2023Q4, the chain id is `osmo-test-5`, meaning the chain id revision is `5`. -So a value like `5-5000000` (i.e. revision 5 at height 5 million) will work. ++------------+----------+--------------+-------------------------+-------+-----------------+---------------+ +| Channel ID | Port | Counterparty | Counterparty Channel ID | State | Client ID | Client Height | ++==========================================================================================================+ +| 0 | transfer | osmo-test-5 | channel-6105 | OPEN | 07-tendermint-4 | 5-5937586 | ++------------+----------+--------------+-------------------------+-------+-----------------+---------------+ +``` + +You can see this yourself by running `pcli query ibc channels` and comparing the output you see +with what's shown above. It's possible the output will include mention of other chains. +The output above shows that the IBC channel id on Penumbra is 0, and on Osmosis it's 6105. To initiate an IBC withdrawal from Penumbra testnet to Osmosis testnet: ```bash -pcli tx withdraw --to --channel 5gm --timeout-height 5-5000000 +pcli tx withdraw --to --channel 5gm ``` -Unfortunately the CLI tooling for Osmosis is cumbersome. For now, use `rly` as a user agent +Unfortunately the CLI tooling for Osmosis is cumbersome. For now, use `hermes` as a user agent for the Osmosis testnet, as described in the [IBC dev docs](../dev/ibc.md). [Osmosis testnet]: https://docs.osmosis.zone/overview/endpoints#testnet-networks