forked from cyclomancer/urbit-bitcoin-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
regtest-start.sh
executable file
·31 lines (27 loc) · 918 Bytes
/
regtest-start.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
#!/bin/bash
##########################
# Variables:
# DRIVE: location of the (probably external) drive holding a /BTC directory
##########################
DRIVE=/home/armitage/spiralext
# Start BTC first so that proxy can access BTC's .cookie file
# Sleep so that the .cookie file is generated
bitcoind -datadir="$DRIVE" -regtest -fallbackfee=0.0001 &
sleep 2
ELECTRS_DATADIR="$DRIVE"/electrs
COOKIE=$(cat "$DRIVE"/regtest/.cookie)
export BTC_RPC_COOKIE_PASS=${COOKIE:11}
export BTC_RPC_PORT=18332
export BTC_NETWORK=REGTEST
export ELECTRS_HOST=127.0.0.1
export ELECTRS_PORT=60401
export PROXY_PORT=50002
node src/server.js &
./electrs/target/release/electrs \
--timestamp \
--network regtest \
--cookie-file "$DRIVE"/regtest/.cookie \
--daemon-dir "$DRIVE" \
--db-dir $ELECTRS_DATADIR \
--daemon-rpc-addr "127.0.0.1:${BTC_RPC_PORT}" \
--electrum-rpc-addr $ELECTRS_HOST:$ELECTRS_PORT