|
@@ -4,28 +4,39 @@ set -e
|
|
SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
|
|
SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
|
|
cd $SCRIPT_PATH
|
|
cd $SCRIPT_PATH
|
|
|
|
|
|
|
|
+# Log only to stderr
|
|
|
|
+# Only output from this script should be the container id of the node at the very end
|
|
|
|
+
|
|
# Location that will be mounted as the /data volume in containers
|
|
# Location that will be mounted as the /data volume in containers
|
|
# This is where the initial members and balances files and generated chainspec files will be located.
|
|
# This is where the initial members and balances files and generated chainspec files will be located.
|
|
DATA_PATH=${DATA_PATH:=$(pwd)/data}
|
|
DATA_PATH=${DATA_PATH:=$(pwd)/data}
|
|
mkdir -p ${DATA_PATH}
|
|
mkdir -p ${DATA_PATH}
|
|
|
|
|
|
# Initial account balance for sudo account
|
|
# Initial account balance for sudo account
|
|
-# Will be the source of funds for all new accounts that are created in the tests.
|
|
|
|
SUDO_INITIAL_BALANCE=${SUDO_INITIAL_BALANCE:=100000000}
|
|
SUDO_INITIAL_BALANCE=${SUDO_INITIAL_BALANCE:=100000000}
|
|
SUDO_ACCOUNT_URI=${SUDO_ACCOUNT_URI:="//Alice"}
|
|
SUDO_ACCOUNT_URI=${SUDO_ACCOUNT_URI:="//Alice"}
|
|
SUDO_ACCOUNT=$(docker run --rm --pull=always docker.io/parity/subkey:2.0.1 inspect ${SUDO_ACCOUNT_URI} --output-type json | jq .ss58Address -r)
|
|
SUDO_ACCOUNT=$(docker run --rm --pull=always docker.io/parity/subkey:2.0.1 inspect ${SUDO_ACCOUNT_URI} --output-type json | jq .ss58Address -r)
|
|
|
|
|
|
|
|
+# Source of funds for all new accounts that are created in the tests.
|
|
|
|
+TREASURY_INITIAL_BALANCE=${TREASURY_INITIAL_BALANCE:=100000000}
|
|
|
|
+TREASURY_ACCOUNT_URI=${TREASURY_ACCOUNT_URI:=$SUDO_ACCOUNT_URI}
|
|
|
|
+TREASURY_ACCOUNT=$(docker run --rm --pull=always docker.io/parity/subkey:2.0.1 inspect ${TREASURY_ACCOUNT_URI} --output-type json | jq .ss58Address -r)
|
|
|
|
+
|
|
>&2 echo "sudo account from suri: ${SUDO_ACCOUNT}"
|
|
>&2 echo "sudo account from suri: ${SUDO_ACCOUNT}"
|
|
|
|
+>&2 echo "treasury account from suri: ${TREASURY_ACCOUNT}"
|
|
|
|
|
|
# The docker image tag to use for joystream/node
|
|
# The docker image tag to use for joystream/node
|
|
RUNTIME=${RUNTIME:=latest}
|
|
RUNTIME=${RUNTIME:=latest}
|
|
|
|
|
|
echo "{
|
|
echo "{
|
|
\"balances\":[
|
|
\"balances\":[
|
|
- [\"$SUDO_ACCOUNT\", $SUDO_INITIAL_BALANCE]
|
|
|
|
|
|
+ [\"$SUDO_ACCOUNT\", $SUDO_INITIAL_BALANCE],
|
|
|
|
+ [\"$TREASURY_ACCOUNT\", $TREASURY_INITIAL_BALANCE]
|
|
]
|
|
]
|
|
}" > ${DATA_PATH}/initial-balances.json
|
|
}" > ${DATA_PATH}/initial-balances.json
|
|
|
|
|
|
|
|
+# Remember if there are initial members at genesis query-node needs to be bootstrapped
|
|
|
|
+# or any events processed for this member will cause processor to fail.
|
|
if [ "${MAKE_SUDO_MEMBER}" == true ]
|
|
if [ "${MAKE_SUDO_MEMBER}" == true ]
|
|
then
|
|
then
|
|
echo "
|
|
echo "
|