How do I run two instances of bitcoind on the same linux machine with different conf files?

4

3

I want to run two instances of bitcoind on my machine.

I know my bitcoin.conf file is in ./bitcoin/bitcoin.conf, and I know (thanks to this thread) that I need to change my .conf file to point to different data dirs and RPC ports, etc.

However there is only one .conf file.

How do I go about pointing my second bitcoind instance to a new bitcoin.conf file? I copied the directory with the compiled code to a new directory, I am making the assumption that compiled code can be copied into another directory and it will work without problems.

bvpx

Posted 2013-10-04T02:18:54.893

Reputation: 1 052

Answers

4

Change the -datadir flag to a new absolute location. Each instance will follow the bitcoind.conf in their respective directory.

Anonymous

Posted 2013-10-04T02:18:54.893

Reputation: 891

There is little to no documentation on this topic, so I guess I'll just ask here: I specify a datadir flag by typing ./bitcoind -datadir /dir/location/here/, is that correct?bvpx 2013-10-04T14:54:49.680

That's correct.Anonymous 2013-10-05T04:22:10.020

./bitcoind -datadir=/dir/location/here/ don't forget the =Badr Bellaj 2017-12-06T23:49:27.850

3

Probably, better to add new user.

Simply create new user:

# adduser bitcoin1
# adduser bitcoin2
# su -l bitcoin1 -c 'bitcoind'
# su -l bitcoin2 -c 'bitcoind'

perpetuity

Posted 2013-10-04T02:18:54.893

Reputation: 131

1

How to run two instances with same wallet

sudo su -
./xcoind stop
cp -r .xcoin xcoin2

cat .xcoin/xcoin.conf
---
rpcport=3776
port=3777
---

vi ./xcoin2/xcoin.conf
---
rpcport=3876
port=3877
addnode=127.0.0.1:3777
---

./xcoind &
./xcoind -datadir=/root/xcoin2 &

fujicoin

Posted 2013-10-04T02:18:54.893

Reputation: 11