diff --git a/client/protocol_versions.json b/client/protocol_versions.json index 6f2326201..c6dd5b7e6 100644 --- a/client/protocol_versions.json +++ b/client/protocol_versions.json @@ -158,5 +158,8 @@ }, "1.5.0": { "min": "1.0.0" + }, + "1.5.1": { + "min": "1.0.0" } } \ No newline at end of file diff --git a/config_client_api_ip_whitelist.sh b/config_client_api_ip_whitelist.sh index 85a0781de..65a27f4b6 100644 --- a/config_client_api_ip_whitelist.sh +++ b/config_client_api_ip_whitelist.sh @@ -2,16 +2,16 @@ function usage() { printf "\n" - printf "Usage: bash config_client_api_ip_whitelist.sh [dev|staging|sandbox|exp|spring|summer|mainnet] [get|add|remove] []\n" - printf "Example: bash config_client_api_ip_whitelist.sh dev get\n" - printf "Example: bash config_client_api_ip_whitelist.sh dev add 32.190.239.181\n" - printf "Example: bash config_client_api_ip_whitelist.sh dev add '*'\n" - printf "Example: bash config_client_api_ip_whitelist.sh dev remove 32.190.239.181\n" + printf "Usage: bash config_client_api_ip_whitelist.sh [dev|staging|sandbox|exp|spring|summer|mainnet] [gcp|onprem] [get|add|remove] []\n" + printf "Example: bash config_client_api_ip_whitelist.sh staging onprem get\n" + printf "Example: bash config_client_api_ip_whitelist.sh staging onprem add 32.190.239.181\n" + printf "Example: bash config_client_api_ip_whitelist.sh staging onprem add '*'\n" + printf "Example: bash config_client_api_ip_whitelist.sh staging onprem remove 32.190.239.181\n" printf "\n" exit } -if [[ $# -lt 2 ]] || [[ $# -gt 3 ]]; then +if [[ $# -lt 3 ]] || [[ $# -gt 4 ]]; then usage fi printf "\n[[[[[ config_client_api_ip_whitelist.sh ]]]]]\n\n" @@ -19,27 +19,37 @@ printf "\n[[[[[ config_client_api_ip_whitelist.sh ]]]]]\n\n" if [[ "$1" = 'dev' ]] || [[ "$1" = 'staging' ]] || [[ "$1" = 'sandbox' ]] || [[ "$1" = 'exp' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'summer' ]] || [[ "$1" = 'mainnet' ]]; then SEASON="$1" else - printf "Invalid argument: $1\n" + printf "\nInvalid argument: $1\n" usage fi printf "SEASON=$SEASON\n" -if [[ "$2" = 'get' ]]; then - COMMAND="$2" - IP_ADDR="$3" +if [[ "$2" = 'gcp' ]] || [[ "$2" = 'onprem' ]]; then + BLOCKCHAIN_HOSTING="$2" +else + printf "\nInvalid argument: $2\n" + usage +fi +printf "BLOCKCHAIN_HOSTING=$BLOCKCHAIN_HOSTING\n" + +COMMAND="$3" +IP_ADDR="" +if [[ $# = 4 ]]; then + IP_ADDR="$4" +fi + +if [[ "$COMMAND" = 'get' ]]; then if [[ ! "$IP_ADDR" = "" ]]; then - printf "\nInvalid argument: $IP_ADDR\n" + printf "\nInvalid argument: $IP_ADDR\n" usage fi -elif [[ "$2" = 'add' ]] || [[ "$2" = 'remove' ]]; then - COMMAND="$2" - IP_ADDR="$3" +elif [[ "$COMMAND" = 'add' ]] || [[ "$COMMAND" = 'remove' ]]; then if [[ "$IP_ADDR" = "" ]]; then printf "\nInvalid argument: $IP_ADDR\n" usage fi else - printf "Invalid argument: $2\n" + printf "\nInvalid argument: $COMMAND\n" usage fi printf "COMMAND=$COMMAND\n" @@ -65,7 +75,7 @@ else fi # Read node urls -IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/$SEASON.txt +IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/${SEASON}_${BLOCKCHAIN_HOSTING}.txt # Get keystore password printf "Enter keystore password: " @@ -101,9 +111,10 @@ function config_node() { printf "\n\n<<< Configuring ip whitelist of node $node_index ($node_url) >>>\n\n" KEYSTORE_FILE_PATH="$KEYSTORE_DIR/keystore_node_$node_index.json" - CONFIG_NODE_CMD="node tools/api-access/$COMMAND_NODE_JS_FILE $node_url $CHAIN_ID keystore $KEYSTORE_FILE_PATH" - if [[ ! $COMMAND = "get" ]]; then - CONFIG_NODE_CMD="$CONFIG_NODE_CMD '$IP_ADDR'" + if [[ $COMMAND = "get" ]]; then + CONFIG_NODE_CMD="node tools/api-access/$COMMAND_NODE_JS_FILE $node_url $CHAIN_ID keystore $KEYSTORE_FILE_PATH" + else + CONFIG_NODE_CMD="node tools/api-access/$COMMAND_NODE_JS_FILE $node_url $CHAIN_ID $IP_ADDR keystore $KEYSTORE_FILE_PATH" fi printf "\n" @@ -111,6 +122,6 @@ function config_node() { eval "echo $KEYSTORE_PW | $CONFIG_NODE_CMD" } -for j in `seq $(( 0 )) $(( 9 ))`; do +for j in `seq $(( 0 )) $(( 4 ))`; do config_node "$j" done diff --git a/config_node_param.sh b/config_node_param.sh index 55679bf4e..06f582600 100644 --- a/config_node_param.sh +++ b/config_node_param.sh @@ -2,18 +2,18 @@ function usage() { printf "\n" - printf "Usage: bash config_node_param.sh [dev|staging|sandbox|exp|spring|summer|mainnet] [get|add|remove] []\n" - printf "Example: bash config_node_param.sh dev get DEV_CLIENT_API_IP_WHITELIST\n" - printf "Example: bash config_node_param.sh dev add DEV_CLIENT_API_IP_WHITELIST 32.190.239.181\n" - printf "Example: bash config_node_param.sh dev add DEV_CLIENT_API_IP_WHITELIST '*'\n" - printf "Example: bash config_node_param.sh dev remove DEV_CLIENT_API_IP_WHITELIST 32.190.239.181\n" - printf "Example: bash config_node_param.sh dev set DEV_CLIENT_API_IP_WHITELIST '*'\n" - printf "Example: bash config_node_param.sh dev get CORS_WHITELIST\n" + printf "Usage: bash config_node_param.sh [dev|staging|sandbox|exp|spring|summer|mainnet] [gcp|onprem] [get|add|remove] []\n" + printf "Example: bash config_node_param.sh staging onprem get DEV_CLIENT_API_IP_WHITELIST\n" + printf "Example: bash config_node_param.sh staging onprem add DEV_CLIENT_API_IP_WHITELIST 32.190.239.181\n" + printf "Example: bash config_node_param.sh staging onprem add DEV_CLIENT_API_IP_WHITELIST '*'\n" + printf "Example: bash config_node_param.sh staging onprem remove DEV_CLIENT_API_IP_WHITELIST 32.190.239.181\n" + printf "Example: bash config_node_param.sh staging onprem set DEV_CLIENT_API_IP_WHITELIST '*'\n" + printf "Example: bash config_node_param.sh staging onprem get CORS_WHITELIST\n" printf "\n" exit } -if [[ $# -lt 3 ]] || [[ $# -gt 4 ]]; then +if [[ $# -lt 4 ]] || [[ $# -gt 5 ]]; then usage fi printf "\n[[[[[ config_node_param.sh ]]]]]\n\n" @@ -21,23 +21,32 @@ printf "\n[[[[[ config_node_param.sh ]]]]]\n\n" if [[ "$1" = 'dev' ]] || [[ "$1" = 'staging' ]] || [[ "$1" = 'sandbox' ]] || [[ "$1" = 'exp' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'summer' ]] || [[ "$1" = 'mainnet' ]]; then SEASON="$1" else - printf "Invalid argument: $1\n" + printf "\nInvalid argument: $1\n" usage fi printf "SEASON=$SEASON\n" -if [[ "$2" = 'get' ]]; then - COMMAND="$2" - PARAM="$3" - VALUE="$4" +if [[ "$2" = 'gcp' ]] || [[ "$2" = 'onprem' ]]; then + BLOCKCHAIN_HOSTING="$2" +else + printf "\nInvalid argument: $2\n" + usage +fi +printf "BLOCKCHAIN_HOSTING=$BLOCKCHAIN_HOSTING\n" + +COMMAND="$3" +PARAM="$4" +VALUE="" +if [[ $# = 5 ]]; then + VALUE="$5" +fi + +if [[ "$COMMAND" = 'get' ]]; then if [[ ! "$VALUE" = "" ]]; then - printf "\nInvalid argument: $VALUE\n" + printf "\nInvalid argument: $VALUE\n" usage fi -elif [[ "$2" = 'add' ]] || [[ "$2" = 'remove' ]] || [[ "$2" = 'set' ]]; then - COMMAND="$2" - PARAM="$3" - VALUE="$4" +elif [[ "$COMMAND" = 'add' ]] || [[ "$COMMAND" = 'remove' ]] || [[ "$COMMAND" = 'set' ]]; then if [[ "$PARAM" = "" ]]; then printf "\nInvalid argument: $PARAM\n" usage @@ -47,7 +56,7 @@ elif [[ "$2" = 'add' ]] || [[ "$2" = 'remove' ]] || [[ "$2" = 'set' ]]; then usage fi else - printf "Invalid argument: $2\n" + printf "\nInvalid argument: $COMMAND\n" usage fi printf "COMMAND=$COMMAND\n" @@ -74,7 +83,7 @@ else fi # Read node urls -IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/$SEASON.txt +IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/${SEASON}_${BLOCKCHAIN_HOSTING}.txt # Get keystore password printf "Enter keystore password: " @@ -109,12 +118,13 @@ function config_node() { local node_index="$1" local node_url=${NODE_URL_LIST[${node_index}]} - printf "\n\n<<< Configuring ip whitelist of node $node_index ($node_url) >>>\n\n" + printf "\n\n<<< Configuring node params of node $node_index ($node_url) >>>\n\n" KEYSTORE_FILE_PATH="$KEYSTORE_DIR/keystore_node_$node_index.json" - CONFIG_NODE_CMD="node tools/api-access/$COMMAND_NODE_JS_FILE $node_url $CHAIN_ID keystore $KEYSTORE_FILE_PATH $PARAM" - if [[ ! $COMMAND = "get" ]]; then - CONFIG_NODE_CMD="$CONFIG_NODE_CMD '$VALUE'" + if [[ $COMMAND = "get" ]]; then + CONFIG_NODE_CMD="node tools/api-access/$COMMAND_NODE_JS_FILE $node_url $CHAIN_ID $PARAM $VALUE keystore $KEYSTORE_FILE_PATH" + else + CONFIG_NODE_CMD="node tools/api-access/$COMMAND_NODE_JS_FILE $node_url $CHAIN_ID $PARAM $VALUE keystore $KEYSTORE_FILE_PATH" fi printf "\n" @@ -122,6 +132,6 @@ function config_node() { eval "echo $KEYSTORE_PW | $CONFIG_NODE_CMD" } -for j in `seq $(( 0 )) $(( 9 ))`; do +for j in `seq $(( 0 )) $(( 4 ))`; do config_node "$j" done diff --git a/copy_blockchain_data_gcp.sh b/copy_blockchain_data_gcp.sh index b53c4ae07..f91efd56d 100644 --- a/copy_blockchain_data_gcp.sh +++ b/copy_blockchain_data_gcp.sh @@ -1,14 +1,14 @@ #!/bin/bash function usage() { - printf "Usage: bash copy_blockchain_data_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] [download|upload]\n" + printf "Usage: bash copy_blockchain_data_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] [download|upload] [ ]\n" printf "Example: bash copy_blockchain_data_gcp.sh spring 0 download\n" - printf "Example: bash copy_blockchain_data_gcp.sh spring 1 upload\n" + printf "Example: bash copy_blockchain_data_gcp.sh spring 1 upload 8079 8080\n" printf "\n" exit } -if [[ $# -lt 3 ]] || [[ $# -gt 3 ]]; then +if [[ $# != 3 ]] && [[ $# != 5 ]]; then usage fi @@ -22,7 +22,7 @@ if [[ "$1" = 'dev' ]] || [[ "$1" = 'staging' ]] || [[ "$1" = 'sandbox' ]] || [[ PROJECT_ID="testnet-$1-ground" fi else - printf "Invalid argument: $1\n" + printf "Invalid argument: $1\n" exit fi printf "\n" @@ -56,6 +56,28 @@ else fi printf "COMMAND=$COMMAND\n" +if [[ "$COMMAND" = 'download' ]]; then + if [[ $# != 3 ]]; then + printf "\n" + printf " and can be used only with 'upload' command.\n" + printf "\n" + usage + fi + OLD_PORT="" + NEW_PORT="" +else + if [[ $# != 5 ]]; then + printf "\n" + printf " and should be specified with 'upload' command.\n" + printf "\n" + usage + fi + OLD_PORT="$4" + NEW_PORT="$5" +fi +printf "OLD_PORT=$OLD_PORT\n" +printf "NEW_PORT=$NEW_PORT\n" + # Get confirmation. if [[ "$SEASON" = "mainnet" ]]; then printf "\n" @@ -151,7 +173,13 @@ function upload_data() { printf "TGZ_CMD=$TGZ_CMD\n\n" eval $TGZ_CMD - # 3. Clean up tgz file for node + # 3. Change port number directory + printf "\n\n<<< Changing port number directory for node $node_index >>>\n\n" + MV_CMD="gcloud compute ssh $node_target_addr --command 'mv /home/ain_blockchain_data/chains/${OLD_PORT} /home/ain_blockchain_data/chains/${NEW_PORT}; mv /home/ain_blockchain_data/snapshots/${OLD_PORT} /home/ain_blockchain_data/snapshots/${NEW_PORT}' --project $PROJECT_ID --zone $node_zone" + printf "MV_CMD=$MV_CMD\n\n" + eval $MV_CMD + + # 4. Clean up tgz file for node printf "\n\n<<< Cleaning up tgz file for node $node_index >>>\n\n" CLEANUP_CMD="gcloud compute ssh $node_target_addr --command 'rm ~/ain_blockchain_data.tar.gz' --project $PROJECT_ID --zone $node_zone" printf "CLEANUP_CMD=$CLEANUP_CMD\n\n" diff --git a/copy_blockchain_data_onprem.sh b/copy_blockchain_data_onprem.sh index 72b62b67d..918ea12a1 100644 --- a/copy_blockchain_data_onprem.sh +++ b/copy_blockchain_data_onprem.sh @@ -1,21 +1,21 @@ #!/bin/bash function usage() { - printf "Usage: bash copy_blockchain_data_onprem.sh [staging|spring|mainnet] [download|upload]\n" + printf "Usage: bash copy_blockchain_data_onprem.sh [staging|spring|mainnet] [download|upload] [ ]\n" printf "Example: bash copy_blockchain_data_onprem.sh staging 0 download\n" - printf "Example: bash copy_blockchain_data_onprem.sh staging 1 upload\n" + printf "Example: bash copy_blockchain_data_onprem.sh staging 1 upload 8080 8079\n" printf "\n" exit } -if [[ $# -lt 3 ]] || [[ $# -gt 3 ]]; then +if [[ $# != 3 ]] && [[ $# != 5 ]]; then usage fi if [[ "$1" = 'staging' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'mainnet' ]]; then SEASON="$1" else - printf "Invalid argument: $1\n" + printf "Invalid argument: $1\n" exit fi printf "\n" @@ -48,6 +48,28 @@ else fi printf "COMMAND=$COMMAND\n" +if [[ "$COMMAND" = 'download' ]]; then + if [[ $# != 3 ]]; then + printf "\n" + printf " and can be used only with 'upload' command.\n" + printf "\n" + usage + fi + OLD_PORT="" + NEW_PORT="" +else + if [[ $# != 5 ]]; then + printf "\n" + printf " and should be specified with 'upload' command.\n" + printf "\n" + usage + fi + OLD_PORT="$4" + NEW_PORT="$5" +fi +printf "OLD_PORT=$OLD_PORT\n" +printf "NEW_PORT=$NEW_PORT\n" + # Get confirmation. if [[ "$SEASON" = "mainnet" ]]; then printf "\n" @@ -120,7 +142,13 @@ function upload_data() { printf "TGZ_CMD=$TGZ_CMD\n\n" eval "echo ${node_login_pw} | sshpass -f <(printf '%s\n' ${node_login_pw}) ${TGZ_CMD}" - # 3. Clean up tgz file for node + # 3. Change port number directory + printf "\n\n<<< Changing port number directory for node $node_index >>>\n\n" + MV_CMD="ssh $node_target_addr 'mv /home/${SEASON}/ain_blockchain_data/chains/${OLD_PORT} /home/${SEASON}/ain_blockchain_data/chains/${NEW_PORT}; mv /home/${SEASON}/ain_blockchain_data/snapshots/${OLD_PORT} /home/${SEASON}/ain_blockchain_data/snapshots/${NEW_PORT}'" + printf "MV_CMD=$MV_CMD\n\n" + eval "sshpass -f <(printf '%s\n' ${node_login_pw}) ${MV_CMD}" + + # 4. Clean up tgz file for node printf "\n\n<<< Cleaning up tgz file for node $node_index >>>\n\n" CLEANUP_CMD="ssh $node_target_addr 'rm ~/ain_blockchain_data.tar.gz'" printf "CLEANUP_CMD=$CLEANUP_CMD\n\n" diff --git a/db/index.js b/db/index.js index deee3b9cc..6e495027c 100644 --- a/db/index.js +++ b/db/index.js @@ -1678,7 +1678,8 @@ class DB { return { code: TxResultCode.GAS_EXCEED_STATE_BUDGET_LIMIT_FOR_FREE_TIER, message: `Exceeded state budget limit for free tier ` + - `(${stateFreeTierUsage[StateLabelProperties.TREE_BYTES]} > ${budgets.freeStateBudget})` + `(${stateFreeTierUsage[StateLabelProperties.TREE_BYTES]} > ${budgets.freeStateBudget}).\n` + + `For more information see https://docs.ainetwork.ai/ain-blockchain/staking` }; } // else, we allow apps without stakes @@ -1688,7 +1689,8 @@ class DB { return { code: TxResultCode.GAS_EXCEED_STATE_BUDGET_LIMIT_FOR_APP, message: `Exceeded state budget limit for app ${appName} ` + - `(${appStateUsage[StateLabelProperties.TREE_BYTES]} > ${singleAppStateBudget})` + `(${appStateUsage[StateLabelProperties.TREE_BYTES]} > ${singleAppStateBudget}).\n` + + `For more information see https://docs.ainetwork.ai/ain-blockchain/staking` }; } } diff --git a/deploy_blockchain_genesis_gcp.sh b/deploy_blockchain_genesis_gcp.sh index 54a5f9dad..28205e694 100644 --- a/deploy_blockchain_genesis_gcp.sh +++ b/deploy_blockchain_genesis_gcp.sh @@ -23,7 +23,7 @@ if [[ "$1" = 'dev' ]] || [[ "$1" = 'staging' ]] || [[ "$1" = 'sandbox' ]] || [[ PROJECT_ID="testnet-$1-ground" fi else - printf "Invalid project/season argument: $1\n" + printf "Invalid argument: $1\n" exit fi printf "SEASON=$SEASON\n" @@ -162,7 +162,7 @@ fi if [[ ! $KILL_OPTION = '--kill-only' ]]; then # Read node urls - IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/$SEASON.txt + IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/${SEASON}_gcp.txt if [[ "$ACCOUNT_INJECTION_OPTION" = "--keystore" ]]; then # Get keystore password printf "Enter keystore password: " diff --git a/deploy_blockchain_genesis_onprem.sh b/deploy_blockchain_genesis_onprem.sh index 10ba48735..cc48dae34 100644 --- a/deploy_blockchain_genesis_onprem.sh +++ b/deploy_blockchain_genesis_onprem.sh @@ -16,7 +16,7 @@ printf "\n[[[[[ deploy_blockchain_genesis_onprem.sh ]]]]]\n\n" if [[ "$1" = 'staging' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'mainnet' ]]; then SEASON="$1" else - printf "Invalid project/season argument: $1\n" + printf "Invalid argument: $1\n" exit fi printf "SEASON=$SEASON\n" diff --git a/deploy_blockchain_incremental_gcp.sh b/deploy_blockchain_incremental_gcp.sh index 4fa960546..88e07d863 100644 --- a/deploy_blockchain_incremental_gcp.sh +++ b/deploy_blockchain_incremental_gcp.sh @@ -23,7 +23,7 @@ if [[ "$1" = 'dev' ]] || [[ "$1" = 'staging' ]] || [[ "$1" = 'sandbox' ]] || [[ PROJECT_ID="testnet-$1-ground" fi else - printf "Invalid argument: $1\n" + printf "Invalid argument: $1\n" exit fi printf "SEASON=$SEASON\n" @@ -161,7 +161,7 @@ fi if [[ ! $KILL_OPTION = '--kill-only' ]]; then # Read node urls - IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/$SEASON.txt + IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/${SEASON}_gcp.txt if [[ $ACCOUNT_INJECTION_OPTION = "--keystore" ]]; then # Get keystore password printf "Enter keystore password: " diff --git a/deploy_blockchain_incremental_onprem.sh b/deploy_blockchain_incremental_onprem.sh index fa335cb40..aa95c8e0a 100644 --- a/deploy_blockchain_incremental_onprem.sh +++ b/deploy_blockchain_incremental_onprem.sh @@ -16,7 +16,7 @@ printf "\n[[[[[ deploy_blockchain_incremental_onprem.sh ]]]]]\n\n" if [[ "$1" = 'staging' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'mainnet' ]]; then SEASON="$1" else - printf "Invalid argument: $1\n" + printf "Invalid argument: $1\n" exit fi printf "SEASON=$SEASON\n" diff --git a/deploy_blockchain_sandbox_gcp.sh b/deploy_blockchain_sandbox_gcp.sh index bf66bb5ef..12514faf0 100644 --- a/deploy_blockchain_sandbox_gcp.sh +++ b/deploy_blockchain_sandbox_gcp.sh @@ -89,7 +89,7 @@ then fi # Read node urls -IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/$SEASON.txt +IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/${SEASON}_gcp.txt function inject_account() { local node_index="$1" diff --git a/deploy_monitoring_gcp.sh b/deploy_monitoring_gcp.sh index c86e3f60a..34b6f7383 100644 --- a/deploy_monitoring_gcp.sh +++ b/deploy_monitoring_gcp.sh @@ -1,12 +1,19 @@ #!/bin/bash -if [[ "$#" -lt 1 ]]; then - printf "Usage: bash deploy_monitoring_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] [--setup]\n" - printf "Example: bash deploy_monitoring_gcp.sh dev --setup\n" - printf "Example: bash deploy_monitoring_gcp.sh dev\n" +function usage() { + printf "Usage: bash deploy_monitoring_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] [gcp|onprem} [--setup]\n" + printf "Example: bash deploy_monitoring_gcp.sh staging gcp \n" + printf "Example: bash deploy_monitoring_gcp.sh staging gcp --setup\n" + printf "Example: bash deploy_monitoring_gcp.sh staging onprem \n" + printf "Example: bash deploy_monitoring_gcp.sh staging onprem --setup\n" printf "\n" exit +} + +if [[ $# -lt 2 ]] || [[ $# -gt 3 ]]; then + usage fi + printf "\n[[[[[ deploy_monitoring_gcp.sh ]]]]]\n\n" if [[ "$1" = 'dev' ]] || [[ "$1" = 'staging' ]] || [[ "$1" = 'sandbox' ]] || [[ "$1" = 'exp' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'summer' ]] || [[ "$1" = 'mainnet' ]]; then @@ -19,18 +26,26 @@ if [[ "$1" = 'dev' ]] || [[ "$1" = 'staging' ]] || [[ "$1" = 'sandbox' ]] || [[ PROJECT_ID="testnet-$1-ground" fi else - printf "Invalid project/season argument: $1\n" + printf "Invalid argument: $1\n" exit fi printf "SEASON=$SEASON\n" printf "PROJECT_ID=$PROJECT_ID\n" -GCP_USER="runner" -printf "GCP_USER=$GCP_USER\n" +if [[ "$2" = 'gcp' ]] || [[ "$2" = 'onprem' ]]; then + BLOCKCHAIN_HOSTING="$2" +else + printf "Invalid blockchain hosting argument: $2\n" + exit +fi +printf "BLOCKCHAIN_HOSTING=$BLOCKCHAIN_HOSTING\n" -OPTIONS="$2" +OPTIONS="$3" printf "OPTIONS=$OPTIONS\n" +GCP_USER="runner" +printf "GCP_USER=$GCP_USER\n" + # Get confirmation. printf "\n" read -p "Do you want to proceed for $SEASON? [y/N]: " -n 1 -r @@ -62,4 +77,4 @@ fi # ssh into each instance, install packages and start up the server printf "\n\n############################\n# Running monitoring #\n############################\n\n" -gcloud compute ssh $MONITORING_TARGET_ADDR --command "cd ./ain-blockchain; . setup_monitoring_gcp.sh $SEASON $GCP_USER && . start_monitoring_gcp.sh" --project $PROJECT_ID --zone $MONITORING_ZONE +gcloud compute ssh $MONITORING_TARGET_ADDR --command "cd ./ain-blockchain; . setup_monitoring_gcp.sh $SEASON $GCP_USER $BLOCKCHAIN_HOSTING && . start_monitoring_gcp.sh" --project $PROJECT_ID --zone $MONITORING_ZONE diff --git a/monitoring/grafana.json b/monitoring/grafana-template.json similarity index 100% rename from monitoring/grafana.json rename to monitoring/grafana-template.json diff --git a/monitoring/prometheus.yml b/monitoring/prometheus-template.yml similarity index 100% rename from monitoring/prometheus.yml rename to monitoring/prometheus-template.yml diff --git a/package.json b/package.json index 6ffa76166..e7e7a91a8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ain-blockchain", "description": "AI Network Blockchain", - "version": "1.5.0", + "version": "1.5.1", "private": true, "license": "MIT", "author": "dev@ainetwork.ai", @@ -56,7 +56,7 @@ "tracker": "node ./tracker-server/index.js" }, "dependencies": { - "@ainblockchain/ain-util": "^1.2.1", + "@ainblockchain/ain-util": "^1.3.0", "@google-cloud/logging-bunyan": "^3.2.0", "@google-cloud/logging-winston": "^4.0.2", "JSONStream": "^1.3.5", diff --git a/setup_monitoring_gcp.sh b/setup_monitoring_gcp.sh index 039445369..7b6804643 100644 --- a/setup_monitoring_gcp.sh +++ b/setup_monitoring_gcp.sh @@ -1,23 +1,34 @@ #!/bin/bash -if [[ "$#" -lt 2 ]]; then - printf "Usage: bash setup_monitoring_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] \n" - printf "Example: bash setup_monitoring_gcp.sh dev gcp_user\n" +function usage() { + printf "Usage: bash setup_monitoring_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] [gcp|onprem]\n" + printf "Example: bash setup_monitoring_gcp.sh staging gcp_user gcp\n" + printf "Example: bash setup_monitoring_gcp.sh staging gcp_user onprem\n" printf "\n" exit +} + +if [[ $# -lt 3 ]] || [[ $# -gt 3 ]]; then + usage fi + printf "\n[[[[[ setup_monitoring_gcp.sh ]]]]]\n\n" if [[ "$1" != 'dev' ]] && [[ "$1" != 'staging' ]] && [[ "$1" != 'sandbox' ]] && [[ "$1" != 'exp' ]] && [[ "$1" != 'spring' ]] && [[ "$1" != 'summer' ]] && [[ "$1" != 'mainnet' ]]; then - printf "Invalid season argument: $1\n" + printf "Invalid argument: $1\n" + exit +fi +if [[ "$3" != 'gcp' ]] && [[ "$3" != 'onprem' ]]; then + printf "Invalid blockchain hosting argument: $3\n" exit fi SEASON="$1" GCP_USER="$2" - +BLOCKCHAIN_HOSTING="$3" printf "SEASON=$SEASON\n" printf "GCP_USER=$GCP_USER\n" +printf "BLOCKCHAIN_HOSTING=$BLOCKCHAIN_HOSTING\n" printf "\n" printf 'Killing old jobs..\n' @@ -47,6 +58,6 @@ mv prometheus*/ prometheus printf 'Copying Prometheus yml file..\n' -PROMETHEUS_CONFIG_FILE="prometheus-${SEASON}.yml" +PROMETHEUS_CONFIG_FILE="prometheus-${SEASON}-${BLOCKCHAIN_HOSTING}.yml" printf "PROMETHEUS_CONFIG_FILE=${PROMETHEUS_CONFIG_FILE}\n" cp -f monitoring/${PROMETHEUS_CONFIG_FILE} prometheus/prometheus.yml diff --git a/start_node_genesis_gcp.sh b/start_node_genesis_gcp.sh index cd8dd26ae..c64347257 100644 --- a/start_node_genesis_gcp.sh +++ b/start_node_genesis_gcp.sh @@ -51,7 +51,7 @@ function parse_options() { if [[ "$1" = 'dev' ]] || [[ "$1" = 'staging' ]] || [[ "$1" = 'sandbox' ]] || [[ "$1" = 'exp' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'summer' ]] || [[ "$1" = 'mainnet' ]]; then SEASON="$1" else - printf "Invalid project/season argument: $1\n" + printf "Invalid argument: $1\n" exit fi GCP_USER="$2" @@ -119,7 +119,7 @@ printf "PEER_WHITELIST_NODE_INDEX_LE=$PEER_WHITELIST_NODE_INDEX_LE\n" # NOTE(liayoo): Currently this script supports [--keystore|--mnemonic] option only for the parent chain. if [[ $ACCOUNT_INJECTION_OPTION != "--private_key" ]] && [[ "$SHARD_INDEX" -gt 0 ]]; then - printf 'Invalid account injection option\n' + printf 'Invalid option\n' return 1 fi @@ -293,14 +293,14 @@ elif [[ $SEASON = 'dev' ]]; then elif [[ $SHARD_INDEX = 20 ]]; then export TRACKER_UPDATE_JSON_RPC_URL="http://35.201.248.92:8080/json-rpc" # dev-shard-20-tracker-ip else - printf "Invalid shard ID argument: $SHARD_INDEX\n" + printf "Invalid argument: $SHARD_INDEX\n" return 1 fi if [[ $SHARD_INDEX -gt 0 ]]; then export BLOCKCHAIN_CONFIGS_DIR=blockchain-configs/sim-shard fi else - printf "Invalid season argument: $SEASON\n" + printf "Invalid argument: $SEASON\n" return 1 fi diff --git a/start_node_genesis_onprem.sh b/start_node_genesis_onprem.sh index 8249e5503..aecf528cb 100644 --- a/start_node_genesis_onprem.sh +++ b/start_node_genesis_onprem.sh @@ -61,7 +61,7 @@ function parse_options() { if [[ "$1" = 'staging' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'mainnet' ]]; then SEASON="$1" else - printf "Invalid project/season argument: $1\n" + printf "Invalid argument: $1\n" exit fi ONPREM_USER="$2" @@ -129,7 +129,7 @@ printf "PEER_WHITELIST_NODE_INDEX_LE=$PEER_WHITELIST_NODE_INDEX_LE\n" # NOTE(liayoo): Currently this script supports [--keystore|--mnemonic] option only for the parent chain. if [[ $ACCOUNT_INJECTION_OPTION != "--private_key" ]] && [[ "$SHARD_INDEX" -gt 0 ]]; then - printf 'Invalid account injection option\n' + printf 'Invalid option\n' return 1 fi @@ -183,7 +183,7 @@ if [[ $KEEP_CODE_OPTION = "--no-keep-code" ]]; then printf 'Setting up new working directory..\n' sudo rm -rf /home/${SEASON}/ain-blockchain* # NOTE(platfowner): Add $SEASON to the node job name to be selectively killed in restarts. - CODE_CMD="sudo mkdir -p /home/${SEASON}; sudo chmod -R 777 /home/${SEASON}; sudo chown -R $ONPREM_USER:$ONPREM_USER /home/${SEASON}; cd ~; sudo mv ./ain-blockchain /home/${SEASON}; sudo chmod -R 777 /home/${SEASON}/ain-blockchain; sudo chown -R $ONPREM_USER:$ONPREM_USER /home/${SEASON}/ain-blockchain; cd /home/${SEASON}/ain-blockchain; mv client/index.js client/${SEASON}-ain-blockchain-index.js" + CODE_CMD="sudo mkdir -p /home/${SEASON}; sudo chmod 777 /home/${SEASON}; sudo chown $ONPREM_USER:$ONPREM_USER /home/${SEASON}; cd ~; sudo mv ./ain-blockchain /home/${SEASON}; sudo chmod -R 777 /home/${SEASON}/ain-blockchain; sudo chown -R $ONPREM_USER:$ONPREM_USER /home/${SEASON}/ain-blockchain; cd /home/${SEASON}/ain-blockchain; mv client/index.js client/${SEASON}-ain-blockchain-index.js" printf "\nCODE_CMD=$CODE_CMD\n" eval $CODE_CMD else @@ -240,7 +240,7 @@ elif [[ $SEASON = 'staging' ]]; then export PEER_WHITELIST="0x00ADEc28B6a845a085e03591bE7550dd68673C1C,0x01A0980d2D4e418c7F27e1ef539d01A5b5E93204,0x02A2A1DF4f630d760c82BE07F18e5065d103Fa00,0x03AAb7b6f16A92A1dfe018Fe34ee420eb098B98A,0x04A456C92A880cd59D7145C457475515a6f6E0f2,0x05A1247A7400f0C2A893611adD1505743552c631,0x06AD9C8F611f1e9d9CACD4738167A51aA2e80a1A,0x07A43138CC760C85A5B1F115aa60eADEaa0bf417,0x08Aed7AF9354435c38d52143EE50ac839D20696b,0x09A0d53FDf1c36A131938eb379b98910e55EEfe1" fi else - printf "Invalid season argument: $SEASON\n" + printf "Invalid argument: $SEASON\n" return 1 fi diff --git a/start_node_incremental_gcp.sh b/start_node_incremental_gcp.sh index e70433c57..f16cf1f90 100644 --- a/start_node_incremental_gcp.sh +++ b/start_node_incremental_gcp.sh @@ -50,7 +50,7 @@ function parse_options() { if [[ "$1" = 'dev' ]] || [[ "$1" = 'staging' ]] || [[ "$1" = 'sandbox' ]] || [[ "$1" = 'exp' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'summer' ]] || [[ "$1" = 'mainnet' ]]; then SEASON="$1" else - printf "Invalid project/season argument: $1\n" + printf "Invalid argument: $1\n" exit fi GCP_USER="$2" @@ -224,7 +224,7 @@ elif [[ $SEASON = 'dev' ]]; then EOF fi else - printf "Invalid argument: $SEASON\n" + printf "Invalid argument: $SEASON\n" exit fi @@ -235,7 +235,7 @@ printf "PEER_WHITELIST=$PEER_WHITELIST\n" # NOTE(liayoo): Currently this script supports [--keystore|--mnemonic] option only for the parent chain. if [[ $ACCOUNT_INJECTION_OPTION != "--private_key" ]] && [[ "$SHARD_INDEX" -gt 0 ]]; then - printf 'Invalid account injection option\n' + printf 'Invalid option\n' return 1 fi @@ -285,7 +285,7 @@ fi # NOTE(liayoo): Currently this script supports [--keystore|--mnemonic] option only for the parent chain. if [[ $ACCOUNT_INJECTION_OPTION != "private_key" ]] && [[ "$SHARD_INDEX" -gt 0 ]]; then - printf 'Invalid account injection option\n' + printf 'Invalid option\n' exit fi diff --git a/start_node_incremental_onprem.sh b/start_node_incremental_onprem.sh index e76aacbc6..ee4d87353 100644 --- a/start_node_incremental_onprem.sh +++ b/start_node_incremental_onprem.sh @@ -60,7 +60,7 @@ function parse_options() { if [[ "$1" = 'staging' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'mainnet' ]]; then SEASON="$1" else - printf "Invalid project/season argument: $1\n" + printf "Invalid argument: $1\n" exit fi ONPREM_USER="$2" @@ -157,7 +157,7 @@ elif [[ $SEASON = 'staging' ]]; then # NOTE(platfowner): For non-api-servers, the value in the blockchain configs # (https://staging-api.ainetwork.ai/json-rpc) is used. else - printf "Invalid argument: $SEASON\n" + printf "Invalid argument: $SEASON\n" exit fi @@ -168,7 +168,7 @@ printf "PEER_WHITELIST=$PEER_WHITELIST\n" # NOTE(liayoo): Currently this script supports [--keystore|--mnemonic] option only for the parent chain. if [[ $ACCOUNT_INJECTION_OPTION != "--private_key" ]] && [[ "$SHARD_INDEX" -gt 0 ]]; then - printf 'Invalid account injection option\n' + printf 'Invalid option\n' return 1 fi @@ -218,7 +218,7 @@ fi # NOTE(liayoo): Currently this script supports [--keystore|--mnemonic] option only for the parent chain. if [[ $ACCOUNT_INJECTION_OPTION != "private_key" ]] && [[ "$SHARD_INDEX" -gt 0 ]]; then - printf 'Invalid account injection option\n' + printf 'Invalid option\n' exit fi @@ -247,7 +247,7 @@ if [[ $KEEP_CODE_OPTION = "--no-keep-code" ]]; then printf '\n' printf 'Setting up new working directory..\n' # NOTE(platfowner): Add $SEASON to the node job name to be selectively killed in restarts. - CODE_CMD="sudo mkdir -p /home/${SEASON}; sudo chmod -R 777 /home/${SEASON}; sudo chown -R $ONPREM_USER:$ONPREM_USER /home/${SEASON}; cd ~; sudo mv ain-blockchain $NEW_DIR_PATH; sudo chmod -R 777 $NEW_DIR_PATH; sudo chown -R $ONPREM_USER:$ONPREM_USER $NEW_DIR_PATH; cd $NEW_DIR_PATH; mv client/index.js client/${SEASON}-ain-blockchain-index.js" + CODE_CMD="sudo mkdir -p /home/${SEASON}; sudo chmod 777 /home/${SEASON}; sudo chown $ONPREM_USER:$ONPREM_USER /home/${SEASON}; cd ~; sudo mv ain-blockchain $NEW_DIR_PATH; sudo chmod -R 777 $NEW_DIR_PATH; sudo chown -R $ONPREM_USER:$ONPREM_USER $NEW_DIR_PATH; cd $NEW_DIR_PATH; mv client/index.js client/${SEASON}-ain-blockchain-index.js" printf "\nCODE_CMD=$CODE_CMD\n" eval $CODE_CMD else diff --git a/tools/chatbot/sendCreateAppAndConfigTx.js b/tools/chatbot/sendCreateAppAndConfigTx.js index 20c297003..687acde73 100644 --- a/tools/chatbot/sendCreateAppAndConfigTx.js +++ b/tools/chatbot/sendCreateAppAndConfigTx.js @@ -27,12 +27,12 @@ function buildChatbotConfigTxBody(timestamp) { op_list: [ { type: "SET_OWNER", - ref: `/apps/${config.appName}/common/messages`, + ref: `/apps/${config.appName}/messages`, value: { ".owner": { owners: { "*": { - branch_owner: true, + branch_owner: false, write_function: true, write_owner: true, write_rule: true @@ -43,7 +43,7 @@ function buildChatbotConfigTxBody(timestamp) { }, { type: "SET_RULE", - ref: `/apps/${config.appName}/common/messages/$key`, + ref: `/apps/${config.appName}/messages/$addr/$key`, value: { ".rule": { "write": true @@ -52,13 +52,13 @@ function buildChatbotConfigTxBody(timestamp) { }, { type: "SET_FUNCTION", - ref: `/apps/${config.appName}/common/messages/$key/user`, + ref: `/apps/${config.appName}/messages/$addr/$key/user`, value: { ".function": { - "liayoo-ainjs": { + "echo-bot": { function_type: "REST", function_url: "http://localhost:3000/trigger", - function_id: "liayoo-ainjs" + function_id: "echo-bot" } } } diff --git a/tools/chatbot/sendMessageTx.js b/tools/chatbot/sendMessageTx.js index a5059e5d1..49373f0ec 100644 --- a/tools/chatbot/sendMessageTx.js +++ b/tools/chatbot/sendMessageTx.js @@ -4,11 +4,11 @@ const path = require('path'); const { signAndSendTx, confirmTransaction } = require('../util'); let config = {}; -function buildMessageTxBody(timestamp, message) { +function buildMessageTxBody(address, timestamp, message) { return { operation: { type: 'SET_VALUE', - ref: `/apps/${config.appName}/common/messages/${timestamp}/user`, + ref: `/apps/${config.appName}/messages/${address}/${timestamp}/user`, value: message, }, gas_price: 500, @@ -17,11 +17,11 @@ function buildMessageTxBody(timestamp, message) { }; } -async function sendTransaction(message) { +async function sendTransaction(config, message) { console.log('\n*** sendTransaction():'); const timestamp = Date.now(); - const txBody = buildMessageTxBody(timestamp, message); + const txBody = buildMessageTxBody(config.userAddr, timestamp, message); console.log(`txBody: ${JSON.stringify(txBody, null, 2)}`); const txInfo = await signAndSendTx(config.endpointUrl, txBody, config.serviceOwnerPrivateKey, config.chainId); @@ -42,7 +42,7 @@ async function processArguments() { message = process.argv[3]; } config = require(path.resolve(__dirname, process.argv[2])); - await sendTransaction(message); + await sendTransaction(config, message); } function usage() { diff --git a/tools/simple-chatbot-server/index.js b/tools/simple-chatbot-server/index.js index c18749277..168a19d1a 100644 --- a/tools/simple-chatbot-server/index.js +++ b/tools/simple-chatbot-server/index.js @@ -42,8 +42,8 @@ app.post('/trigger', async (req, res) => { const ref = _.get(tx, 'tx_body.operation.ref'); const parsedRef = CommonUtil.parsePath(ref); const userVal = _.get(tx, 'tx_body.operation.value'); - if (parsedRef.length !== 6 || parsedRef[0] !== 'apps' || parsedRef[1] !== APP_NAME || - parsedRef[3] !== 'messages' || parsedRef[5] !== 'user') { + if (parsedRef.length !== 6 || parsedRef[0] !== 'apps' || + parsedRef[2] !== 'messages' || parsedRef[5] !== 'user') { console.log(`Not supported path pattern: ${ref}`); return; } diff --git a/tools/simple-chatbot-server/start_echo_bot.sh b/tools/simple-chatbot-server/start_echo_bot.sh new file mode 100644 index 000000000..bcf5fb41b --- /dev/null +++ b/tools/simple-chatbot-server/start_echo_bot.sh @@ -0,0 +1,2 @@ +nohup node ./index.js >console_logs.txt 2>error_logs.txt & + diff --git a/yarn.lock b/yarn.lock index 63c8756db..3c7929e94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@ainblockchain/ain-util@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@ainblockchain/ain-util/-/ain-util-1.2.0.tgz#d2ac228c729cae9f87e8d43120ab0b4fab9de436" - integrity sha512-M0hjvyOSNurTVW1J5sW2zQoAqhry06OAInN3Mz9ARHde19rV2e23hob9laXQTayFUAYRQ5BZqITW9qtOL6HP7A== +"@ainblockchain/ain-util@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@ainblockchain/ain-util/-/ain-util-1.3.0.tgz#c35f49bcbae22cb44240068ac5f902df2978c6e0" + integrity sha512-qrmH+gMZ/viVKmIq8qQ5XsoPAmat+6q4trOGcvPR5FXKuGVj+gFLfx14PLtUeSCD+ztcBS4vylcEXAaWKwbHiQ== dependencies: bip39 "^3.0.4" bn.js "^4.11.8" @@ -316,6 +316,11 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@noble/hashes@^1.2.0": + version "1.6.1" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.6.1.tgz#df6e5943edcea504bac61395926d6fd67869a0d5" + integrity sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w== + "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" @@ -470,11 +475,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.34.tgz#3b0b6a50ff797280b8d000c6281d229f9c538cef" integrity sha512-XImEz7XwTvDBtzlTnm8YvMqGW/ErMWBsKZ+hMTvnDIjGCKxwK5Xpc+c/oQjOauwq8M4OS11hEkpjX8rrI/eEgA== -"@types/node@11.11.6": - version "11.11.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" - integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== - "@types/node@^10.0.3": version "10.17.60" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" @@ -873,14 +873,11 @@ bindings@^1.5.0: file-uri-to-path "1.0.0" bip39@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" - integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== + version "3.1.0" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.1.0.tgz#c55a418deaf48826a6ceb34ac55b3ee1577e18a3" + integrity sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A== dependencies: - "@types/node" "11.11.6" - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" + "@noble/hashes" "^1.2.0" bip66@^1.1.5: version "1.1.5" @@ -912,11 +909,16 @@ bn.js@4.11.6: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" integrity sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9: +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.6, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== +bn.js@^4.11.8: + version "4.12.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.1.tgz#215741fe3c9dba2d7e12c001d0cfdbae43975ba7" + integrity sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg== + bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" @@ -1774,7 +1776,7 @@ download@^8.0.0: drbg.js@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" - integrity sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs= + integrity sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g== dependencies: browserify-aes "^1.0.6" create-hash "^1.1.2" @@ -1848,7 +1850,7 @@ ejs@^3.1.7: dependencies: jake "^10.8.5" -elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.4.1, elliptic@^6.5.2, elliptic@^6.5.3, elliptic@^6.5.4: +elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -1861,6 +1863,19 @@ elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.4.1, elliptic@^6.5.2, elliptic@^6.5 minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" +elliptic@^6.4.1, elliptic@^6.5.7: + version "6.6.1" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.1.tgz#3b8ffb02670bf69e382c7f65bf524c97c5405c06" + integrity sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -3285,11 +3300,12 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: minimalistic-assert "^1.0.1" hdkey@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/hdkey/-/hdkey-2.0.1.tgz#0a211d0c510bfc44fa3ec9d44b13b634641cad74" - integrity sha512-c+tl9PHG9/XkGgG0tD7CJpRVaE0jfZizDNmnErUAKQ4EjQSOcOUcV3EN9ZEZS8pZ4usaeiiK0H7stzuzna8feA== + version "2.1.0" + resolved "https://registry.yarnpkg.com/hdkey/-/hdkey-2.1.0.tgz#755b30b73f54e93c31919c1b2f19205a8e57cb92" + integrity sha512-i9Wzi0Dy49bNS4tXXeGeu0vIcn86xXdPQUpEYg+SO1YiO8HtomjmmRMaRyqL0r59QfcD4PfVbSF3qmsWFwAemA== dependencies: bs58check "^2.1.2" + ripemd160 "^2.0.2" safe-buffer "^5.1.1" secp256k1 "^4.0.0" @@ -4428,6 +4444,11 @@ node-addon-api@^2.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== +node-addon-api@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" + integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== + node-cron@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/node-cron/-/node-cron-2.0.3.tgz#b9649784d0d6c00758410eef22fa54a10e3f602d" @@ -4852,7 +4873,7 @@ pathval@^1.1.1: resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== -pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9: +pbkdf2@^3.0.17, pbkdf2@^3.0.3: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== @@ -5306,7 +5327,7 @@ rimraf@~2.4.0: dependencies: glob "^6.0.1" -ripemd160@^2.0.0, ripemd160@^2.0.1: +ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== @@ -5392,20 +5413,29 @@ secp256k1@3.7.1: safe-buffer "^5.1.2" secp256k1@^3.6.2: - version "3.8.0" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.0.tgz#28f59f4b01dbee9575f56a47034b7d2e3b3b352d" - integrity sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw== + version "3.8.1" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.1.tgz#b62a62a882d6b16f9b51fe599c6b3a861e36c59f" + integrity sha512-tArjQw2P0RTdY7QmkNehgp6TVvQXq6ulIhxv8gaH6YubKG/wxxAoNKcbuXjDhybbc+b2Ihc7e0xxiGN744UIiQ== dependencies: bindings "^1.5.0" bip66 "^1.1.5" bn.js "^4.11.8" create-hash "^1.2.0" drbg.js "^1.0.1" - elliptic "^6.5.2" + elliptic "^6.5.7" nan "^2.14.0" safe-buffer "^5.1.2" -secp256k1@^4.0.0, secp256k1@^4.0.1: +secp256k1@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.4.tgz#58f0bfe1830fe777d9ca1ffc7574962a8189f8ab" + integrity sha512-6JfvwvjUOn8F/jUoBY2Q1v5WY5XS+rj8qSe0v8Y4ezH4InLgTEeOOPQsRll9OV429Pvo6BCHGavIyJfr3TAhsw== + dependencies: + elliptic "^6.5.7" + node-addon-api "^5.0.0" + node-gyp-build "^4.2.0" + +secp256k1@^4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==