Skip to content

Commit

Permalink
fix(mock): install only rollapp binary for mock (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs authored Sep 20, 2024
1 parent 5d5b923 commit 7f736a4
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 60 deletions.
54 changes: 29 additions & 25 deletions cmd/rollapp/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,29 @@ func Cmd() *cobra.Command {
fmt.Println(home)
// TODO: move to consts
// TODO(v2): move to roller config
dymdBinaryOptions := types.Dependency{
Name: "dymension",
Repository: "https://github.com/artemijspavlovs/dymension",
Release: "v3.1.0-pg07",
Binaries: []types.BinaryPathPair{
{
Binary: "dymd",
BinaryDestination: consts.Executables.Dymension,
BuildCommand: exec.Command(
"make",
"build",
),
if !shouldUseMockBackend {
dymdBinaryOptions := types.Dependency{
Name: "dymension",
Repository: "https://github.com/artemijspavlovs/dymension",
Release: "v3.1.0-pg07",
Binaries: []types.BinaryPathPair{
{
Binary: "dymd",
BinaryDestination: consts.Executables.Dymension,
BuildCommand: exec.Command(
"make",
"build",
),
},
},
},
}
}
pterm.Info.Println("installing dependencies")
err = dependencies.InstallBinaryFromRelease(dymdBinaryOptions)
if err != nil {
pterm.Error.Println("failed to install dymd: ", err)
return
}

pterm.Info.Println("installing dependencies")
err = dependencies.InstallBinaryFromRelease(dymdBinaryOptions)
if err != nil {
pterm.Error.Println("failed to install dymd: ", err)
return
}

var hd consts.HubData
Expand Down Expand Up @@ -98,19 +100,21 @@ func Cmd() *cobra.Command {
WithDefaultText("select the rollapp VM type you want to initialize for").
WithOptions(vmtypes).
Show()
err = dependencies.InstallBinaries(home, true, rollapp.ShowRollappResponse{})
raRespMock := rollapp.ShowRollappResponse{
Rollapp: rollapp.Rollapp{
RollappId: raID,
VmType: vmtype,
},
}
err = dependencies.InstallBinaries(home, true, raRespMock)
if err != nil {
pterm.Error.Println("failed to install binaries: ", err)
return
}
err := runInit(
cmd,
env,
rollapp.ShowRollappResponse{
Rollapp: rollapp.Rollapp{
VmType: vmtype,
},
},
raRespMock,
)
if err != nil {
fmt.Println("failed to run init: ", err)
Expand Down
77 changes: 42 additions & 35 deletions utils/dependencies/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,44 +130,52 @@ func InstallBinaries(
}
}

goreleaserDeps := map[string]types.Dependency{
"celestia-app": {
Name: "celestia-app",
Repository: "https://github.com/celestiaorg/celestia-app",
Release: "v2.1.2",
Binaries: []types.BinaryPathPair{
{
Binary: "celestia-appd",
BinaryDestination: consts.Executables.CelestiaApp,
BuildCommand: exec.Command(
"make",
"build",
),
goreleaserDeps := map[string]types.Dependency{}

if !withMockDA {
necessaryDeps := map[string]types.Dependency{
"celestia-app": {
Name: "celestia-app",
Repository: "https://github.com/celestiaorg/celestia-app",
Release: "v2.1.2",
Binaries: []types.BinaryPathPair{
{
Binary: "celestia-appd",
BinaryDestination: consts.Executables.CelestiaApp,
BuildCommand: exec.Command(
"make",
"build",
),
},
},
},
},
"eibc-client": {
Name: "eibc-client",
Repository: "https://github.com/artemijspavlovs/eibc-client",
Release: "v1.1.4-roller",
Binaries: []types.BinaryPathPair{
{
Binary: "eibc-client",
BinaryDestination: consts.Executables.Eibc,
"eibc-client": {
Name: "eibc-client",
Repository: "https://github.com/artemijspavlovs/eibc-client",
Release: "v1.1.4-roller",
Binaries: []types.BinaryPathPair{
{
Binary: "eibc-client",
BinaryDestination: consts.Executables.Eibc,
},
},
},
},
"rly": {
Name: "go-relayer",
Repository: "https://github.com/artemijspavlovs/go-relayer",
Release: "v0.4.0-v2.5.2-relayer-pg-roller",
Binaries: []types.BinaryPathPair{
{
Binary: "rly",
BinaryDestination: consts.Executables.Relayer,
"rly": {
Name: "go-relayer",
Repository: "https://github.com/artemijspavlovs/go-relayer",
Release: "v0.4.0-v2.5.2-relayer-pg-roller",
Binaries: []types.BinaryPathPair{
{
Binary: "rly",
BinaryDestination: consts.Executables.Relayer,
},
},
},
},
}

for s, dependency := range necessaryDeps {
goreleaserDeps[s] = dependency
}
}

if withMockDA {
Expand Down Expand Up @@ -212,7 +220,7 @@ func InstallBinaries(
goreleaserDeps["rollapp"] = types.Dependency{
Name: "rollapp-evm",
Repository: "https://github.com/artemijspavlovs/rollapp-evm",
Release: "v2.3.4-pg-roller",
Release: "v2.3.4-pg-roller-02",
Binaries: []types.BinaryPathPair{
{
Binary: "rollappd",
Expand All @@ -224,7 +232,7 @@ func InstallBinaries(
goreleaserDeps["rollapp"] = types.Dependency{
Name: "rollapp-wasm",
Repository: "https://github.com/artemijspavlovs/rollapp-wasm",
Release: "v1.0.0-rc04-roller-03",
Release: "v1.0.0-rc04-roller-07",
Binaries: []types.BinaryPathPair{
{
Binary: "rollappd",
Expand All @@ -236,7 +244,6 @@ func InstallBinaries(

}

//
for k, dep := range goreleaserDeps {
err := InstallBinaryFromRelease(dep)
if err != nil {
Expand Down

0 comments on commit 7f736a4

Please sign in to comment.