You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #751: RPC doc generating script: always connect to regtest
a25cd3b RPC doc generating script: always connect to regtest (Sebastian Falbesoner)
Pull request description:
See Bitcoin Core PR bitcoin/bitcoin#20987, in particular the discussion bitcoin/bitcoin#20987 (comment).
The recommended network for generating RPC docs is regtest, as stated in the script's file header comments:
```// (2) install bitcoin core, set it up to use regtest```
To achieve this, the user previosly needed to manually put `regtest=1` into
`~/.bitcoin/bitcoin.conf` -- the script didn't specify a concrete network, so
without config file setting, mainnet was used. With the change in this commit,
we will always connect to regtest by passing the `-regtest` option to the
`bitcoin-cli` invokation.
With this change, [harding's well-described way to use the script involving file editing via mighty vi(m)](bitcoin/bitcoin#20987 (comment)) will be reduced to just running the following commands:
```
$ bitcoind -regtest -daemon
$ go run generate.go
$ bitcoin-cli -regtest stop
```
Note that I'm far from a golang expert and just tried to wrap my head around variadic functions and slices. Prepending the arguments slice with the chainoption (`-regtest`) seemed the easiest solution to me, but curious to hear how a more "gothonic" (does that word exist?) approach would look like.
ACKs for top commit:
laanwj:
Tested ACK a25cd3b
Tree-SHA512: 566aeb6c13e35baef88b0aefe6445fbe90c1d4df1e8310a0a5e910dd947745f00e206705940ed3701bd6c763a425d23ffbbf0ea331dbde3dfe61d75b22ebee3c
0 commit comments