Skip to content

Commit

Permalink
fix: dependency installation (#1125)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs authored Nov 22, 2024
1 parent 72119fb commit eef355f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 29 deletions.
67 changes: 39 additions & 28 deletions cmd/relayer/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion utils/archives/archives.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit eef355f

Please sign in to comment.