Skip to content

Commit

Permalink
feat(evm-reader): Add input-reader retry policy
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoura committed Jul 9, 2024
1 parent d02a7ec commit cf24743
Show file tree
Hide file tree
Showing 20 changed files with 587 additions and 281 deletions.
18 changes: 18 additions & 0 deletions cmd/cartesi-rollups-cli/root/deps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const examples = `# Run all deps:
cartesi-rollups-cli run-deps`

var depsConfig = deps.NewDefaultDepsConfig()
var disablePostgres = false
var disableDevnet = false
var verbose = false

func init() {
Expand All @@ -42,6 +44,10 @@ func init() {
deps.DefaultPostgresPassword,
"Postgres password")

Cmd.Flags().StringVar(&depsConfig.Postgres.DataDir, "postrgres-data-dir",
deps.DefaultPostgresDataDir,
"Postgres local data dir")

Cmd.Flags().StringVar(&depsConfig.Devnet.DockerImage, "devnet-docker-image",
deps.DefaultDevnetDockerImage,
"Devnet docker image name")
Expand All @@ -58,6 +64,10 @@ func init() {
deps.DefaultDevnetNoMining,
"Devnet disable mining")

Cmd.Flags().BoolVar(&disablePostgres, "disable-postgres", false, "Disable Postgres")

Cmd.Flags().BoolVar(&disableDevnet, "disable-devnet", false, "Disable Devnet")

Cmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "verbose logs")
}

Expand All @@ -77,6 +87,14 @@ func run(cmd *cobra.Command, args []string) {
slog.SetDefault(logger)
}

if disablePostgres {
depsConfig.Postgres = nil
}

if disableDevnet {
depsConfig.Devnet = nil
}

depsContainers, err := deps.Run(ctx, *depsConfig)
cobra.CheckErr(err)

Expand Down
2 changes: 2 additions & 0 deletions docs/cli/cartesi-rollups-cli_run-deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ cartesi-rollups-cli run-deps
--devnet-docker-image string Devnet docker image name (default "cartesi/rollups-node-devnet:devel")
--devnet-mapped-port string Devnet local listening port number (default "8545")
--devnet-no-mining Devnet disable mining
--disable-devnet Disable Devnet
--disable-postgres Disable Postgres
-h, --help help for run-deps
--postgres-docker-image string Postgress docker image name (default "postgres:16-alpine")
--postgres-mapped-port string Postgres local listening port number (default "5432")
Expand Down
3 changes: 3 additions & 0 deletions internal/deps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
DefaultPostgresPort = "5432"
DefaultPostgresUser = "postgres"
DefaultPostgresPassword = "password"
DefaultPostgresDataDir = ""
DefaultDevnetDockerImage = "cartesi/rollups-node-devnet:devel"
DefaultDevnetPort = "8545"
DefaultDevnetBlockTime = "1"
Expand All @@ -48,6 +49,7 @@ type PostgresConfig struct {
DockerImage string
Port string
Password string
DataDir string
}

type DevnetConfig struct {
Expand All @@ -65,6 +67,7 @@ func NewDefaultDepsConfig() *DepsConfig {
DefaultPostgresDockerImage,
DefaultPostgresPort,
DefaultPostgresPassword,
DefaultPostgresDataDir,
},
&DevnetConfig{
DefaultDevnetDockerImage,
Expand Down
Loading

0 comments on commit cf24743

Please sign in to comment.