From 193e2c3612dd923cf55fc1e9b0845c2afb735c64 Mon Sep 17 00:00:00 2001 From: Robert Martin-Legene <robert@nic.ar> Date: Tue, 27 Apr 2021 15:50:42 +0000 Subject: [PATCH] Improving setup --- bin/monitor.js | 2 +- bin/start.sh | 25 ++++++++++++------------- network/config.localhost+full+archive | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 network/config.localhost+full+archive diff --git a/bin/monitor.js b/bin/monitor.js index 303af88..38acef3 100755 --- a/bin/monitor.js +++ b/bin/monitor.js @@ -154,7 +154,7 @@ function gotAdminPeers( err, nodelist ) writeStatus( nowpeers ); writePeersCache( newoutpeers.concat(peerscache) ); // Try to connect to a random node if we have very few peers - if ( nowpeers.length < 5 ) + if ( nowpeers.length < 1 ) { var candidate = []; // find candidate nodes which we can connect to diff --git a/bin/start.sh b/bin/start.sh index c7934af..5e56253 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -62,14 +62,14 @@ function startmonitor return fi local ERRTEXT="monitor section failed" - local pidfile=${BFANETWORKDIR}/monitor.pid + local pidfile=${BFANODEDIR}/monitor.pid ( flock --nonblock --exclusive 9 || ( echo "A monitor is already running." false ) || exit ( - echo ${BASHPID} > ${BFANETWORKDIR}/start-monitor-loop.pid + echo ${BASHPID} > ${BFANODEDIR}/start-monitor-loop.pid while : do monitor.js & @@ -155,7 +155,7 @@ function startgeth { # Start the node. local ERRTEXT="geth section failed" - local pidfile=${BFANETWORKDIR}/geth.pid + local pidfile=${BFANODEDIR}/geth.pid which geth >/dev/null 2>&1 || return 0 # ( @@ -167,11 +167,17 @@ function startgeth then echo Starting geth echo Logging everything to ${BFANODEDIR}/log - echo Consider running: bfalog.sh + if [ "$VIRTUALIZATION" = "DOCKER" ] + then + echo Consider running: docker logs --tail 100 -f '<containername>' + else + echo Consider running: bfa tail + fi fi loop_counter=0 ( - echo ${BASHPID} > ${BFANETWORKDIR}/start-geth-loop.pid + echo ${BASHPID} > ${BFANODEDIR}/start-geth-loop.pid + echo "*** Loop counter starting at $(( loop_counter + 1 ))" while : do loop_counter=$(( ${loop_counter} + 1 )) @@ -183,14 +189,7 @@ function startgeth echo geth_args set -x - geth \ - --datadir ${BFANODEDIR} \ - --networkid ${BFANETWORKID} \ - --rpc \ - --gcmode archive \ - ${flexargs} \ - --rpccorsdomain \* \ - --bootnodes "${bootnodes}" & + geth --config "${BFANETWORKDIR}/config.localhost+full+archive" & set +x echo $! > $pidfile rv=0 diff --git a/network/config.localhost+full+archive b/network/config.localhost+full+archive new file mode 100644 index 0000000..81ba2b0 --- /dev/null +++ b/network/config.localhost+full+archive @@ -0,0 +1,16 @@ +[Eth] +NetworkId = 47525974938 +SyncMode = "full" +NoPruning = true +DatabaseCache = 4096 + +[Node] +DataDir = "/home/bfa/bfa/network/node" +HTTPHost = "127.0.0.1" +HTTPCors = ["*"] +HTTPVirtualHosts = ["localhost"] +HTTPModules = ["eth", "net", "web3", "clique", "admin", "miner", "personal"] + +[Node.P2P] +BootstrapNodes = ["enode://7ec4dd9d5e1a2b29d6b60aa9f95677c0c3a5f9306e73d65dd3bcbfda3737a8c509b02d1eab763ce39f18cfe96423df7ee544d6c36191ec17f59ade75bc99d358@[2800:110:44:6300::aad2:2db3]:30301", "enode://7ec4dd9d5e1a2b29d6b60aa9f95677c0c3a5f9306e73d65dd3bcbfda3737a8c509b02d1eab763ce39f18cfe96423df7ee544d6c36191ec17f59ade75bc99d358@170.210.45.179:30301", "enode://82b66b13d7addcf9ffe1e4e972a105f6ccf50557161c4a0978a5d9ce595ababde609ea8a49897ae89b1d41e90551cb2e9241363238593e950ca68bd5af7c24d6@200.16.28.28:30301", "enode://ddbf37799e8d33b0c42dddbda713037b17d14696b29ecf424ca3d57bb47db78a467505e22c5f2b709a98c3d55ac8ecbf4610765385317dd51049438f498881c6@200.108.146.100:30301"] +BootstrapNodesV5 = ["enode://7ec4dd9d5e1a2b29d6b60aa9f95677c0c3a5f9306e73d65dd3bcbfda3737a8c509b02d1eab763ce39f18cfe96423df7ee544d6c36191ec17f59ade75bc99d358@[2800:110:44:6300::aad2:2db3]:30301", "enode://7ec4dd9d5e1a2b29d6b60aa9f95677c0c3a5f9306e73d65dd3bcbfda3737a8c509b02d1eab763ce39f18cfe96423df7ee544d6c36191ec17f59ade75bc99d358@170.210.45.179:30301", "enode://82b66b13d7addcf9ffe1e4e972a105f6ccf50557161c4a0978a5d9ce595ababde609ea8a49897ae89b1d41e90551cb2e9241363238593e950ca68bd5af7c24d6@200.16.28.28:30301", "enode://ddbf37799e8d33b0c42dddbda713037b17d14696b29ecf424ca3d57bb47db78a467505e22c5f2b709a98c3d55ac8ecbf4610765385317dd51049438f498881c6@200.108.146.100:30301"] -- GitLab