Skip to content

New guide: Use Hyperlane TIA as gas token #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 65 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
cdcfbe3
gm-world-tia-gas.md: small stuff
assafmo Jun 9, 2024
24466e1
Add IBC warning
assafmo Jun 9, 2024
be20109
Merge branch 'main' into hyperlane
assafmo Jun 9, 2024
74fa448
cp {cosmwasm,hyperlane}.md
assafmo Jun 9, 2024
83263e9
Edit IBC warning
assafmo Jun 9, 2024
156eca3
Refactor git clone CosmWasm
assafmo Jun 9, 2024
c9e9d5e
cosmwasm.md: Foramt with Prettier
assafmo Jun 9, 2024
858c18e
Init hyperlane.md
assafmo Jun 9, 2024
1926617
cp hyperlane{-use-tia-for-gas,}.md
assafmo Jun 9, 2024
618d8b1
docs: Update guides/hyperlane-use-tia-for-gas.md
assafmo Jun 9, 2024
bd9d324
fix(tutorials/cosmwasm.md): update line numbers to comment out in app…
assafmo Jun 23, 2024
21f1849
docs(guides): update hyperlane use tia for gas guide with new instruc…
assafmo Jun 23, 2024
490e23c
docs(guides): update hyperlane usage guide with new grpc endpoint and…
assafmo Jun 23, 2024
c83407c
docs(hyperlane-use-tia-for-gas.md): add tip on generating and using o…
assafmo Jun 23, 2024
a7d62d2
docs: add information note about `localwasm-key` in hyperlane tia gas…
assafmo Jun 23, 2024
2081b77
docs(guides/hyperlane-use-tia-for-gas.md): update hyperlane relayer c…
assafmo Jun 23, 2024
7d4bea0
Update guide for using TIA for gas on Hyperlane
assafmo Jun 23, 2024
6bea20e
Update Hyperlane guide with more deployment resources
assafmo Jun 23, 2024
57bbca5
Update Hyperlane guide with relayer run command
assafmo Jun 23, 2024
4409030
Update Hyperlane deployment for Stride testnet
assafmo Jun 24, 2024
6cd1b0a
Update Hyperlane gas usage config
assafmo Jun 24, 2024
0b64a70
Update cw-hyperlane repo clone URL and fix typo in git command
assafmo Jun 25, 2024
5281aa7
Add CosmWasm rollup deployment instructions (in short)
assafmo Jun 25, 2024
2304fac
docs(hyperlane-use-tia-for-gas.md): update cosmwasm init script to us…
assafmo Jun 25, 2024
6eb4d4e
docs(guides/hyperlane-use-tia-for-gas.md): update grpc url, config fi…
assafmo Jun 25, 2024
6abd3da
docs(hyperlane-use-tia-for-gas.md): remove unnecessary note about tem…
assafmo Jun 25, 2024
37dae50
docs(hyperlane-use-tia-for-gas.md): Update `wasmd tx bank send` and a…
assafmo Jun 25, 2024
d1dba44
small stuff
assafmo Jun 25, 2024
361f0d2
🥲🔫always has been
assafmo Jun 26, 2024
d10b656
use latest hyperlane-agent
assafmo Jun 26, 2024
e02cc63
s/localwasm/localwasmd/
assafmo Jul 3, 2024
19e6314
make sure to configure the docker host ip in agent-config.docker.json
assafmo Jul 3, 2024
2595b31
docs(hyperlane-use-tia-for-gas): update gas adjustment value from 1.2…
assafmo Jul 10, 2024
433895e
stuff
assafmo Jul 30, 2024
f11f5a8
added instructions for adding tokenfactory
sampocs Jul 30, 2024
703c5bd
deployment working on mac
sampocs Jul 30, 2024
378cac1
updated to run everything in docker
sampocs Jul 31, 2024
ba59eb1
transfers working!
sampocs Jul 31, 2024
9a24e04
formatter
sampocs Jul 31, 2024
ae005cb
nit changes while testing
sampocs Jul 31, 2024
1475c63
added transfer from celestia
sampocs Jul 31, 2024
f16675c
refactor hyperlane-use-tia-for-gas.md to use external files rather th…
assafmo Sep 5, 2024
8b56608
fix(guides/hyperlane-use-tia-for-gas.md): update URL for fetching uti…
assafmo Sep 5, 2024
a32d907
fix guides/assets/hyperlane-use-tia-for-gas/add-tokenfactory.diff
assafmo Sep 5, 2024
7fe15dc
fix guides/assets/hyperlane-use-tia-for-gas/add-tokenfactory.diff
assafmo Sep 5, 2024
f147201
fix guides/assets/hyperlane-use-tia-for-gas/docker-compose.yml
assafmo Sep 5, 2024
fc838fa
Revert "fix guides/assets/hyperlane-use-tia-for-gas/docker-compose.yml"
assafmo Sep 5, 2024
5563886
fix quotes in sed command to avoid syntax error
assafmo Sep 27, 2024
c949a26
chore(docker-compose): replace perl single quotes with double quotes …
assafmo Sep 27, 2024
409d6b8
fix(wasmd.Dockerfile): update golang base image from 1.22.5 to 1.23
assafmo Sep 27, 2024
0faa152
nit
assafmo Sep 27, 2024
17225e4
fix quoting
assafmo Sep 27, 2024
ed43b1e
feat(wasmd.Dockerfile): downgrade base image golang version to 1.22.5
assafmo Sep 27, 2024
f30f71e
build(Dockerfile): fix apt-get install command by adding -y flag to a…
assafmo Sep 27, 2024
028592e
fix(hyperlane-use-tia-for-gas): automatically confirm apt-get install…
assafmo Sep 27, 2024
d5b5109
chore(wasmd.Dockerfile): remove unnecessary echo command that is alwa…
assafmo Sep 27, 2024
193b455
refactor(wasmd.Dockerfile): simplify wasmd build and installation steps
assafmo Sep 27, 2024
d1aee89
feat(hyperlane): add new docker-compose configuration for restarting …
assafmo Sep 27, 2024
cc83b42
docs: remove docker-compose-2 file for hyperlane guide
assafmo Sep 27, 2024
b84123e
feat(docker-compose.yml): add condition to restart wasm from existing…
assafmo Sep 27, 2024
066c60e
final pass
assafmo Sep 27, 2024
d36eef3
docs(stride-installation): correct git clone and cd commands to ensur…
assafmo Sep 27, 2024
9d18118
final pass
assafmo Sep 27, 2024
3a3e45a
Merge branch 'main' into hyperlane
assafmo Sep 27, 2024
3c8cf75
Update guides/hyperlane-use-tia-for-gas.md
assafmo Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions guides/assets/hyperlane-use-tia-for-gas/add-tokenfactory.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
diff --git a/app/app.go b/app/app.go
index 44934ea..8e8c829 100644
--- a/app/app.go
+++ b/app/app.go
@@ -10,6 +10,9 @@ import (
"strings"
"sync"

+ "github.com/Stride-Labs/tokenfactory/tokenfactory"
+ tokenfactorykeeper "github.com/Stride-Labs/tokenfactory/tokenfactory/keeper"
+ tokenfactorytypes "github.com/Stride-Labs/tokenfactory/tokenfactory/types"
abci "github.com/cometbft/cometbft/abci/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
dbm "github.com/cosmos/cosmos-db"
@@ -176,10 +179,11 @@ var maccPerms = map[string][]string{
govtypes.ModuleName: {authtypes.Burner},
nft.ModuleName: nil,
// non sdk modules
- ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
- ibcfeetypes.ModuleName: nil,
- icatypes.ModuleName: nil,
- wasmtypes.ModuleName: {authtypes.Burner},
+ ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
+ ibcfeetypes.ModuleName: nil,
+ icatypes.ModuleName: nil,
+ wasmtypes.ModuleName: {authtypes.Burner},
+ tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
}

var (
@@ -226,6 +230,7 @@ type WasmApp struct {
ICAHostKeeper icahostkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasmkeeper.Keeper
+ TokenFactoryKeeper tokenfactorykeeper.Keeper

ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
@@ -326,6 +331,7 @@ func NewWasmApp(
capabilitytypes.StoreKey, ibcexported.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey,
wasmtypes.StoreKey, icahosttypes.StoreKey,
icacontrollertypes.StoreKey,
+ tokenfactorytypes.StoreKey,
)

tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
@@ -563,6 +569,16 @@ func NewWasmApp(
app.BankKeeper,
)

+ // Token factory keeper
+ app.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper(
+ keys[tokenfactorytypes.StoreKey],
+ app.GetSubspace(tokenfactorytypes.ModuleName),
+ maccPerms,
+ app.AccountKeeper,
+ app.BankKeeper,
+ app.DistrKeeper,
+ )
+
// create evidence keeper with router
evidenceKeeper := evidencekeeper.NewKeeper(
appCodec,
@@ -725,6 +741,7 @@ func NewWasmApp(
ibcfee.NewAppModule(app.IBCFeeKeeper),
ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
ibctm.AppModule{},
+ tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
// sdk
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
)
@@ -770,6 +787,7 @@ func NewWasmApp(
icatypes.ModuleName,
ibcfeetypes.ModuleName,
wasmtypes.ModuleName,
+ tokenfactorytypes.ModuleName,
)

app.ModuleManager.SetOrderEndBlockers(
@@ -786,6 +804,7 @@ func NewWasmApp(
icatypes.ModuleName,
ibcfeetypes.ModuleName,
wasmtypes.ModuleName,
+ tokenfactorytypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
@@ -811,6 +830,7 @@ func NewWasmApp(
ibcfeetypes.ModuleName,
// wasm after ibc transfer
wasmtypes.ModuleName,
+ tokenfactorytypes.ModuleName,
}
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
@@ -899,9 +919,6 @@ func NewWasmApp(
// At startup, after all modules have been registered, check that all proto
// annotations are correct.
protoFiles, err := proto.MergedRegistry()
- if err != nil {
- panic(err)
- }
err = msgservice.ValidateProtoAnnotations(protoFiles)
if err != nil {
// Once we switch to using protoreflect-based antehandlers, we might
@@ -1209,5 +1226,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable())

paramsKeeper.Subspace(wasmtypes.ModuleName)
+ paramsKeeper.Subspace(tokenfactorytypes.ModuleName)
return paramsKeeper
}

99 changes: 99 additions & 0 deletions guides/assets/hyperlane-use-tia-for-gas/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
services:
da:
image: golang:1.22-alpine
container_name: da
entrypoint: ["sh", "-c"]
command:
- |
apk add curl perl jq bash git make
curl -sSL https://rollkit.dev/install-local-da.sh -o start.sh
perl -i -pe 's;./build/local-da;./build/local-da -listen-all;' start.sh
sh start.sh
ports:
- 7980:7980
localwasm:
image: localwasm
container_name: localwasm
build:
context: ../../wasmd
dockerfile: Dockerfile
entrypoint: ["sh", "-c"]
command:
- |
if [ -f /opt/restart-wasm.sh ]; then
bash /opt/restart-wasm.sh
else
apt-get update && apt-get install -y curl perl jq netcat
until nc -z -v da 7980; do
echo "Waiting for the DA layer to start..."
sleep 2
done
curl -sSL https://rollkit.dev/cosmwasm/init.sh |
perl -pe 's;127.0.0.1;0.0.0.0;g' |
perl -pe 's;http://localhost:7980;http://da:7980;g' |
perl -pe 's;--rollkit.aggregator;--rollkit.aggregator --api.address tcp://0.0.0.0:1317;g' |
bash
fi
ports:
- 36657:36657
- 1317:1317
- 9290:9290
relayer:
container_name: hpl-relayer
image: gcr.io/abacus-labs-dev/hyperlane-agent:8a66544-20240530-111322
platform: linux/amd64
user: root
# restart: always
entrypoint: ["sh", "-c"]
command:
- |
rm -rf /app/config/* && \
cp "/etc/hyperlane/agent-config.docker.json" "/app/config/agent-config.json" && \
CONFIG_FILES="/etc/hyperlane/relayer.json" \
./relayer
ports:
- 9110:9090
volumes:
- ./hyperlane:/etc/hyperlane
- ./relayer:/etc/data
- ./validator:/etc/validator

validator-localwasm:
container_name: hpl-validator-localwasm
image: gcr.io/abacus-labs-dev/hyperlane-agent:8a66544-20240530-111322
platform: linux/amd64
user: root
# restart: always
entrypoint: ["sh", "-c"]
command:
- |
rm -rf /app/config/* && \
cp "/etc/hyperlane/agent-config.docker.json" "/app/config/agent-config.json" && \
CONFIG_FILES="/etc/hyperlane/validator.localwasm.json" \
./validator
ports:
- 9120:9090
volumes:
- ./hyperlane:/etc/hyperlane
- ./validator:/etc/validator
- ./validator/localwasm:/etc/data

validator-strideinternal1:
container_name: hpl-validator-strideinternal1
image: gcr.io/abacus-labs-dev/hyperlane-agent:8a66544-20240530-111322
platform: linux/amd64
user: root
# restart: always
entrypoint: ["sh", "-c"]
command:
- |
rm -rf /app/config/* && \
cp "/etc/hyperlane/agent-config.docker.json" "/app/config/agent-config.json" && \
CONFIG_FILES="/etc/hyperlane/validator.strideinternal1.json" \
./validator
ports:
- 9121:9090
volumes:
- ./hyperlane:/etc/hyperlane
- ./validator:/etc/validator
- ./validator/strideinternal1:/etc/data
66 changes: 66 additions & 0 deletions guides/assets/hyperlane-use-tia-for-gas/hyperlane-config-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
networks:
- id: "localwasm"
hrp: "wasm"
endpoint:
rpc: "http://127.0.0.1:36657"
rest: "http://127.0.0.1:1317"
grpc: "http://127.0.0.1:9290"
gas:
price: "0.025"
denom: "uwasm"
domain: 963
signer: "join always addict position jungle jeans bus govern crack huge photo purse famous live velvet virtual weekend hire cricket media dignity wait load mercy" # wasm133xh839fjn9wxzg6vhc0370lcem8939zr8uu45
- id: "stride-internal-1"
hrp: "stride"
endpoint:
rpc: "https://stride-testnet-rpc.polkachu.com"
rest: "https://stride-testnet-api.polkachu.com"
grpc: "http://stride-testnet-grpc.polkachu.com:12290"
gas:
price: "0.01"
denom: "ustrd"
domain: 1651
signer: "join always addict position jungle jeans bus govern crack huge photo purse famous live velvet virtual weekend hire cricket media dignity wait load mercy" # stride133xh839fjn9wxzg6vhc0370lcem8939z2sd4gn

# wasm133xh839fjn9wxzg6vhc0370lcem8939zr8uu45
# stride133xh839fjn9wxzg6vhc0370lcem8939z2sd4gn
signer: "join always addict position jungle jeans bus govern crack huge photo purse famous live velvet virtual weekend hire cricket media dignity wait load mercy"
Comment on lines +25 to +27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove exposed mnemonic and consider using environment variables.

Exposing the full mnemonic in the configuration file is a severe security risk. Additionally, repeating the mnemonic from the network configurations is redundant and could lead to maintenance issues.

Consider the following improvements:

  1. Remove the exposed mnemonic from the configuration file.
  2. Use environment variables or a secure secret management system to handle sensitive information like mnemonics.
  3. If the mnemonic must be in the file for development purposes, use a placeholder and document the need to replace it with a secure value in production.

Example:

signer: ${HYPERLANE_SIGNER_MNEMONIC}


deploy:
ism:
type: multisig
owner: <signer>
validators:
963:
addrs:
- <signer>
threshold: 1
hooks:
default:
type: aggregate
owner: <signer>
hooks:
- type: merkle

- type: igp
owner: <signer>
token: "ibc/1A7653323C1A9E267FF7BEBF40B3EEA8065E8F069F47F2493ABC3E0B621BF793"
configs:
963:
exchange_rate: 1000
gas_price: 10000
default_gas_usage: 100000

required:
type: aggregate
owner: <signer>
hooks:
- type: pausable
owner: <signer>
paused: false

- type: fee
owner: <signer>
fee:
denom: "ibc/1A7653323C1A9E267FF7BEBF40B3EEA8065E8F069F47F2493ABC3E0B621BF793"
amount: 1
65 changes: 65 additions & 0 deletions guides/assets/hyperlane-use-tia-for-gas/hyperlane-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
networks:
- id: "localwasm"
hrp: "wasm"
endpoint:
rpc: "http://127.0.0.1:36657"
rest: "http://127.0.0.1:1317"
grpc: "http://127.0.0.1:9290"
gas:
price: "0.025"
denom: "uwasm"
domain: 963
signer: "join always addict position jungle jeans bus govern crack huge photo purse famous live velvet virtual weekend hire cricket media dignity wait load mercy" # wasm133xh839fjn9wxzg6vhc0370lcem8939zr8uu45
- id: "stride-internal-1"
hrp: "stride"
endpoint:
rpc: "https://stride-testnet-rpc.polkachu.com"
rest: "https://stride-testnet-api.polkachu.com"
grpc: "http://stride-testnet-grpc.polkachu.com:12290"
gas:
price: "0.01"
denom: "ustrd"
domain: 1651
signer: "join always addict position jungle jeans bus govern crack huge photo purse famous live velvet virtual weekend hire cricket media dignity wait load mercy" # stride133xh839fjn9wxzg6vhc0370lcem8939z2sd4gn

# wasm133xh839fjn9wxzg6vhc0370lcem8939zr8uu45
# stride133xh839fjn9wxzg6vhc0370lcem8939z2sd4gn
signer: "join always addict position jungle jeans bus govern crack huge photo purse famous live velvet virtual weekend hire cricket media dignity wait load mercy"

deploy:
ism:
type: multisig
owner: <signer>
validators:
1651:
addrs:
- <signer>
threshold: 1
hooks:
default:
type: aggregate
owner: <signer>
hooks:
- type: merkle

- type: igp
owner: <signer>
configs:
1651:
exchange_rate: 1000
gas_price: 10000
default_gas_usage: 100000

required:
type: aggregate
owner: <signer>
hooks:
- type: pausable
owner: <signer>
paused: false

- type: fee
owner: <signer>
fee:
denom: uwasm
amount: 1
32 changes: 32 additions & 0 deletions guides/assets/hyperlane-use-tia-for-gas/relayer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"db": "/etc/data/db",
"relayChains": "localwasm,strideinternal1",
"allowLocalCheckpointSyncers": "true",
"gasPaymentEnforcement": [{ "type": "none" }],
"whitelist": [
{
"origindomain": [963],
"destinationDomain": [1651]
},
{
"origindomain": [1651],
"destinationDomain": [963]
}
],
"chains": {
"localwasm": {
"signer": {
"type": "cosmosKey",
"key": "0xf0517040b5669e2d93ffac3a3616187b14a19ad7a0657657e0f655d5eced9e31",
"prefix": "wasm"
}
},
"strideinternal1": {
"signer": {
"type": "cosmosKey",
"key": "0xf0517040b5669e2d93ffac3a3616187b14a19ad7a0657657e0f655d5eced9e31",
"prefix": "stride"
}
}
}
}
Loading
Loading