Switch to a two-steps build process (#228)
This commit is contained in:
parent
8107297f2e
commit
e16d8faee2
4
Makefile
4
Makefile
|
@ -45,13 +45,13 @@ clean-testnet0:
|
||||||
rm -rf ~/.cache/nimbus/BeaconNode/testnet0
|
rm -rf ~/.cache/nimbus/BeaconNode/testnet0
|
||||||
|
|
||||||
testnet0: | build deps
|
testnet0: | build deps
|
||||||
../../env.sh scripts/connect_to_testnet.sh testnet0
|
../../env.sh scripts/build_testnet_node.sh testnet0
|
||||||
|
|
||||||
clean-testnet1:
|
clean-testnet1:
|
||||||
rm -rf ~/.cache/nimbus/BeaconNode/testnet1
|
rm -rf ~/.cache/nimbus/BeaconNode/testnet1
|
||||||
|
|
||||||
testnet1: | build deps
|
testnet1: | build deps
|
||||||
../../env.sh scripts/connect_to_testnet.sh testnet1
|
../../env.sh scripts/build_testnet_node.sh testnet1
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build/* nimcache
|
rm -rf build/* nimcache
|
||||||
|
|
|
@ -7,7 +7,7 @@ export
|
||||||
defs
|
defs
|
||||||
|
|
||||||
const
|
const
|
||||||
defaultPort* = 9000
|
DEFAULT_NETWORK* {.strdefine.} = "testnet0"
|
||||||
|
|
||||||
type
|
type
|
||||||
ValidatorKeyPath* = TypedInputFile[ValidatorPrivKey, Txt, "privkey"]
|
ValidatorKeyPath* = TypedInputFile[ValidatorPrivKey, Txt, "privkey"]
|
||||||
|
@ -28,7 +28,7 @@ type
|
||||||
"Possible values: testnet0, testnet1, mainnet, custom-network.json"
|
"Possible values: testnet0, testnet1, mainnet, custom-network.json"
|
||||||
longform: "network"
|
longform: "network"
|
||||||
shortform: "n"
|
shortform: "n"
|
||||||
defaultValue: "testnet0".}: string
|
defaultValue: DEFAULT_NETWORK .}: string
|
||||||
|
|
||||||
dataDir* {.
|
dataDir* {.
|
||||||
desc: "The directory where nimbus will store all blockchain data."
|
desc: "The directory where nimbus will store all blockchain data."
|
||||||
|
@ -52,11 +52,11 @@ type
|
||||||
|
|
||||||
tcpPort* {.
|
tcpPort* {.
|
||||||
desc: "TCP listening port"
|
desc: "TCP listening port"
|
||||||
defaultValue: defaultPort .}: int
|
defaultValue: defaultPort(config) .}: int
|
||||||
|
|
||||||
udpPort* {.
|
udpPort* {.
|
||||||
desc: "UDP listening port",
|
desc: "UDP listening port",
|
||||||
defaultValue: defaultPort .}: int
|
defaultValue: defaultPort(config) .}: int
|
||||||
|
|
||||||
nat* {.
|
nat* {.
|
||||||
desc: "Specify method to use for determining public address. Must be one of: any, extip:<IP>"
|
desc: "Specify method to use for determining public address. Must be one of: any, extip:<IP>"
|
||||||
|
@ -102,7 +102,7 @@ type
|
||||||
|
|
||||||
bootstrapPort* {.
|
bootstrapPort* {.
|
||||||
desc: "The TCP/UDP port that will be used by the bootstrap node"
|
desc: "The TCP/UDP port that will be used by the bootstrap node"
|
||||||
defaultValue: defaultPort .}: int
|
defaultValue: defaultPort(config) .}: int
|
||||||
|
|
||||||
genesisOffset* {.
|
genesisOffset* {.
|
||||||
desc: "Seconds from now to add to genesis time"
|
desc: "Seconds from now to add to genesis time"
|
||||||
|
@ -123,6 +123,10 @@ type
|
||||||
of updateTestnet:
|
of updateTestnet:
|
||||||
discard
|
discard
|
||||||
|
|
||||||
|
proc defaultPort*(config: BeaconNodeConf): int =
|
||||||
|
if config.network == "testnet1": 9100
|
||||||
|
else: 9000
|
||||||
|
|
||||||
proc defaultDataDir*(conf: BeaconNodeConf): string =
|
proc defaultDataDir*(conf: BeaconNodeConf): string =
|
||||||
let dataDir = when defined(windows):
|
let dataDir = when defined(windows):
|
||||||
"AppData" / "Roaming" / "Nimbus"
|
"AppData" / "Roaming" / "Nimbus"
|
||||||
|
|
|
@ -12,7 +12,7 @@ source "$NETWORK_NAME.env"
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
NIM_FLAGS="-d:release --lineTrace:on -d:chronicles_log_level=DEBUG -d:SECONDS_PER_SLOT=$SECONDS_PER_SLOT -d:SHARD_COUNT=$SHARD_COUNT -d:SLOTS_PER_EPOCH=$SLOTS_PER_EPOCH --hints:off --verbosity:0"
|
NIM_FLAGS="-d:release --lineTrace:on -d:chronicles_log_level=DEBUG -d:SECONDS_PER_SLOT=$SECONDS_PER_SLOT -d:SHARD_COUNT=$SHARD_COUNT -d:SLOTS_PER_EPOCH=$SLOTS_PER_EPOCH -d:DEFAULT_NETWORK=$NETWORK_NAME --hints:off --verbosity:0"
|
||||||
|
|
||||||
BEACON_NODE_BIN="build/${NETWORK_NAME}_node"
|
BEACON_NODE_BIN="build/${NETWORK_NAME}_node"
|
||||||
|
|
||||||
|
@ -24,5 +24,8 @@ if [ ! -d ~/.cache/nimbus/BeaconNode/${NETWORK_NAME}/validators ]; then
|
||||||
$BEACON_NODE_BIN --network=$NETWORK_NAME importValidator
|
$BEACON_NODE_BIN --network=$NETWORK_NAME importValidator
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$BEACON_NODE_BIN --network=$NETWORK_NAME --tcpPort:$BOOTSTRAP_PORT --udpPort:$BOOTSTRAP_PORT
|
echo
|
||||||
|
echo "A binary for connecting to $NETWORK_NAME was placed in '$BEACON_NODE_BIN'"
|
||||||
|
echo "To sync with the network, launch it with default parameters"
|
||||||
|
echo
|
||||||
|
|
Loading…
Reference in New Issue