diff --git a/cmd/relayer/start/start.go b/cmd/relayer/start/start.go index 4b059733..41adb835 100644 --- a/cmd/relayer/start/start.go +++ b/cmd/relayer/start/start.go @@ -57,36 +57,47 @@ Consider using 'services' if you want to run a 'systemd' service instead. return } - // src is Hub, dst is RollApp - raChainID := rlyConfig.Paths.HubRollapp.Dst.ChainID - hubChainID := rlyConfig.Paths.HubRollapp.Src.ChainID - - _, hd, found := roller.FindHubDataByID(consts.Hubs, hubChainID) - if !found { - pterm.Error.Println("Hub Data not found for ", hubChainID) - runCustomHub, _ := pterm.DefaultInteractiveConfirm.WithDefaultText("would you like to provide custom hub?"). - WithDefaultValue(false). - Show() - - if !runCustomHub { - pterm.Error.Println("cancelled by user") - return - } + var hd consts.HubData + var raChainID string + var hubChainID string - chd, err := config.CreateCustomHubData() - if err != nil { - pterm.Error.Println("failed to create custom hub data:", err) - return - } - hd = consts.HubData{ - ApiUrl: chd.ApiUrl, - ID: chd.ID, - RpcUrl: chd.RpcUrl, - ArchiveRpcUrl: chd.RpcUrl, - GasPrice: chd.GasPrice, - DaNetwork: consts.CelestiaTestnet, + rollerConfig, err := roller.LoadConfig(home) + if err != nil { + // src is Hub, dst is RollApp + raChainID = rlyConfig.Paths.HubRollapp.Dst.ChainID + hubChainID = rlyConfig.Paths.HubRollapp.Src.ChainID + + var found bool + _, hd, found = roller.FindHubDataByID(consts.Hubs, hubChainID) + if !found { + pterm.Error.Println("Hub Data not found for ", hubChainID) + runCustomHub, _ := pterm.DefaultInteractiveConfirm.WithDefaultText("would you like to provide custom hub?"). + WithDefaultValue(false). + Show() + + if !runCustomHub { + pterm.Error.Println("cancelled by user") + return + } + + chd, err := config.CreateCustomHubData() + if err != nil { + pterm.Error.Println("failed to create custom hub data:", err) + return + } + hd = consts.HubData{ + ApiUrl: chd.ApiUrl, + ID: chd.ID, + RpcUrl: chd.RpcUrl, + ArchiveRpcUrl: chd.RpcUrl, + GasPrice: chd.GasPrice, + DaNetwork: consts.CelestiaTestnet, + } } - + } else { + hd = rollerConfig.HubData + raChainID = rlyConfig.Paths.HubRollapp.Dst.ChainID + hubChainID = rollerConfig.HubData.ID } raResponse, err := rollapp.GetMetadataFromChain(raChainID, hd) diff --git a/utils/archives/archives.go b/utils/archives/archives.go index d637d93c..29a90f7b 100644 --- a/utils/archives/archives.go +++ b/utils/archives/archives.go @@ -56,7 +56,7 @@ func ExtractTarGz(path string, data io.ReadCloser, dep dependencytypes.Dependenc for _, bin := range dep.Binaries { err := MoveBinaryIntoPlaceAndMakeExecutable( - path, + filepath.Join(path, bin.Binary), bin.BinaryDestination, ) if err != nil {