Skip to content

Commit

Permalink
removed unnecessary config options & another fix for release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Jul 28, 2023
1 parent c270c91 commit 61afa75
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
## Latest automatically built executables. (Unstable development snapshot)
Built from master branch (commit: ${{ github.sha }})
Please read the [Operator Wiki](https://github.com/pk910/light-beaconchain-explorer/wiki/Operator-Wiki) for setup / configuration instructions.
Please read the [wiki](https://github.com/pk910/light-beaconchain-explorer/wiki) for setup / configuration instructions.
### Release Artifacts
| Release File | Description |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build version specific docker image
run: docker build . --file Dockerfile --tag pk910/light-beaconchain-explorer:v${{ github.event.release.tag_name }}
run: docker build . --file Dockerfile --tag pk910/light-beaconchain-explorer:${{ github.event.release.tag_name }}
- name: Push version specific docker image
run: docker push pk910/light-beaconchain-explorer:v${{ github.event.release.tag_name }}
run: docker push pk910/light-beaconchain-explorer:${{ github.event.release.tag_name }}
- name: Build latest docker image
run: docker build . --file Dockerfile --tag pk910/light-beaconchain-explorer:latest
- name: Push latest docker image
Expand Down
11 changes: 5 additions & 6 deletions types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ type Config struct {
} `yaml:"server"`

Chain struct {
Name string `yaml:"name" envconfig:"CHAIN_NAME"`
DisplayName string `yaml:"displayName" envconfig:"CHAIN_DISPLAY_NAME"`
GenesisTimestamp uint64 `yaml:"genesisTimestamp" envconfig:"CHAIN_GENESIS_TIMESTAMP"`
GenesisValidatorsRoot string `yaml:"genesisValidatorsRoot" envconfig:"CHAIN_GENESIS_VALIDATORS_ROOT"`
ConfigPath string `yaml:"configPath" envconfig:"CHAIN_CONFIG_PATH"`
Config ChainConfig
Name string `yaml:"name" envconfig:"CHAIN_NAME"`
DisplayName string `yaml:"displayName" envconfig:"CHAIN_DISPLAY_NAME"`
GenesisTimestamp uint64 `yaml:"genesisTimestamp" envconfig:"CHAIN_GENESIS_TIMESTAMP"`
ConfigPath string `yaml:"configPath" envconfig:"CHAIN_CONFIG_PATH"`
Config ChainConfig
} `yaml:"chain"`

Frontend struct {
Expand Down
16 changes: 1 addition & 15 deletions utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,12 @@ func ReadConfig(cfg *types.Config, path string) error {
case "sepolia":
cfg.Chain.GenesisTimestamp = 1655733600
default:
return fmt.Errorf("tried to set known genesis-timestamp, but unknown chain-name")
}
}

if cfg.Chain.GenesisValidatorsRoot == "" {
switch cfg.Chain.Name {
case "mainnet":
cfg.Chain.GenesisValidatorsRoot = "0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95"
case "prater":
cfg.Chain.GenesisValidatorsRoot = "0x043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb"
case "sepolia":
cfg.Chain.GenesisValidatorsRoot = "0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078"
default:
return fmt.Errorf("tried to set known genesis-validators-root, but unknown chain-name")
cfg.Chain.GenesisTimestamp = uint64(cfg.Chain.Config.MinGenesisTime) + cfg.Chain.Config.GenesisDelay
}
}

log.WithFields(log.Fields{
"genesisTimestamp": cfg.Chain.GenesisTimestamp,
"genesisValidatorsRoot": cfg.Chain.GenesisValidatorsRoot,
"configName": cfg.Chain.Config.ConfigName,
"depositChainID": cfg.Chain.Config.DepositChainID,
"depositNetworkID": cfg.Chain.Config.DepositNetworkID,
Expand Down

0 comments on commit 61afa75

Please sign in to comment.