-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·49 lines (40 loc) · 1.33 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
CURRENT_DIR="$(pwd)"
RPC_URL="http://devnet:devnet@localhost:1337/bitcoin-rpc"
DB_PATH="$CURRENT_DIR/test-db"
sub_start_example() {
cargo build --release
echo "Starting example"
echo "RPC_URL: $RPC_URL"
echo "DB_PATH: $DB_PATH"
rm -rf "$DB_PATH"
mkdir -p "$DB_PATH"
./target/release/txi_example_server --jsonrpc-import --network regtest --cookie "devnet:devnet" --daemon-rpc-url "http://127.0.0.1:1337/bitcoin-rpc/" --db-dir "$DB_PATH" -vvvv
}
sub_start_example2() {
cargo build --release
echo "Starting example"
echo "RPC_URL: $RPC_URL"
echo "DB_PATH: $DB_PATH"
rm -rf "$DB_PATH"
mkdir -p "$DB_PATH"
./target/release/txi_example_server --jsonrpc-import --network regtest --cookie "devnet:devnet" --daemon-rpc-url "http://127.0.0.1:1442/bitcoin-rpc/" --db-dir "$DB_PATH" -vvvv
}
sub_help() {
echo -e "Usage:\nStart an example server that jsonrpc-import's from http://devnet:devnet@localhost:1337/bitcoin-rpc\n./test.sh start_example\n"
}
subcommand=$1
case $subcommand in
"" | "-h" | "--help")
sub_help
;;
*)
shift
sub_${subcommand} $@
if [ $? = 127 ]; then
echo "Error: '$subcommand' is not a known subcommand." >&2
echo " Run '$ProgName --help' for a list of known subcommands." >&2
exit 1
fi
;;
esac