Skip to content

Commit

Permalink
entrypoint: move the unlock account logic to right after importing key (
Browse files Browse the repository at this point in the history
#388)

Current code does not re-calculate accountsCount after importing private key. As
a result, the unlock account logic is not triggered. This commit moves the unlock
logic earlier right after we import the key.
  • Loading branch information
minh-bq authored Dec 29, 2023
1 parent 5950f02 commit 477a800
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions docker/chainnode/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ if [[ ! -z $PRIVATE_KEY ]]; then
fi
rm ./private_key
unset PRIVATE_KEY

account=$(
ronin account list --datadir $datadir --keystore $KEYSTORE_DIR \
2> /dev/null \
| head -n 1 \
| cut -d"{" -f 2 | cut -d"}" -f 1
)
echo "Using account $account"
params="$params --unlock $account"

elif [[ "$mine" = "true" ]]; then
echo "Warning: A mining node is started without private key environment provided"
fi
Expand Down Expand Up @@ -200,17 +210,6 @@ if [[ "$ENABLE_FAST_FINALITY_SIGN" = "true" ]]; then
echo "Using BLS account $blsAccount"
fi

if [[ $accountsCount -gt 0 ]]; then
account=$(
ronin account list --datadir $datadir --keystore $KEYSTORE_DIR \
2> /dev/null \
| head -n 1 \
| cut -d"{" -f 2 | cut -d"}" -f 1
)
echo "Using account $account"
params="$params --unlock $account"
fi

# bootnodes
if [[ ! -z $BOOTNODES ]]; then
params="$params --bootnodes $BOOTNODES"
Expand Down

0 comments on commit 477a800

Please sign in to comment.