Make the deposit contract metadata file optional

This commit is contained in:
Zahary Karadjov 2019-10-29 02:27:13 +02:00
parent 734ab64da8
commit b244f35731
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
3 changed files with 9 additions and 9 deletions

View File

@ -48,24 +48,26 @@ cli do (testnetName {.argument.}: string):
quit 1
checkRequiredFile bootstrapFile
checkRequiredFile depositContractFile
checkRequiredFile genesisFile
var preset = testnetDir / configFile
if not fileExists(preset): preset = "minimal"
let
depositContract = readFile(testnetDir / depositContractFile).strip
dataDirName = testnetName.replace("/", "_")
dataDir = buildDir / "data" / dataDirName
beaconNodeBinary = buildDir / "beacon_node_" & dataDirName
nimFlags = "-d:release --lineTrace:on -d:chronicles_log_level=DEBUG"
var depositContractOpt = ""
let depositContractFile = testnetDir / depositContractFile
if fileExists(depositContractFile):
depositContractOpt = "--deposit-contract=" & readFile(depositContractFile).strip
cd rootDir
exec &"""nim c {nimFlags} -d:"const_preset={preset}" -o:"{beaconNodeBinary}" beacon_chain/beacon_node.nim"""
exec replace(&"""{beaconNodeBinary}
--data-dir="{dataDir}"
--bootstrap-file="{testnetDir/bootstrapFile}"
--state-snapshot="{testnetDir/genesisFile}"
--deposit-contract={depositContract}""", "\n", " ")
--state-snapshot="{testnetDir/genesisFile}" """ & depositContractOpt, "\n", " ")

View File

@ -1,10 +1,9 @@
CONST_PRESET=minimal
NETWORK_ID=10
NETWORK_TYPE=rlpx
NETWORK_TYPE=libp2p_daemon
SHARD_COUNT=16
SLOTS_PER_EPOCH=16
SECONDS_PER_SLOT=30
VALIDATOR_COUNT=1000
LAST_USER_VALIDATOR=199
BOOTSTRAP_PORT=9000
WEB3_URL=wss://goerli.infura.io/ws/v3/809a18497dd74102b5f37d25aae3c85a

View File

@ -1,6 +1,5 @@
CONST_PRESET=minimal
NETWORK_ID=20
NETWORK_TYPE=libp2p
NETWORK_TYPE=libp2p_daemon
SHARD_COUNT=8
SLOTS_PER_EPOCH=8
SECONDS_PER_SLOT=6