Add scripts to assist with controlling darksidewalletd

This commit is contained in:
Taylor Hornby 2020-03-11 10:00:13 -06:00 committed by Larry Ruane
parent d258ee75b0
commit ccb7211712
2 changed files with 17 additions and 0 deletions

6
utils/pullblocks.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
# Usage: ./pullblocks.sh 500000 500100 > blocks.txt
for i in $(seq $1 $2); do
zcash-cli getblock $i 0
done

11
utils/submitblocks.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# Submits a list of blocks, one per line in the file, to darksidewalletd.
# Usage: ./submitblocks.sh <start height> <sapling activation> <file>
# e.g. ./submitblocks.sh 1000 1000 blocks.txt
set -e
JSON="{\"startHeight\": $1, \"saplingActivation\": $2, \"branchID\": \"2bb40e60\", \"chainName\": \"main\", \"blocks\": "
JSON="$JSON$(cat "$3" | sed 's/^/"/' | sed 's/$/"/' | sed '1s/^/[/;$!s/$/,/;$s/$/]/')"
JSON="$JSON}"
grpcurl -insecure -import-path ./walletrpc/ -proto service.proto -d "$JSON" localhost:9067 cash.z.wallet.sdk.rpc.CompactTxStreamer/DarksideSetState