Allow network metadata without bootstrap nodes
This commit is contained in:
parent
f4c19e303a
commit
6ccfff7d58
|
@ -97,6 +97,7 @@ proc loadEth2NetworkMetadata*(path: string): Eth2NetworkMetadata
|
||||||
configPath = path / "config.yaml"
|
configPath = path / "config.yaml"
|
||||||
depositContractPath = path / "deposit_contract.txt"
|
depositContractPath = path / "deposit_contract.txt"
|
||||||
depositContractBlockPath = path / "deposit_contract_block.txt"
|
depositContractBlockPath = path / "deposit_contract_block.txt"
|
||||||
|
bootstrapNodesPath = path / "bootstrap_nodes.txt"
|
||||||
|
|
||||||
runtimePreset = if fileExists(configPath):
|
runtimePreset = if fileExists(configPath):
|
||||||
extractRuntimePreset(configPath, readPresetFile(configPath))
|
extractRuntimePreset(configPath, readPresetFile(configPath))
|
||||||
|
@ -113,6 +114,11 @@ proc loadEth2NetworkMetadata*(path: string): Eth2NetworkMetadata
|
||||||
else:
|
else:
|
||||||
default(Eth1BlockHash)
|
default(Eth1BlockHash)
|
||||||
|
|
||||||
|
bootstrapNodes = if fileExists(bootstrapNodesPath):
|
||||||
|
readFile(bootstrapNodesPath).splitLines()
|
||||||
|
else:
|
||||||
|
@[]
|
||||||
|
|
||||||
genesisData = if fileExists(genesisPath): readFile(genesisPath)
|
genesisData = if fileExists(genesisPath): readFile(genesisPath)
|
||||||
else: ""
|
else: ""
|
||||||
|
|
||||||
|
@ -120,7 +126,7 @@ proc loadEth2NetworkMetadata*(path: string): Eth2NetworkMetadata
|
||||||
incompatible: false,
|
incompatible: false,
|
||||||
eth1Network: some goerli,
|
eth1Network: some goerli,
|
||||||
runtimePreset: runtimePreset,
|
runtimePreset: runtimePreset,
|
||||||
bootstrapNodes: readFile(path / "bootstrap_nodes.txt").splitLines(),
|
bootstrapNodes: bootstrapNodes,
|
||||||
depositContractAddress: depositContractAddress,
|
depositContractAddress: depositContractAddress,
|
||||||
depositContractDeployedAt: depositContractBlock,
|
depositContractDeployedAt: depositContractBlock,
|
||||||
genesisData: genesisData)
|
genesisData: genesisData)
|
||||||
|
|
Loading…
Reference in New Issue