Skip to content

Commit

Permalink
scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jchung00 committed Oct 19, 2018
1 parent 288c7c7 commit 67efeda
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 20 deletions.
15 changes: 11 additions & 4 deletions bin/cleos.sh
Expand Up @@ -10,10 +10,17 @@
#
###############################################################################

SCRIPTPATH=$(/usr/bin/dirname $(realpath $0))""
REALPATH=$( command -v realpath || command -v grealpath )
JQ=$(command -v jq)
if ! [ -x "$JQ" ]; then
echo 'Error: jq is not installed.' >&2
exit 1
fi

SCRIPTPATH=$(/usr/bin/dirname $( $REALPATH $0))""
config="$SCRIPTPATH/../config.json"
WALLETHOST="$( /usr/bin/jq -r '.walletAddr' "$config" )"
NODEHOST="$( /usr/bin/jq -r '.nodeos' "$config" )"
CLEOS="$( /usr/bin/jq -r '.cleos_bin' "$config" )"
WALLETHOST="$( $JQ -r '.walletAddr' "$config" )"
NODEHOST="$( $JQ -r '.nodeos' "$config" )"
CLEOS="$( $JQ -r '.cleos_bin' "$config" )"

$CLEOS -u http://$NODEHOST --wallet-url http://$WALLETHOST "$@"
7 changes: 5 additions & 2 deletions node/config.ini
Expand Up @@ -22,7 +22,7 @@ access-control-allow-origin = *
# access-control-max-age =

access-control-allow-credentials = false
p2p-listen-endpoint = 127.0.0.1:19875
p2p-listen-endpoint = 0.0.0.0:19875

p2p-server-address = 127.0.0.1:19875

Expand All @@ -47,8 +47,11 @@ max-transaction-time = 10000
max-irreversible-block-age = -1
txn-reference-block-lag = 0

unlock-timeout = 900
<<<<<<< HEAD
#unlock-timeout = 900

=======
>>>>>>> 693130090c655094546c05a8334922b29b9d5328
plugin = eosio::chain_api_plugin
plugin = eosio::history_api_plugin
plugin = eosio::chain_plugin
Expand Down
13 changes: 10 additions & 3 deletions node/start.sh
Expand Up @@ -10,11 +10,18 @@
## ##
#######################################################

GLOBALPATH=$(/usr/bin/dirname $(/usr/bin/realpath $0))
REALPATH=$( command -v realpath || command -v grealpath )
JQ=$(command -v jq)
if ! [ -x "$JQ" ]; then
echo 'Error: jq is not installed.' >&2
exit 1
fi

GLOBALPATH=$(/usr/bin/dirname $($REALPATH $0))
config="$GLOBALPATH/../config.json"

DATADIR="$( /usr/bin/jq -r '.node_data_dir' "$config" )"
NODEOS="$( /usr/bin/jq -r '.node_bin' "$config" )"
DATADIR="$( $JQ -r '.node_data_dir' "$config" )"
NODEOS="$( $JQ -r '.node_bin' "$config" )"

/bin/echo "Starting Nodeos";

Expand Down
11 changes: 9 additions & 2 deletions node/stop.sh
Expand Up @@ -10,9 +10,16 @@
## ##
#######################################################

GLOBALPATH=$(/usr/bin/dirname $(/usr/bin/realpath $0))
REALPATH=$( command -v realpath || command -v grealpath )
JQ=$(command -v jq)
if ! [ -x "$JQ" ]; then
echo 'Error: jq is not installed.' >&2
exit 1
fi

GLOBALPATH=$(/usr/bin/dirname $($REALPATH $0))
config="$GLOBALPATH/../config.json"
DIR="$( /usr/bin/jq -r '.node_data_dir' "$config" )"
DIR="$( $JQ -r '.node_data_dir' "$config" )"

if [ -f $DIR"/nodeos.pid" ]; then
pid=$(/bin/cat $DIR"/nodeos.pid")
Expand Down
13 changes: 10 additions & 3 deletions producing-nodes/start.sh
Expand Up @@ -10,11 +10,18 @@
## ##
#######################################################

GLOBALPATH=$(/usr/bin/dirname $(/usr/bin/realpath $0))
REALPATH=$( command -v realpath || command -v grealpath )
JQ=$(command -v jq)
if ! [ -x "$JQ" ]; then
echo 'Error: jq is not installed.' >&2
exit 1
fi

GLOBALPATH=$(/usr/bin/dirname $($REALPATH $0))
config="$GLOBALPATH/../config.json"

DATADIR="$( /usr/bin/jq -r '.node_data_dir_2' "$config" )"
NODEOS="$( /usr/bin/jq -r '.node_bin' "$config" )"
DATADIR="$( $JQ -r '.node_data_dir_2' "$config" )"
NODEOS="$( $JQ -r '.node_bin' "$config" )"

/bin/echo "Starting Nodeos";

Expand Down
11 changes: 9 additions & 2 deletions producing-nodes/stop.sh
Expand Up @@ -10,9 +10,16 @@
## ##
#######################################################

GLOBALPATH=$(/usr/bin/dirname $(/usr/bin/realpath $0))
REALPATH=$( command -v realpath || command -v grealpath )
JQ=$(command -v jq)
if ! [ -x "$JQ" ]; then
echo 'Error: jq is not installed.' >&2
exit 1
fi

GLOBALPATH=$(/usr/bin/dirname $($REALPATH $0))
config="$GLOBALPATH/../config.json"
DIR="$( /usr/bin/jq -r '.node_data_dir_2' "$config" )"
DIR="$( $JQ -r '.node_data_dir_2' "$config" )"

if [ -f $DIR"/nodeos.pid" ]; then
pid=$(/bin/cat $DIR"/nodeos.pid")
Expand Down
22 changes: 18 additions & 4 deletions wallet/start.sh
@@ -1,10 +1,24 @@
#!/bin/bash

GLOBALPATH=$(/usr/bin/dirname $(/usr/bin/realpath $0))
REALPATH=$( command -v realpath || command -v grealpath )
JQ=$(command -v jq)
if ! [ -x "$JQ" ]; then
echo 'Error: jq is not installed.' >&2
exit 1
fi
SCRIPTPATH=$(/usr/bin/dirname $( $REALPATH $0))""
config="$SCRIPTPATH/../config.json"
CLEOS="$( $JQ -r '.cleos_bin' "$config" )"
if ! [ -x "$CLEOS" ]; then
echo 'Error: cleos is not installed.' >&2
exit 1
fi

GLOBALPATH=$(/usr/bin/dirname $( $REALPATH $0 ))
config="$GLOBALPATH/../config.json"
DIR="$( /usr/bin/jq -r '.wallet_data_dir' "$config" )"
KEOSDBINDIR="$( /usr/bin/jq -r '.keosd_bin' "$config" )"
WALLET_ADDRESS="$( /usr/bin/jq -r '.walletAddr' "$config" )"
DIR="$( $JQ -r '.wallet_data_dir' "$config" )"
KEOSDBINDIR="$( $JQ -r '.keosd_bin' "$config" )"
WALLET_ADDRESS="$( $JQ -r '.walletAddr' "$config" )"

/bin/echo "Starting Keosd";

Expand Down

0 comments on commit 67efeda

Please sign in to comment.