Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

entrypoint: move the unlock account logic to right after importing key #388

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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