-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doc for integrate feeabs module with new chain. (#148)
* Add doc for integrate feeabs module with new chain. * Update documentation for integrate Cosmos Hub. * wip: add guide for Stargaze * update * update relayer mnemonic * linting * Update documentation for integrate Cosmos Hub. * Fix lint * Add scripts run relayer * Update docs * Fix version query path * Update docs * add script for binary installation * Update docs * Update docs * Refactor docs --------- Co-authored-by: Tuan Tran <[email protected]> Co-authored-by: nghuyenthevinh2000 <[email protected]>
- Loading branch information
1 parent
b217b6e
commit b032641
Showing
32 changed files
with
710 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ go.work.sum | |
go.work | ||
|
||
bin/ | ||
_build/ | ||
|
||
# IDE config | ||
.vscode/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[submodule "deps/gaia"] | ||
path = deps/gaia | ||
url = https://github.com/notional-labs/gaia.git | ||
branch = feeabs | ||
[submodule "deps/stargaze"] | ||
path = deps/stargaze | ||
url = https://github.com/notional-labs/stargaze.git | ||
branch = feature/feeabs | ||
[submodule "deps/relayer"] | ||
path = deps/relayer | ||
url = https://github.com/cosmos/relayer.git | ||
branch = release/v2.4.x | ||
[submodule "deps/osmosis"] | ||
path = deps/osmosis | ||
url = https://github.com/osmosis-labs/osmosis.git | ||
branch = v23.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# SETUP GUIDE FOR INTEGRATION TEST | ||
|
||
## build binaries | ||
1. run `make build-integration-binary`, binaries will be in _build/binary | ||
2. if you want to recreate a binary, delete that binary in _build/binary and run `make build-integration-binary` again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
ROOT=$(pwd) | ||
|
||
# underscore so that go tool will not take gocache into account | ||
mkdir -p _build/gocache | ||
export GOMODCACHE=$ROOT/_build/gocache | ||
|
||
# install gaid binary | ||
if ! command -v _build/binary/gaid &> /dev/null | ||
then | ||
echo "Building gaiad..." | ||
cd deps/gaia | ||
GOBIN="$ROOT/_build/binary" go install -mod=readonly ./... | ||
cd ../.. | ||
fi | ||
|
||
# install osmosisd binary | ||
if ! command -v _build/binary/osmosisd &> /dev/null | ||
then | ||
echo "Building osmosisd..." | ||
cd deps/osmosis | ||
GOBIN="$ROOT/_build/binary" go install -mod=readonly ./... | ||
cd ../.. | ||
fi | ||
|
||
# install relayer binary | ||
if ! command -v _build/binary/relayer &> /dev/null | ||
then | ||
echo "Building relayer..." | ||
cd deps/relayer | ||
GOBIN="$ROOT/_build/binary" go install -mod=readonly ./... | ||
cd ../.. | ||
fi | ||
|
||
# install stargaze binary | ||
if ! command -v _build/binary/starsd &> /dev/null | ||
then | ||
echo "Building starsd..." | ||
cd deps/stargaze | ||
GOBIN="$ROOT/_build/binary" go install -mod=readonly ./... | ||
cd ../.. | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# Integrate `x/feeabs` with Cosmos Hub | ||
|
||
This is document for testing integrate a new chain with `x/feeabs` module. | ||
|
||
Firstly, we will add `feeabs` module to Cosmos Hub and using Osmosis testnet to minimize effort. | ||
|
||
* Original Fee Abstraction repository: | ||
|
||
<https://github.com/osmosis-labs/fee-abstraction> | ||
|
||
* Cosmos Hub with added `feeabs` module: | ||
|
||
<https://github.com/notional-labs/gaia/tree/feeabs> | ||
|
||
## 1. Setup nodes | ||
|
||
* Install binaries: [install binaries guide](../README.md) | ||
|
||
* Run nodes: | ||
* In `gaia` working dir, run: | ||
|
||
```bash | ||
sh startnode.sh | ||
``` | ||
|
||
## 2. Setup relayers | ||
|
||
* Run relayers: | ||
|
||
```bash | ||
# Setup chains and paths for relayer between gaia-feeabs | ||
cd <fee-abstraction>/tests/integration/cosmoshub | ||
sh tools/setup_relayer.sh | ||
|
||
rly tx link transfer -d -t 10s --client-tp 36h | ||
rly tx link query --src_port feeabs --dst_port icqhost --order unordered --version icq-1 -d -t 10s --client-tp 36h | ||
|
||
rly start | ||
``` | ||
|
||
* Get ibc token info: | ||
|
||
```bash | ||
# Get channels in gaia | ||
rly q channels gaia | ||
|
||
# {"chain_id":"gaia-1","channel_id":"channel-0","client_id":"07-tendermint-0","connection_hops":["connection-0"],"counterparty":{"chain_id":"osmo-test-5","channel_id":"channel-6084","client_id":"07-tendermint-2545","connection_id":"connection-2390","port_id":"transfer"},"ordering":"ORDER_UNORDERED","port_id":"transfer","state":"STATE_OPEN","version":"ics20-1"} | ||
# {"chain_id":"gaia-1","channel_id":"channel-1","client_id":"07-tendermint-0","connection_hops":["connection-1"],"counterparty":{"chain_id":"osmo-test-5","channel_id":"channel-6085","client_id":"07-tendermint-2545","connection_id":"connection-2391","port_id":"transfer"},"ordering":"ORDER_UNORDERED","port_id":"transfer","state":"STATE_OPEN","version":"ics20-1"} | ||
|
||
# Transfer uatom from gaia to osmosis | ||
rly tx transfer gaia osmosis 100000000uatom osmo1wrhdsm4gy307mygkgmanjc3r2g0ttuhnhkfp44 channel-0 --path transfer | ||
|
||
# Transfer uosmo from osmosis to gaia | ||
rly tx transfer osmosis gaia 100000uosmo cosmos1wrhdsm4gy307mygkgmanjc3r2g0ttuhnld63r8 channel-6084 --path transfer | ||
|
||
|
||
# Query balances of relayer wallet | ||
rly q balance gaia --ibc-denoms | ||
rly q balance osmosis --ibc-denoms | ||
|
||
# ibc/uatom on osmosis: ibc/80C64E7EB7E8B6705FC9C1D9C486EB6278823068D9224915B6A5DABDF03FB2D5 | ||
# ibc/uosmo on gaia: ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 | ||
``` | ||
|
||
## 3. Setup pools, contracts on Osmosis testnet | ||
|
||
a. Pre-deploy contracts: | ||
|
||
* Registry: | ||
|
||
* code_id: `7238` | ||
* address: `osmo1m9jk8zvrkpex0rxhp76emr0qm2z5khvj09msl9c78gcq7c38xdzsgq0cgm` | ||
|
||
* SwapRouter: | ||
|
||
* code_id: `7239` | ||
* address: `osmo1j48ncj9wkzs3pnkux96ct6peg7rznnt4jx6ysdcs0283ysxj2ztqtr602y` | ||
|
||
* XCSv2: | ||
* code_id: `7240` | ||
* address: `osmo177jurcy582fk5q298es6662pu48a46ze6eequnv3z0parekpwhhs034wsv` | ||
|
||
b. Create pool: | ||
|
||
Correct information on `<cosmoshub>/pools/pool.json`, and run script: | ||
|
||
```bash | ||
sh tools/create_pool.sh | ||
``` | ||
|
||
c. Set swap route | ||
|
||
Correct information on `<cosmoshub>/tools/set_route.sh`, and run script: | ||
|
||
```bash | ||
sh tools/set_route.sh | ||
``` | ||
|
||
## 4. Testing fee abstraction | ||
|
||
a. Change params of `feeabs` module | ||
|
||
Correct information on `<cosmoshub>/proposals/params.json`, and run script: | ||
|
||
```bash | ||
sh tools/change_feeabs_params.sh | ||
``` | ||
|
||
b. Add host zone config | ||
|
||
Correct information on `<cosmoshub>/proposals/add_host_zone.json`, and run script: | ||
|
||
```bash | ||
sh tools/add_host_zone.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
river tackle scare kiss top depend know siege member awesome left display exotic skate assault glue observe prosper female reveal recall north shine behind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bomb jewel cushion behave orphan lava bulk defy evolve spend match grass dress upgrade blast please business stairs learn syrup kick narrow bleak canoe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"weights": "1uosmo,100ibc/80C64E7EB7E8B6705FC9C1D9C486EB6278823068D9224915B6A5DABDF03FB2D5", | ||
"initial-deposit": "1000uosmo,100000ibc/80C64E7EB7E8B6705FC9C1D9C486EB6278823068D9224915B6A5DABDF03FB2D5", | ||
"swap-fee": "0.01", | ||
"exit-fee": "0", | ||
"future-governor": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"title": "Add Fee Abstraction Host Zone Proposal", | ||
"description": "Add Fee Abstraction Host Zone", | ||
"host_chain_fee_abs_config": { | ||
"ibc_denom": "ibc/80C64E7EB7E8B6705FC9C1D9C486EB6278823068D9224915B6A5DABDF03FB2D5", | ||
"osmosis_pool_token_denom_in": "uosmo", | ||
"pool_id": "408", | ||
"frozen": false | ||
}, | ||
"deposit": "100000000uatom" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"title": "Enable Fee Abtraction", | ||
"description": "Change params for enable fee abstraction", | ||
"changes": [ | ||
{ | ||
"subspace": "feeabs", | ||
"key": "NativeIbcedInOsmosis", | ||
"value": "ibc/62DDD1848B6F9182A658B6E88D7625F71D863E678ED043660692BD307C9217A0" | ||
}, | ||
{ | ||
"subspace": "feeabs", | ||
"key": "ChainName", | ||
"value": "gaia" | ||
}, | ||
{ | ||
"subspace": "feeabs", | ||
"key": "IbcTransferChannel", | ||
"value": "channel-0" | ||
}, | ||
{ | ||
"subspace": "feeabs", | ||
"key": "IbcQueryIcqChannel", | ||
"value": "channel-2" | ||
}, | ||
{ | ||
"subspace": "feeabs", | ||
"key": "OsmosisCrosschainSwapAddress", | ||
"value": "osmo177jurcy582fk5q298es6662pu48a46ze6eequnv3z0parekpwhhs034wsv" | ||
} | ||
], | ||
"deposit": "100000000uatom" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"title": "Update Fee Abstraction Host Zone Proposal", | ||
"description": "Unfrozen Fee Abstraction Host Zone", | ||
"host_chain_fee_abs_config": { | ||
"ibc_denom": "ibc/80C64E7EB7E8B6705FC9C1D9C486EB6278823068D9224915B6A5DABDF03FB2D5", | ||
"osmosis_pool_token_denom_in": "uosmo", | ||
"pool_id": "408", | ||
"frozen": false | ||
}, | ||
"deposit": "100000000uatom" | ||
} |
Oops, something went wrong.