Bitcoin core: connect to specific peers from file

1

1

I want to launch Bitcoin core connecting to a specific list of peers. I can do this using connect:

bitcoind -connect=<IP1> -connect=<IP2>

Is there a way I can put the peers I want to connect to into a file and give this file to bitcoind as input?

Sergei Tikhomirov

Posted 2018-06-13T10:18:43.097

Reputation: 1 189

You can put them in the bitcoin.conf file, but I'm guessing that's not what you mean. Simply multiple lines with: connect=IPJannes 2018-06-13T10:49:48.270

@Jannes "put them in the bitcoin.conf file" -- why not? Will the effect be as described?Sergei Tikhomirov 2018-06-13T11:03:02.590

Yeah it will work fine. I was just assuming you were getting some computer generated dynamic list from somewhere.Jannes 2018-06-14T01:02:26.070

Answers

3

Within the data directory for your coin (/dir/for/yourcoin/.yourcoin) you will have a configuration file. Within this configuration file, you will want to place the line connect=IP ADDRESS:PORT

This will make your client automatically attempt to establish a connection with the node(s) you specify.

Example: within myaltcoin.conf place the line connect=192.168.49.50:9332 Obviously just substitute your desired IP address and port.

apt-getschwifty

Posted 2018-06-13T10:18:43.097

Reputation: 153