Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Fixed local dev environment (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
begmaroman authored Jan 30, 2024
1 parent 3fc64fd commit 6fc8017
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 34 deletions.
12 changes: 6 additions & 6 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func Load(ctx *cli.Context) (*Config, error) {
if err != nil {
return nil, err
}

configFilePath := ctx.String(FlagCfg)
if configFilePath != "" {
dirName, fileName := filepath.Split(configFilePath)
Expand All @@ -63,14 +64,13 @@ func Load(ctx *cli.Context) (*Config, error) {
viper.SetConfigName(fileNameWithoutExtension)
viper.SetConfigType(fileExtension)
}

viper.AutomaticEnv()
replacer := strings.NewReplacer(".", "_")
viper.SetEnvKeyReplacer(replacer)
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.SetEnvPrefix("DATA_NODE")
err = viper.ReadInConfig()
if err != nil {
_, ok := err.(viper.ConfigFileNotFoundError)
if ok {

if err = viper.ReadInConfig(); err != nil {
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
log.Infof("config file not found")
} else {
log.Infof("error reading config file: ", err)
Expand Down
55 changes: 28 additions & 27 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,46 @@ import (
// DefaultValues is the default configuration
const DefaultValues = `
[FullNodeRPCs]
1 = "http://zkevm-node:8123"
1 = "http://zkevm-node:8123"
[RPC]
Host = "0.0.0.0"
Port = 4444
ReadTimeout = "60s"
WriteTimeout = "60s"
MaxRequestsPerIPAndSecond = 5000
Host = "0.0.0.0"
Port = 4444
ReadTimeout = "60s"
WriteTimeout = "60s"
MaxRequestsPerIPAndSecond = 5000
[Log]
Environment = "development" # "production" or "development"
Level = "debug"
Outputs = ["stderr"]
Environment = "development" # "production" or "development"
Level = "debug"
Outputs = ["stderr"]
[DB]
User = "agglayer_user"
Password = "agglayer_password"
Name = "agglayer_db"
Host = "agglayer-db"
Port = "5432"
EnableLog = false
MaxConns = 200
User = "agglayer_user"
Password = "agglayer_password"
Name = "agglayer_db"
Host = "agglayer-db"
Port = "5432"
EnableLog = false
MaxConns = 200
[EthTxManager]
FrequencyToMonitorTxs = "1s"
WaitTxToBeMined = "2m"
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
PrivateKeys = [
{Path = "/pk/interop.keystore", Password = "testonly"},
]
FrequencyToMonitorTxs = "1s"
WaitTxToBeMined = "2m"
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
PrivateKeys = [
{Path = "/pk/agglayer.keystore", Password = "testonly"},
]
[L1]
ChainID = 1337
NodeURL = "http://l1:8545"
ChainID = 1337
NodeURL = "http://l1:8545"
RollupManagerContract = "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" # v0.0.4
[Telemetry]
PrometheusAddr = "0.0.0.0:2223"
PrometheusAddr = "0.0.0.0:2223"
`

// Default parses the default configuration values.
Expand Down
1 change: 1 addition & 0 deletions docker/data/agglayer/agglayer.keystore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":3,"id":"71b028b6-9b1d-4f4c-9e66-31c94a6eb679","address":"70997970c51812dc3a010c7d01b50e0d17dc79c8","crypto":{"ciphertext":"985d5dc5f7750fc4ad0ad0d370486870016bb97e00ef1f7b146d6ad95d456861","cipherparams":{"iv":"f51b18b9f45872f71c3578513fca6cb0"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"6253e2d8a71e4808dd11143329cfea467cabb37ac1e1e55dbc0dd90ff22524a7","n":8192,"r":8,"p":1},"mac":"922f741e84201fc7c17bbf9fae5dba6c04a2a99a7268998b5a0268aa690004be"}}
41 changes: 41 additions & 0 deletions docker/data/agglayer/agglayer.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[FullNodeRPCs]
1 = "http://zkevm-node:8123"

[RPC]
Host = "0.0.0.0"
Port = 4444
ReadTimeout = "60s"
WriteTimeout = "60s"
MaxRequestsPerIPAndSecond = 5000

[Log]
Environment = "development" # "production" or "development"
Level = "debug"
Outputs = ["stderr"]

[DB]
User = "agglayer_user"
Password = "agglayer_password"
Name = "agglayer_db"
Host = "agglayer-db"
Port = "5432"
EnableLog = false
MaxConns = 200

[EthTxManager]
FrequencyToMonitorTxs = "1s"
WaitTxToBeMined = "2m"
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
PrivateKeys = [
{Path = "/pk/agglayer.keystore", Password = "testonly"},
]

[L1]
ChainID = 1337
NodeURL = "http://l1:8545"
RollupManagerContract = "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" # v0.0.4

[Telemetry]
PrometheusAddr = "0.0.0.0:2223"
4 changes: 3 additions & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.9'
services:
l1:
container_name: l1
image: hermeznetwork/geth-cdk-validium-contracts:v0.0.2
image: hermeznetwork/geth-cdk-validium-contracts:v0.0.4
command: [
"--http",
"--http.api", "admin,eth,debug,miner,net,txpool,personal,web3",
Expand Down Expand Up @@ -77,6 +77,8 @@ services:
ports:
- '50061:50061' # MT
- '50071:50071' # Executor
environment:
EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU: 1
volumes:
- ./data/zkevm/prover.json:/usr/src/app/config.json
networks:
Expand Down

0 comments on commit 6fc8017

Please sign in to comment.