Skip to content

Commit

Permalink
Merge pull request #2727 from manuelsc/nobids/fix_local
Browse files Browse the repository at this point in the history
(NOBIDS) fix local deployment elconfig
  • Loading branch information
manuelsc authored Nov 24, 2023
2 parents 91b2b05 + 6a5aab1 commit a75f1da
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ cmd/forkwatch
**/.DS_Store
_gitignore/
local-deployment/config.yml
local-deployment/elconfig.json
local-deployment/.env
3 changes: 2 additions & 1 deletion local-deployment/explorer-config-template.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
chain:
configPath: 'node'
clConfigPath: 'node'
elConfigPath: '' # Works for well known public networks like mainnet, prater, holesky, sepolia. Specify a file for custom chains
readerDatabase:
name: db
host: {{.DBHost}}
Expand Down
15 changes: 12 additions & 3 deletions local-deployment/provision-explorer-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@ POSTGRES_PORT=$POSTGRES_PORT
LBT_PORT=$LBT_PORT
EOF

touch elconfig.json
cat >elconfig.json <<EOL
{
"byzantiumBlock": 0,
"constantinopleBlock": 0
}
EOL

touch config.yml

cat >config.yml <<EOL
chain:
clConfigPath: 'node'
elConfigPath: 'local-deployment/elconfig.json'
readerDatabase:
name: db
host: 127.0.0.1
Expand Down Expand Up @@ -99,11 +108,11 @@ echo "initializing bigtable schema"
PROJECT="explorer"
INSTANCE="explorer"
HOST="127.0.0.1:$LBT_PORT"

go run ../cmd/misc/main.go -config config.yml -command initBigtableSchema
cd ..
go run ./cmd/misc/main.go -config local-deployment/config.yml -command initBigtableSchema

echo "bigtable schema initialization completed"

echo "provisioning postgres db schema"
go run ../cmd/misc/main.go -config config.yml -command applyDbSchema
go run ./cmd/misc/main.go -config local-deployment/config.yml -command applyDbSchema
echo "postgres db schema initialization completed"
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ func ReadConfig(cfg *types.Config, path string) error {
return fmt.Errorf("error opening EL Chain Config file %v: %w", cfg.Chain.ElConfigPath, err)
}
var chainConfig *params.ChainConfig
decoder := yaml.NewDecoder(f)
decoder := json.NewDecoder(f)
err = decoder.Decode(&chainConfig)
if err != nil {
return fmt.Errorf("error decoding EL Chain Config file %v: %v", cfg.Chain.ElConfigPath, err)
Expand Down

0 comments on commit a75f1da

Please sign in to comment.