-
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.
Run light client and sequencer works great
- Loading branch information
1 parent
513e5f1
commit 53602cb
Showing
17 changed files
with
318 additions
and
97 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
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
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 |
---|---|---|
@@ -1,13 +1,35 @@ | ||
package consts | ||
|
||
import "fmt" | ||
|
||
const binsDir = "/usr/local/bin" | ||
|
||
var internalBinsDir = fmt.Sprintf("%s/roller_bins", binsDir) | ||
|
||
var Executables = struct { | ||
Celestia string | ||
RollappEVM string | ||
Relayer string | ||
Dymension string | ||
CelKey string | ||
}{ | ||
Celestia: fmt.Sprintf("%s/celestia", internalBinsDir), | ||
CelKey: fmt.Sprintf("%s/cel-key", internalBinsDir), | ||
RollappEVM: fmt.Sprintf("%s/rollapp_evm", binsDir), | ||
Relayer: fmt.Sprintf("%s/rly", internalBinsDir), | ||
Dymension: fmt.Sprintf("%s/dymd", internalBinsDir), | ||
} | ||
|
||
var KeyNames = struct { | ||
HubSequencer string | ||
RollappSequencer string | ||
RollappRelayer string | ||
DALightNode string | ||
HubRelayer string | ||
}{ | ||
Celestia: "/usr/local/bin/roller_bins/celestia", | ||
RollappEVM: "/usr/local/bin/rollapp_evm", | ||
Relayer: "/usr/local/bin/roller_bins/rly", | ||
Dymension: "/usr/local/bin/roller_bins/dymd", | ||
HubSequencer: "hub_sequencer", | ||
RollappSequencer: "rollapp_sequencer", | ||
RollappRelayer: "relayer-rollapp-key", | ||
DALightNode: "my_celes_key", | ||
HubRelayer: "relayer-hub-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package da_light_client | ||
|
||
import ( | ||
da_start "github.com/dymensionxyz/roller/cmd/da-light-client/start" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func DALightClientCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "da-light-client", | ||
Short: "Commands for running and managing the data availability light client.", | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
}, | ||
} | ||
cmd.AddCommand(da_start.StartCmd()) | ||
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,49 @@ | ||
package start | ||
|
||
import ( | ||
"fmt" | ||
"os/exec" | ||
"path/filepath" | ||
|
||
initconfig "github.com/dymensionxyz/roller/cmd/config/init" | ||
"github.com/dymensionxyz/roller/cmd/consts" | ||
"github.com/dymensionxyz/roller/cmd/utils" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func StartCmd() *cobra.Command { | ||
runCmd := &cobra.Command{ | ||
Use: "start", | ||
Short: "Runs the rollapp sequencer.", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
home := cmd.Flag(utils.FlagNames.Home).Value.String() | ||
rollappConfig, err := initconfig.LoadConfigFromTOML(home) | ||
utils.PrettifyErrorIfExists(err) | ||
startRollappCmd := getCelestiaCmd(rollappConfig) | ||
utils.RunBashCmdAsync(startRollappCmd, printOutput, parseError) | ||
}, | ||
} | ||
utils.AddGlobalFlags(runCmd) | ||
return runCmd | ||
} | ||
|
||
func printOutput() { | ||
fmt.Println("π The data availability light node is running on your local machine!") | ||
fmt.Println("π Light node endpoint: http://0.0.0.0:26659") | ||
} | ||
|
||
func parseError(errMsg string) string { | ||
return errMsg | ||
} | ||
|
||
func getCelestiaCmd(rollappConfig initconfig.InitConfig) *exec.Cmd { | ||
return exec.Command( | ||
consts.Executables.Celestia, "light", "start", | ||
"--core.ip", "consensus-full-arabica-8.celestia-arabica.com", | ||
"--node.store", filepath.Join(rollappConfig.Home, initconfig.ConfigDirName.DALightNode), | ||
"--gateway", | ||
"--gateway.addr", "127.0.0.1", | ||
"--gateway.port", "26659", | ||
"--p2p.network", "arabica", | ||
) | ||
} |
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,15 @@ | ||
package sequencer | ||
|
||
import ( | ||
sequnecer_start "github.com/dymensionxyz/roller/cmd/sequencer/start" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func SequencerCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "sequencer", | ||
Short: "Commands for running and managing the RollApp sequnecer.", | ||
} | ||
cmd.AddCommand(sequnecer_start.StartCmd()) | ||
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
Oops, something went wrong.