Skip to content
Snippets Groups Projects
Commit 80e6cae1 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Problemas general el genesis

parent 33f2043e
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash -x
# Robert Martin-Legene <robert@nic.ar> # Robert Martin-Legene <robert@nic.ar>
if [ -z "${BFAHOME}" ]; then echo "\$BFAHOME not set. Did you source bfa/bin/env ?" >&2; exit 1; fi 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 source ${BFAHOME}/bin/libbfa.sh || exit 1
if [ ! -d "${BFANODEDIR}" -o ! -d "${BFANODEDIR}/geth/chaindata" ] if [ -d "${BFANODEDIR}/geth/chaindata" ]
then then
mkdir -p "${BFANODEDIR}"
echo "Node is not initialised. Initialising with genesis." echo "Node is not initialised. Initialising with genesis."
geth --cache 0 --datadir "${BFANODEDIR}" --networkid ${BFANETWORKID} init "${BFANETWORKDIR}/genesis.json" geth --config "${BFANETWORKDIR}/config.toml" --cache 0 init "${BFANETWORKDIR}/genesis.json"
fi fi
...@@ -65,7 +65,6 @@ function geth_exec ...@@ -65,7 +65,6 @@ function geth_exec
geth_attach --exec "$1" </dev/null geth_attach --exec "$1" </dev/null
} }
rpc_counter=0
function geth_rpc function geth_rpc
{ {
local params= connectstring= cmd=$1 local params= connectstring= cmd=$1
...@@ -159,6 +158,7 @@ function contractSendTx ...@@ -159,6 +158,7 @@ function contractSendTx
function bfainit function bfainit
{ {
rpc_counter=0
############### ###############
# bfainit # # bfainit #
test -n "${BFAHOME}" -a \ test -n "${BFAHOME}" -a \
...@@ -175,10 +175,6 @@ function bfainit ...@@ -175,10 +175,6 @@ function bfainit
# #
# BFANODEDIR # BFANODEDIR
test -n "$BFANODEDIR" || BFANODEDIR="${BFANETWORKDIR}/node" test -n "$BFANODEDIR" || BFANODEDIR="${BFANETWORKDIR}/node"
if [ ! -d "${BFANODEDIR}" -o ! -d "${BFANODEDIR}/geth/chaindata" ]
then
generate-genesis-block.sh
fi
# #
# Default to IPC connections, because we have more geth modules available. # Default to IPC connections, because we have more geth modules available.
true ${BFASOCKETTYPE:=ipc} true ${BFASOCKETTYPE:=ipc}
...@@ -196,6 +192,8 @@ function bfainit ...@@ -196,6 +192,8 @@ function bfainit
echo "Unknown socket type. Supported types are http, ws, ipc" >&2 echo "Unknown socket type. Supported types are http, ws, ipc" >&2
exit 1 exit 1
esac esac
#
generate-genesis-block.sh
} }
if [ -z "$SOURCED_BFAINIT_SH" ] if [ -z "$SOURCED_BFAINIT_SH" ]
......
...@@ -88,7 +88,8 @@ PIDIDX[$!]="log.sh" ...@@ -88,7 +88,8 @@ PIDIDX[$!]="log.sh"
exec > ${LOGPIPE} 2>&1 exec > ${LOGPIPE} 2>&1
echo "*** Starting geth." echo "*** Starting geth."
geth --config ${BFATOML} --gcmode archive --allow-insecure-unlock & # "NoPruning=true" means "--gcmode archive"
geth --config ${BFATOML} &
PIDIDX[$!]="geth" PIDIDX[$!]="geth"
# bootnode # bootnode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment