Skip to content

Commit

Permalink
fix launch tool to specify the ibcfee version at chain link
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Oct 4, 2024
1 parent ab98308 commit 21699a1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contrib/launchtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ minitiad launch $TARGET_NETWORK --with-config [path-to-config]
"l1_config": {
"chain_id": "initiation-1",
"rpc_url": "https://rpc.initiation-1.initia.xyz:443",
"gas_prices": "0.15uinit"
"gas_prices": "0.015uinit"
},
"l2_config": {
"chain_id": "minitia-XDzNjd-1",
Expand Down
2 changes: 1 addition & 1 deletion contrib/launchtools/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (l1config *L1Config) Finalize(buf *bufio.Reader) error {
}

if l1config.GasPrices == "" {
l1config.GasPrices = "0.15uinit"
l1config.GasPrices = "0.015uinit"
}

_, err := sdk.ParseDecCoins(l1config.GasPrices)
Expand Down
27 changes: 24 additions & 3 deletions contrib/launchtools/steps/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import (
relayertypes "github.com/cosmos/relayer/v2/relayer"
relayerconfig "github.com/cosmos/relayer/v2/relayer/chains/cosmos"

ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"

"github.com/initia-labs/OPinit/contrib/launchtools"
)

Expand Down Expand Up @@ -238,18 +241,36 @@ func initializeRelayerKeyring(config *launchtools.Config) func(*Relayer) error {
// link creates a default transfer channel between the chains
// it does all the heavy lifting of creating the channel, connection, and client
func link(r *Relayer) error {
r.logger.Info("linking chains for relayer...")
versionBz, err := json.Marshal(ibcfeetypes.Metadata{
FeeVersion: ibcfeetypes.Version,
AppVersion: ibctransfertypes.Version,
})
if err != nil {
return err
}

r.logger.Info("linking chains for relayer...", "version", string(versionBz))
return r.run([]string{
"tx",
"link",
RelayerPathName,
"--version",
string(versionBz),
})
}

// linkWithports is the same as link, however ports are specified
func linkWithPorts(srcPort string, dstPort string, version string) func(*Relayer) error {
return func(r *Relayer) error {
r.logger.Info("linking chains for relayer...")
versionBz, err := json.Marshal(ibcfeetypes.Metadata{
FeeVersion: ibcfeetypes.Version,
AppVersion: version,
})
if err != nil {
return err
}

r.logger.Info("linking chains for relayer...", "version", string(versionBz))
return r.run([]string{
"tx",
"link",
Expand All @@ -259,7 +280,7 @@ func linkWithPorts(srcPort string, dstPort string, version string) func(*Relayer
"--dst-port",
dstPort,
"--version",
version,
string(versionBz),
})
}
}
Expand Down

0 comments on commit 21699a1

Please sign in to comment.