Merge pull request #1653 from LeoHChen/node_enable_public_rcp

Node enable public RPC
pull/1670/head
Leo Chen 5 years ago committed by GitHub
commit c2515bc275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      scripts/node.sh

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
version="v1 20190924.0"
unset -v progname unset -v progname
progname="${0##*/}" progname="${0##*/}"
@ -111,6 +113,9 @@ usage: ${progname} [-1ch] [-k KEYFILE]
-b download harmony_db files from shard specified by -i <shardid> (default: off) -b download harmony_db files from shard specified by -i <shardid> (default: off)
-a dbfile specify the db file to download (default:off) -a dbfile specify the db file to download (default:off)
-U FOLDER specify the upgrade folder to download binaries -U FOLDER specify the upgrade folder to download binaries
-P enable public rpc end point (default:off)
-v print out the version of the node.sh
-V print out the version of the Harmony binary
examples: examples:
@ -144,7 +149,7 @@ BUCKET=pub.harmony.one
OS=$(uname -s) OS=$(uname -s)
unset start_clean loop run_as_root blspass do_not_download download_only metrics network node_type shard_id download_harmony_db db_file_to_dl unset start_clean loop run_as_root blspass do_not_download download_only metrics network node_type shard_id download_harmony_db db_file_to_dl
unset upgrade_rel unset upgrade_rel public_rpc
start_clean=false start_clean=false
loop=true loop=true
run_as_root=true run_as_root=true
@ -155,11 +160,12 @@ network=main
node_type=validator node_type=validator
shard_id=1 shard_id=1
download_harmony_db=false download_harmony_db=false
public_rpc=false
${BLSKEYFILE=} ${BLSKEYFILE=}
unset OPTIND OPTARG opt unset OPTIND OPTARG opt
OPTIND=1 OPTIND=1
while getopts :1chk:sSp:dDmN:tT:i:ba:U: opt while getopts :1chk:sSp:dDmN:tT:i:ba:U:PvV opt
do do
case "${opt}" in case "${opt}" in
'?') usage "unrecognized option -${OPTARG}";; '?') usage "unrecognized option -${OPTARG}";;
@ -181,6 +187,11 @@ do
i) shard_id="${OPTARG}";; i) shard_id="${OPTARG}";;
a) db_file_to_dl="${OPTARG}";; a) db_file_to_dl="${OPTARG}";;
U) upgrade_rel="${OPTARG}";; U) upgrade_rel="${OPTARG}";;
P) public_rpc=true;;
v) msg "version: $version"
exit 0 ;;
V) LD_LIBRARY_PATH=. ./harmony -version
exit 0 ;;
*) err 70 "unhandled option -${OPTARG}";; # EX_SOFTWARE *) err 70 "unhandled option -${OPTARG}";; # EX_SOFTWARE
esac esac
done done
@ -619,6 +630,11 @@ do
-network_type="${network_type}" -network_type="${network_type}"
-dns_zone="${dns_zone}" -dns_zone="${dns_zone}"
) )
if ${public_rpc}; then
args+=(
-public_rpc
)
fi
# backward compatible with older harmony node software # backward compatible with older harmony node software
case "${node_type}" in case "${node_type}" in
explorer) explorer)

Loading…
Cancel
Save