Skip to content

Commit 7df3598

Browse files
committed
Merge bitcoindevkit#384: Pass bitcoind_rpc example name on the run recipe
47781d5 fix(example): pass `--example bitcoind_rpc` to `just run` recipe (Luis Schwab) Pull request description: The `just run` recipe in the examples won't work because it has no idea what binary it needs to run: ``` bdk_wallet/examples % just run error: a bin target must be available for `cargo run` error: Recipe `run` failed on line 25 with exit code 101 ``` This PR fixes it by passing `--example bitcoind_rpc` to `cargo run`. Also adds a `just help` command to display all possible arguments to the `bitcoind_rpc` example. ACKs for top commit: ValuedMammal: ACK 47781d5 Tree-SHA512: 25eb2bd2d87b2debca74c8510dbdee3f762b1ab5b3c966764983932483bd25f382bddd99f006d3d1447826daa49e8fea9cb6ec6340edd6c0b1b4c5f7c92bcbd8
2 parents e078db2 + 47781d5 commit 7df3598

1 file changed

Lines changed: 35 additions & 13 deletions

File tree

examples/justfile

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,48 @@ default_wallet := 'test'
33
default_private := 'false'
44
default_testdata := 'test_data'
55

6-
# list of recipes
7-
default:
8-
just --list
6+
_default:
7+
just --list --unsorted
98

10-
# start regtest bitcoind in default test data directory
9+
# start a regtest bitcoind instance
10+
[group('bitcoind_rpc')]
1111
start:
12-
mkdir -p {{default_testdata}}/bitcoind; bitcoind -datadir={{default_testdata}}/bitcoind -regtest -server -fallbackfee=0.0002 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -blockfilterindex=1 -peerblockfilters=1 -daemon
13-
@echo "Regtest bitcoind process started with PID: $(cat {{default_testdata}}/bitcoind/regtest/bitcoind.pid)"
14-
15-
# stop regtest bitcoind
12+
mkdir -p {{default_testdata}}/bitcoind
13+
bitcoind \
14+
-datadir={{default_testdata}}/bitcoind \
15+
-regtest -server -fallbackfee=0.0002 \
16+
-rpcallowip=0.0.0.0/0 \
17+
-rpcbind=0.0.0.0 \
18+
-blockfilterindex=1 \
19+
-peerblockfilters=1 \
20+
-daemon
21+
@echo "started regtest bitcoind with PID $(cat {{default_testdata}}/bitcoind/regtest/bitcoind.pid)"
22+
23+
# stop the regtest bitcoind instance
24+
[group('bitcoind_rpc')]
1625
stop:
17-
bitcoin-cli -datadir={{default_testdata}}/bitcoind -regtest stop
26+
bitcoin-cli \
27+
-datadir={{default_testdata}}/bitcoind \
28+
-regtest \
29+
stop
30+
31+
# run the bitcoind_rpc example
32+
[group('bitcoind_rpc')]
33+
run:
34+
cargo run --example bitcoind_rpc -- \
35+
"wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/0/*)" \
36+
"wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/1/*)"
1837

19-
# delete all bdk_wallet and bitcoind test data
38+
# display help text for the bitcoind_rpc example
39+
[group('bitcoind_rpc')]
40+
help:
41+
cargo run --example bitcoind_rpc -- --help
42+
43+
# delete regtest bitcoind and wallet data
44+
[group('bitcoind_rpc')]
2045
clean:
2146
rm -rf {{default_testdata}}
2247

23-
# run the example
24-
run:
25-
cargo run -- "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/0/*)" "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/1/*)"
2648

2749
# create a regtest wallet
2850
[group('regtest')]

0 commit comments

Comments
 (0)