core-lightning/lightningd
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 common: remove unused io_lock.c 2021-12-06 10:05:39 +10:30
.gitignore Ignore all the deamon inside the git history 2021-10-28 15:51:38 +02:00
bitcoind.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
bitcoind.h common: use bitcoin_outpoint. 2021-10-15 12:09:36 +02:00
chaintopology.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
chaintopology.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
channel_control.c daemons: remove unused functions or make static. 2021-12-06 10:05:39 +10:30
channel_control.h daemons: remove unused functions or make static. 2021-12-06 10:05:39 +10:30
channel_state.h channel-state: add two new states, for dualopend 2021-01-10 13:44:04 +01:00
channel.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
channel.h common: use bitcoin_outpoint. 2021-10-15 12:09:36 +02:00
closing_control.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
closing_control.h lightningd/closing_control.c: move json_close here from peer_control.c 2021-09-15 18:23:30 +02:00
coin_mvts.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
coin_mvts.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
connect_control.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
connect_control.h daemons: remove unused functions or make static. 2021-12-06 10:05:39 +10:30
datastore.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
dual_open_control.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
dual_open_control.h openingd/dualopend: remove send_msg functionality. 2021-06-03 16:16:34 +09:30
gossip_control.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
gossip_control.h gossipd: get fed the blockheight from lightningd when we know it. 2019-09-25 04:01:56 +00:00
hsm_control.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
hsm_control.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
htlc_end.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
htlc_end.h htlcs: add flag to 'fail immediately' 2021-10-23 12:59:13 +02:00
htlc_set.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
htlc_set.h Makefile: use completely separate spec-derived files for EXPERIMENTAL_FEATURES 2020-09-08 09:42:00 +09:30
invoice.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
invoice.h Makefile: use completely separate spec-derived files for EXPERIMENTAL_FEATURES 2020-09-08 09:42:00 +09:30
io_loop_with_timers.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
io_loop_with_timers.h lightningd/io_loop_with_timers.c: Move mainloop to its own source file, have chaintopology use it. 2019-05-31 17:57:10 +02:00
json.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
json.h common: hoist param_bitcoin_address where plugins can use it. 2020-08-11 08:39:24 +09:30
jsonrpc.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
jsonrpc.h lightningd: cleanup, freeing jsonrpc in shutdown cannot trigger db write's anymore 2021-11-30 13:34:44 +10:30
lightningd.c Set default port according to network 2021-12-06 17:10:08 +10:30
lightningd.h memleak: make notleak use the tal name instead of a boutique struct. 2021-11-27 10:38:13 +10:30
log_status.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
log_status.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
log.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
log.h log: don't leak log prefixes. 2021-11-27 10:38:13 +10:30
Makefile gossipd: remove gossip_msg.[ch] 2021-12-06 10:05:39 +10:30
memdump.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
memdump.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
notification.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
notification.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
offer.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
onchain_control.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
onchain_control.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
onion_message.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
onion_message.h common: remove support for pre v0.10.2 onionmessages. 2021-12-01 05:44:28 +10:30
opening_common.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
opening_common.h common: use bitcoin_outpoint. 2021-10-15 12:09:36 +02:00
opening_control.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
opening_control.h openingd/dualopend: remove send_msg functionality. 2021-06-03 16:16:34 +09:30
options.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
options.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
pay.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
pay.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
peer_control.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
peer_control.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
peer_htlcs.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
peer_htlcs.h db: Add groupid to HTLCs 2021-10-13 13:41:18 +10:30
ping.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
ping.h ping: complete JSON RPC ping commands even if one ping gets no response. 2018-09-14 22:11:23 +02:00
plugin_control.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
plugin_control.h plugins: add command field to subcommand output. 2021-06-25 09:49:33 +09:30
plugin_hook.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
plugin_hook.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
plugin.c daemons: remove unused functions or make static. 2021-12-06 10:05:39 +10:30
plugin.h daemons: remove unused functions or make static. 2021-12-06 10:05:39 +10:30
routehint.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
routehint.h invoice: overhaul routehints to use topology.listincoming, cleanup. 2021-06-16 10:29:17 +09:30
signmessage.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
subd.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
subd.h lightningd: don't send other messages until we've received version. 2021-04-24 13:56:58 +09:30
watch.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
watch.h common: use bitcoin_outpoint. 2021-10-15 12:09:36 +02:00