Skip to content

Commit

Permalink
feat: icon to archway/neutron start relay implementation (HugoByte#187)
Browse files Browse the repository at this point in the history
* test: add test scripts and functional tests for neutron chain, neutron-archway ibc, icon-neutron ibc

* refactor: change RunStarlarkPackage to RunStarlarkRemotePackage in neutron.go

* test: add functional tests for icon to neutron/archway ibc relay

* test: add functional tests for icon to neutron/archway running with custom configuration

* fix: fix icon to archway/neutron ibc fail

* fix: fix icon to neutron/archway ibc relay setup with custom icon chain fail

* feat: start relay between icon to neutron/archway chains
  • Loading branch information
abhiyana authored Oct 3, 2023
1 parent 05231b1 commit ce90d71
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cli/commands/bridge/relays/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,30 @@ func startIbcRelay(diveContext *common.DiveContext, enclaveContext *enclaves.Enc
}

}

if chainA == "icon" {
startIbcRelayIconToCosmos(diveContext, enclaveContext, common.RelayServiceNameIconToCosmos)
}

return starlarkExecutionResponse
}

func startIbcRelayIconToCosmos(diveContext *common.DiveContext, enclaveContext *enclaves.EnclaveContext, serviceName string) (string, error) {
params := fmt.Sprintf(`{"service_name": "%s"}`, serviceName)

executionData, _, err := enclaveContext.RunStarlarkRemotePackage(diveContext.Ctx, common.DiveRemotePackagePath, "services/bridges/ibc/src/bridge.star", "start_relay", params, false, 4, []kurtosis_core_rpc_api_bindings.KurtosisFeatureFlag{})

executionSerializedData, services, _, err := diveContext.GetSerializedData(executionData)

if err != nil {
diveContext.StopServices(services)
return "", err

}

return executionSerializedData, nil
}

func startCosmosChainsAndSetupIbcRelay(diveContext *common.DiveContext, enclaveCtx *enclaves.EnclaveContext, chains *Chains) (string, error) {

params := chains.getIbcRelayParams()
Expand Down
1 change: 1 addition & 0 deletions cli/common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
DiveArchwayNodeScript = "services/cosmvm/archway/src/node-setup/start_node.star"
DiveArchwayDefaultNodeScript = "services/cosmvm/archway/archway.star"
DiveNeutronNodeScript = "services/cosmvm/neutron/src/node-setup/start_node.star"
RelayServiceNameIconToCosmos = "ibc-relayer"
DiveNeutronDefaultNodeScript = "services/cosmvm/neutron/neutron.star"
DiveBridgeScript = "main.star"
DiveDryRun = false
Expand Down

0 comments on commit ce90d71

Please sign in to comment.