-
Notifications
You must be signed in to change notification settings - Fork 20
/
startRegtest.sh
executable file
·48 lines (32 loc) · 1.42 KB
/
startRegtest.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
#!/bin/bash
bitcoin_container='boltz-bitcoin'
bitcoin_config='--conf=/config/bitcoin.conf'
print_header() {
echo "------"
echo "Starting $1"
echo "------"
echo ""
}
print_header "Bitcoin Core"
echo "Creating container"
docker run -v `pwd`/docker:/config -d --name $bitcoin_container -p 18443:18443 boltz/bitcoin-core:28.0 $bitcoin_config > /dev/null
sleep 1
echo "Creating wallet"
docker exec $bitcoin_container bitcoin-cli --regtest $bitcoin_config createwallet default > /dev/null
echo ""
elements_container='boltz-elements'
elements_config='--conf=/config/elements.conf'
print_header "Elements Core"
echo "Creating container"
docker run -v `pwd`/docker:/config -d --name $elements_container -p 18884:18884 boltz/elements:23.2.4 $elements_config > /dev/null
sleep 1
echo "Creating wallet"
docker exec $elements_container elements-cli $elements_config createwallet default > /dev/null
echo "Generating block"
docker exec $elements_container elements-cli $elements_config -generate 1 > /dev/null
echo "Rescanning the chain"
docker exec $elements_container elements-cli $elements_config rescanblockchain > /dev/null
echo "Creating output"
address=$(docker exec $elements_container elements-cli $elements_config getnewaddress "" blech32)
docker exec $elements_container elements-cli $elements_config sendtoaddress $address 1 > /dev/null
docker exec $elements_container elements-cli $elements_config -generate 1 > /dev/null