From de0eaf7bdbe3aa37ae01f32c52d21bd503232342 Mon Sep 17 00:00:00 2001 From: Robert Martin-Legene <robert@nic.ar> Date: Mon, 30 Sep 2019 19:11:27 -0300 Subject: [PATCH] Moving genesis block creation back into libbfa.sh --- bin/generate-genesis-block.sh | 12 ------------ bin/libbfa.sh | 9 +++++++-- 2 files changed, 7 insertions(+), 14 deletions(-) delete mode 100755 bin/generate-genesis-block.sh diff --git a/bin/generate-genesis-block.sh b/bin/generate-genesis-block.sh deleted file mode 100755 index a5f3442..0000000 --- a/bin/generate-genesis-block.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -x -# Robert Martin-Legene <robert@nic.ar> - -if [ -z "${BFAHOME}" ]; then echo "\$BFAHOME not set. Did you source bfa/bin/env ?" >&2; exit 1; fi -source ${BFAHOME}/bin/libbfa.sh || exit 1 - -if [ -d "${BFANODEDIR}/geth/chaindata" ] -then - mkdir -p "${BFANODEDIR}" - echo "Node is not initialised. Initialising with genesis." - geth --config "${BFANETWORKDIR}/config.toml" --cache 0 init "${BFANETWORKDIR}/genesis.json" -fi diff --git a/bin/libbfa.sh b/bin/libbfa.sh index 2490830..9e4ed5e 100644 --- a/bin/libbfa.sh +++ b/bin/libbfa.sh @@ -192,8 +192,13 @@ function bfainit echo "Unknown socket type. Supported types are http, ws, ipc" >&2 exit 1 esac - # - generate-genesis-block.sh + # Init the blockchain with the genesis block + if [ -d "${BFANODEDIR}/geth/chaindata" ] + then + mkdir -p "${BFANODEDIR}" + echo "Node is not initialised. Initialising with genesis." + geth --config "${BFANETWORKDIR}/config.toml" --cache 0 init "${BFANETWORKDIR}/genesis.json" + fi } if [ -z "$SOURCED_BFAINIT_SH" ] -- GitLab