rgb-cln/bitcoin
Jan Sarenik 96f28323bd Set default port according to network
The idea is to have different default ports for different networks.

Current default port is `9735` for everything. Let's use it for
the mainnet and reuse the difference added to the default port
from `rpc_port` values in `bitcoin/chainstate.c`.

Testnet would be `19735` (adding rpc_port - 8332 = `10000`).

Signet would be `39735` (adding rpc_port - 8332 = `30000`).

Regtest would be `19846` (adding rpc_port - 8332 = `10111`).

With Vincenzo's kind pair-programming help over tmate.

Two other commits were squashed into this one so that bisecting
never ends up in half-baked state:

1. chainparams: Fix regtest default rpc_port

   bitcoind -help says this:

    -rpcport=<port>
         Listen for JSON-RPC connections on <port> (default: 8332, testnet:
         18332, signet: 38332, regtest: 18443)

2. test_gossip: Default port for regtest

   hex: 2607 is now .... (could be 4d86 but Elements uses another port)
   dec: 9735 is now any port (could be 19846 ^^ but now is for any port)

   The lines which were binding to default port were removed as the
   default port is different on each network.

NOTE: Remember not to modify gossip_store tests which loads everything raw
      including the checksums.

Changelog-Changed: If the port is unspecified, the default port is chosen according to used network similarly to Bitcoin Core.
2021-12-06 17:10:08 +10:30
..
test bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
Makefile Makefile: make check-includes check all the non-generated files. 2020-10-22 12:14:34 +10:30
README
address.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
base58.c bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
base58.h bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
block.c bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
block.h bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
chainparams.c Set default port according to network 2021-12-06 17:10:08 +10:30
chainparams.h bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
feerate.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
feerate.h feerate: remove duplicate method 2020-10-20 14:27:19 +10:30
locktime.c bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
locktime.h bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
preimage.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
preimage.h wire: move towire/fromwire_preimage out to bitcoin/preimage.c. 2020-05-18 14:51:12 +02:00
privkey.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
privkey.h wire: move remaining bitcoin functions out to bitcoin/ files. 2020-05-18 14:51:12 +02:00
psbt.c bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
psbt.h bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
pubkey.c bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
pubkey.h bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
script.c bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
script.h bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
shadouble.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
shadouble.h wire: move remaining bitcoin functions out to bitcoin/ files. 2020-05-18 14:51:12 +02:00
short_channel_id.c bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
short_channel_id.h bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
signature.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
signature.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
tx.c bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
tx.h bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
tx_parts.c check-includes: allow redundant "config.h" 2021-02-04 12:02:36 +10:30
tx_parts.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
varint.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
varint.h varint: Add helper function for getting varlen size 2019-10-10 05:57:45 +00:00

README

These are standard bitcoin manipulation routines which should be
provided by any normal bitcoin library in whatever language you choose.

The ones here are standalone ones taken from bitcoin core and some I
wrote, many taken from bitcoin-iterate and pasted in here.