-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19473c7
commit 4501ac7
Showing
8 changed files
with
136 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package update | ||
|
||
import ( | ||
"github.com/pterm/pterm" | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/dymensionxyz/roller/utils/dependencies" | ||
servicemanager "github.com/dymensionxyz/roller/utils/service_manager" | ||
) | ||
|
||
const ( | ||
rpcEndpointFlag = "rpc-endpoint" | ||
metricsEndpointFlag = "metrics-endpoint" | ||
) | ||
|
||
func Cmd() *cobra.Command { | ||
runCmd := &cobra.Command{ | ||
Use: "update", | ||
Short: "Runs the DA light client.", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
pterm.Info.Println("stopping existing system services, if any...") | ||
err := servicemanager.StopSystemServices([]string{"da-light-client"}) | ||
if err != nil { | ||
pterm.Error.Println("failed to stop system services: ", err) | ||
return | ||
} | ||
|
||
dep := dependencies.DefaultCelestiaNodeDependency() | ||
err = dependencies.InstallBinaryFromRepo( | ||
dep, dep.DependencyName, | ||
) | ||
if err != nil { | ||
pterm.Error.Println("failed to install binary: ", err) | ||
return | ||
} | ||
|
||
pterm.Info.Println("stopping existing system services, if any...") | ||
err = servicemanager.Start([]string{"da-light-client"}) | ||
if err != nil { | ||
pterm.Error.Println("failed to stop system services: ", err) | ||
return | ||
} | ||
}, | ||
} | ||
|
||
addFlags(runCmd) | ||
return runCmd | ||
} | ||
|
||
func addFlags(cmd *cobra.Command) { | ||
cmd.Flags(). | ||
StringP(rpcEndpointFlag, "", "mocha-4-consensus.mesa.newmetric.xyz", "The DA rpc endpoint to connect to.") | ||
cmd.Flags(). | ||
StringP(metricsEndpointFlag, "", "", "The OTEL collector metrics endpoint to connect to.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,7 +191,6 @@ func EibcCmd() *cobra.Command { | |
) | ||
} | ||
}() | ||
|
||
}, | ||
} | ||
return cmd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package dependencies | ||
|
||
import ( | ||
"os/exec" | ||
|
||
"github.com/dymensionxyz/roller/cmd/consts" | ||
"github.com/dymensionxyz/roller/utils/dependencies/types" | ||
) | ||
|
||
const ( | ||
DefaultCelestiaNodeVersion = "v0.20.0-mocha" | ||
DefaultCelestiaAppVersion = "v2.3.1" | ||
) | ||
|
||
func DefaultCelestiaNodeDependency() types.Dependency { | ||
return types.Dependency{ | ||
DependencyName: "celestia", | ||
RepositoryOwner: "celestiaorg", | ||
RepositoryName: "celestia-node", | ||
RepositoryUrl: "https://github.com/celestiaorg/celestia-node.git", | ||
Release: DefaultCelestiaNodeVersion, | ||
Binaries: []types.BinaryPathPair{ | ||
{ | ||
Binary: "./build/celestia", | ||
BinaryDestination: consts.Executables.Celestia, | ||
BuildCommand: exec.Command( | ||
"make", | ||
"build", | ||
), | ||
}, | ||
{ | ||
Binary: "./cel-key", | ||
BinaryDestination: consts.Executables.CelKey, | ||
BuildCommand: exec.Command( | ||
"make", | ||
"cel-key", | ||
), | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters