Skip to content

Commit

Permalink
Merge pull request #6 from KILTprotocol/feature/ap_purge_mongodb_on_n…
Browse files Browse the repository at this point in the history
…ode_deploy

feature: enrich node start script with capability for purging user da…
  • Loading branch information
bekolb authored Jan 3, 2019
2 parents 8c4af5f + 56244ee commit d5b9e9c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions start-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ Usage:
-c, --connect-to BOOT_NODE_NAME The name of the boot node to connect to ("alice" | "bob")
-d, --dry-run Flag indicating to only show the resulting command instead of executing it
-t, --telemetry Flag indicating whether or not to send data to the telemetry server
-p, --purge-userdata Purges all chain-dependend user data in auxiliary services (ctypes, contacts, messages, ...)
Examples:
Start Alice (boot node):
./start-node.sh -a Alice
Start Alice (boot node) and purge all user data in services components:
./start-node.sh -a Alice -p
Start Bob (boot node) that connects to Alice:
./start-node.sh -a Bob -c Alice
Expand All @@ -61,6 +62,7 @@ bootnode=
node_name=
account_name=
telemetry=0
purge_userdata=0
dry_run=0

while [[ "$1" != "" ]]; do
Expand All @@ -76,6 +78,8 @@ while [[ "$1" != "" ]]; do
;;
-t | --telemetry ) telemetry=1
;;
-p | --purge-userdata ) purge_userdata=1
;;
-d | --dry-run ) dry_run=1
;;
-h | --help ) usage
Expand Down Expand Up @@ -129,6 +133,13 @@ if [[ "$telemetry" = "1" ]]; then
arg_telemetry=" --telemetry-url ${TELEMETRY_URL}"
fi

if [[ "$purge_userdata" = "1" ]]; then
echo "Purging user data in services..."
curl -X DELETE http://services.kilt-prototype.tk:3000/ctype
curl -X DELETE http://services.kilt-prototype.tk:3000/messaging
curl -X DELETE http://services.kilt-prototype.tk:3000/contacts
fi

command="./target/debug/node --chain ${CHAIN_NAME} --validator --port 30333 --ws-port 9944 --ws-external --rpc-external${arg_account_name}${arg_node_key}${arg_boot_node_connect}${arg_node_name}${arg_telemetry}"

if [[ "$dry_run" = "1" ]]; then
Expand Down

0 comments on commit d5b9e9c

Please sign in to comment.