2020-03-11 09:00:13 -07:00
|
|
|
#!/bin/bash
|
|
|
|
# Submits a list of blocks, one per line in the file, to darksidewalletd.
|
2020-05-04 17:11:13 -07:00
|
|
|
# Usage: ./submitblocks.sh <sapling activation> <file>
|
|
|
|
# e.g. ./submitblocks.sh 1000 blocks.txt
|
|
|
|
#
|
2020-03-11 09:00:13 -07:00
|
|
|
set -e
|
2020-05-06 23:05:05 -07:00
|
|
|
test $# -ne 2 && { echo usage: $0 sapling-height blocks-file;exit 1;}
|
2020-03-11 09:00:13 -07:00
|
|
|
|
2020-05-04 17:11:13 -07:00
|
|
|
JSON="{\"saplingActivation\": $1, \"branchID\": \"2bb40e60\", \"chainName\": \"main\"}"
|
|
|
|
grpcurl -plaintext -d "$JSON" localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/SetMetaState
|
2020-03-11 09:00:13 -07:00
|
|
|
|
2020-05-04 17:11:13 -07:00
|
|
|
sed 's/^/{"block":"/;s/$/"}/' $2 |
|
|
|
|
grpcurl -plaintext -d @ localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/SetBlocks
|