Created
January 8, 2019 22:01
-
-
Save EncodePanda/bbfc3abfa14168f3ad5292ffde19d69d to your computer and use it in GitHub Desktop.
rchain_runtime_for_testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rn_stop() { | |
| echo "stop all existing rnode processes" | |
| kill $(ps aux | grep '[r]node' | awk '{print $2}') | |
| } | |
| rn_clean() { | |
| echo "clean .rnode folders" | |
| echo .rnode* | |
| rm -rf .rnode* | |
| echo "create bootstrap rnode folder" | |
| cp -R .example_rnode .rnode | |
| } | |
| rn_bootstrap() { | |
| echo "generate genesis" | |
| ~/projects/rchain/node/target/universal/stage/bin/rnode run -s --no-upnp --host 127.0.0.1 & | |
| sleep 10 | |
| rn_stop | |
| echo "running bootstrap standalone as validator" | |
| array=($(ls ~/.rnode/genesis | grep .sk)) | |
| let index=$1+1 | |
| publickey=$array[$index] | |
| privatekey=$( cat ~/.rnode/genesis/$publickey ) | |
| let port=10400 | |
| let grpcport=10401 | |
| let grpcportinternal=10402 | |
| let httpport=10403 | |
| let discoveryport=10404 | |
| ~/projects/rchain/node/target/universal/stage/bin/rnode --grpc-port $grpcport --grpc-port-internal $grpcportinternal run -s --validator-private-key $privatekey --host 127.0.0.1 --port $port --http-port $httpport --kademlia-port $discoveryport --no-upnp | |
| } | |
| rn_validator() { | |
| bootstrap="rnode://[email protected]?protocol=10400&discovery=10404" | |
| echo "running validator nr" $1 "bootstrapping from" $bootstrap | |
| array=($(ls ~/.rnode/genesis | grep .sk)) | |
| let index=$1+1 | |
| publickey=$array[$index] | |
| privatekey=$( cat ~/.rnode/genesis/$publickey ) | |
| let "modifier=$1*10000" | |
| let "port=$modifier+10400" | |
| let "grpcport=$modifier+10401" | |
| let "grpcportinternal=$modifier+10402" | |
| let "httpport=$modifier+10403" | |
| let "discoveryport=$modifier+10404" | |
| ~/projects/rchain/node/target/universal/stage/bin/rnode --grpc-port $grpcport --grpc-port-internal $grpcportinternal run -b $bootstrap --validator-private-key $privatekey --host 127.0.0.1 --data-dir ~/.rnode$1 --port $port --http-port $httpport --kademlia-port $discoveryport --no-upnp | |
| } | |
| rn_deploy_propose() { | |
| let "modifier=${3-0}*10000" | |
| let "grpcport=$modifier+10401" | |
| let "grpcportinternal=$modifier+10402" | |
| let "rounds=${2-1}" | |
| for i in {1..$rounds} | |
| do | |
| echo "deploy-propose [$i / $rounds]" | |
| ~/projects/rchain/node/target/universal/stage/bin/rnode --grpc-port $grpcport --grpc-port-internal $grpcportinternal deploy --phlo-limit 100000000 --phlo-price 1 ~/projects/rchain/rholang/examples/$1 | |
| ~/projects/rchain/node/target/universal/stage/bin/rnode --grpc-port $grpcport --grpc-port-internal $grpcportinternal propose | |
| done | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment