<p>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</p>

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

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

CC BY-SA 4.0
2018-06-13T16:54:45.407Z
2018-06-13T17:00:33.280Z
2018-06-13T17:00:33.280Z
apt-getschwifty
<p>I want to launch Bitcoin core connecting to a specific list of peers. I can do this using <code>connect</code>:</p>

<p><code>bitcoind -connect=&lt;IP1&gt; -connect=&lt;IP2&gt;</code></p>

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

CC BY-SA 4.0
2018-06-13T10:49:48.270Z
You can put them in the bitcoin.conf file, but I'm guessing that's not what you mean. Simply multiple lines with: connect=IP
Jannes
CC BY-SA 4.0
2018-06-13T11:03:02.590Z
@Jannes "put them in the bitcoin.conf file" -- why not? Will the effect be as described?
Sergei Tikhomirov
CC BY-SA 4.0
2018-06-14T01:02:26.070Z
Yeah it will work fine. I was just assuming you were getting some computer generated dynamic list from somewhere.
Jannes
<bitcoin-core><bitcoind><peers>
Bitcoin core: connect to specific peers from file
Sergei Tikhomirov
# Bitcoin core: connect to specific peers from file

(Asked by: username_0 on 2018-06-13)

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?

**Tags:** bitcoin-core, bitcoind, peers

> **Comments:**
> **username_1**: You can put them in the bitcoin.conf file, but I'm guessing that's not what you mean. Simply multiple lines with: connect=IP  
> **username_0**: @username_1 "put them in the bitcoin.conf file" -- why not? Will the effect be as described?  
> **username_1**: Yeah it will work fine. I was just assuming you were getting some computer generated dynamic list from somewhere.  

---

## 1 answers

### Answer by username_2 on 2018-06-13. Score: 3 | Accepted answer

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.


---

