Add flag to explicitly enable state network (#2031)

This commit is contained in:
Daniel Sobol 2024-02-17 01:38:58 +03:00 committed by GitHub
parent bea558740f
commit 2766e20179
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 6 deletions

View File

@ -1,5 +1,5 @@
# Fluffy
# Copyright (c) 2021-2023 Status Research & Development GmbH
# Copyright (c) 2021-2024 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -246,6 +246,12 @@ type
defaultValueDesc: $defaultDisablePoke
name: "disable-poke" .}: bool
stateNetworkEnabled* {.
hidden
desc: "Enable State Network"
defaultValue: false
name: "state" .}: bool
case cmd* {.
command
defaultValue: noCommand .}: PortalCmd

View File

@ -166,10 +166,14 @@ proc run(config: PortalConf) {.raises: [CatchableError].} =
)
streamManager = StreamManager.new(d)
stateNetwork = Opt.some(StateNetwork.new(
d, db, streamManager,
bootstrapRecords = bootstrapRecords,
portalConfig = portalConfig))
stateNetwork =
if config.stateNetworkEnabled:
Opt.some(StateNetwork.new(
d, db, streamManager,
bootstrapRecords = bootstrapRecords,
portalConfig = portalConfig))
else:
Opt.none(StateNetwork)
accumulator =
# Building an accumulator from header epoch files takes > 2m30s and is

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2023 Status Research & Development GmbH. Licensed under
# Copyright (c) 2021-2024 Status Research & Development GmbH. Licensed under
# either of:
# - Apache License, version 2.0
# - MIT license
@ -315,6 +315,7 @@ for NUM_NODE in $(seq 0 $(( NUM_NODES - 1 ))); do
--table-ip-limit=1024 \
--bucket-ip-limit=24 \
--bits-per-hop=1 \
--state=1 \
${TRUSTED_BLOCK_ROOT_ARG} \
${RADIUS_ARG} \
${EXTRA_ARGS} \