Author

Topic: running both bitcoin-abc and bitcoin core on the same machine (Read 272 times)

copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
thank you all! especially to jackg and LoyceV.

sorry, don't mean to get down to this level, but I get this error when running su to switch accounts in terminal (Mac OS X):  

Code:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

1) any idea how to get rid of it? I've tried to edit my sudo file with sudo visudo, a tip I found by googling, but it doesn't seem to help.

2) also, do you have to set the program files to have different names? e.g. how can I call bitcoin-cli and bitcoind for the two different implementations if they have the same name?!


Can you post your debug.log after running that command again and getting that error? I need to know a bit more. Also, once using the su command, did you run the whoami command to check it had changed your user correctly?
HCP
legendary
Activity: 2086
Merit: 4361
ok, so an update:
I tried running bitcoind (abc) and in spite of setting my datadir in bitcoin.conf file which I specified ... it tried to hijack the original datadir. thanks HCP.
I ended up running it with both the conf and datadir arguments.
any idea why that's the case? shouldn't I be able to use just the conf file to specify the datadir?
The issue is that the .conf file is located IN the "datadir"... so if you have a custom datadir, how is the application supposed to find the .conf file if it doesn't already know where the datadir is? Wink

Using the -datadir commandline argument when running bitcoind (or bitcoin-cli or bitcoin-qt) will let them find the custom datadir and therefore the .conf file at startup and read the appropriate parameters from that.


HCP, you set listen=0 in your config file for both? is that compatible with running mainnet?
No, I just leave the listen command out completely... It is the same as having the "Allow Incoming connections" UNCHECKED in the GUI option (ie. listen=1 is the same as enabling the "Allow Incoming connections" option). It just means that other nodes are not able to connect to your machine to retrieve block data, transactions etc.

It does not affect your ability to run on mainnet... it just makes your node more of a "leech" than a "seed".
newbie
Activity: 4
Merit: 0
ok, so an update:
I tried running bitcoind (abc) and in spite of setting my datadir in bitcoin.conf file which I specified ... it tried to hijack the original datadir. thanks HCP.
I ended up running it with both the conf and datadir arguments.
any idea why that's the case? shouldn't I be able to use just the conf file to specify the datadir?

waiting for the solution from jackg / others on the su issue. I will try that too! 

for anyone else wondering how I did it, I specified the installation folders with
Code:
./configure --prefix=$HOME --exec-prefix=$HOME

then I created a new folder for where Application Support/Bitcoin would go instead, /Bitcoin-abc and specified them while running bitcoind and in the conf files.
lastly, I created symlinks for $HOME/bitcoind into $PATH using ln -s:
Code:
ln -s /Users/homeuser/bin/bitcoind /usr/local/bin/bitcoind-abc
ln -s /Users/homeuser/bin/bitcoin-cli /usr/local/bin/bitcoinabc-cli


test it by
Code:
$ which bitcoind-abc
/usr/local/bin/bitcoind-abc
$ which bitcoinabc-cli
/usr/local/bin/bitcoinabc-cli



hope this helps others out there.
any comments on blind spots/improvements in this jerry-rigged version very welcome!
newbie
Activity: 4
Merit: 0
Quote
I can run both GUIs at the same time without issue. I don't use "-listen=1", so because I don't have incoming connections, I don't think having the same "port" is a problem. If you needed to use "listen=1" to accept incoming connections, I could see this being a potential issue.


HCP, you set listen=0 in your config file for both? is that compatible with running mainnet?
thank you!!
newbie
Activity: 4
Merit: 0
thank you all! especially to jackg and LoyceV.

sorry, don't mean to get down to this level, but I get this error when running su to switch accounts in terminal (Mac OS X):  

Code:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

1) any idea how to get rid of it? I've tried to edit my sudo file with sudo visudo, a tip I found by googling, but it doesn't seem to help.

2) also, do you have to set the program files to have different names? e.g. how can I call bitcoin-cli and bitcoind for the two different implementations if they have the same name?!

in the meantime, I'll try what HCP suggested to install bitcoin-abc to a different install directory.

thank you all!!

HCP
legendary
Activity: 2086
Merit: 4361
Has anyone here done that?
Yes. I run both Bitcoin Core and BitcoinABC on the same computer (Windows 10 Pro x64)... As an aside, I have also run Bitcoin Gold on this machine.


Quote
What should we be looking out for or should take note of specifically to make sure it all goes smoothly? All tips are appreciated. From some research, I know the datadir's and the port's used to map to the same place, but I don't know if this is still the case,
and what about the files installed themselves, do they map to the same directories and how should we re-work the code? ie. Can we run both daemons at the same time?
Be VERY CAREFUL when you install BitcoinABC. As you already know, it WILL attempt to hijack the datadir... and YES it WILL attempt to install itself over Bitcoin Core

That is to say, BitcoinABC will attempt, by default, to install to C:\Program Files\Bitcoin
and it will attempt, by default, to use the datadir C:\Users\YOURUSER\AppData\Roaming\Bitcoin

You CAN make it use it's own locations... you just need to be very careful when installing to specify a different install directory and when running the clients to ensure that you use the appropriate -datadir arguments when launching the apps (I modified the shortcut for Bitcoin ABC).

I can run both GUIs at the same time without issue. I don't use "-listen=1", so because I don't have incoming connections, I don't think having the same "port" is a problem. If you needed to use "listen=1" to accept incoming connections, I could see this being a potential issue.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Make two extra admin user profiles on your computer. One called "Bitcoin", the other called "BitcoinABC".
I'm not a Windows user, but if this means running software with Admin privilages, I wouldn't recommend it.
You don't have to run the software as admin, you just have to get an administrator's permission in order to run stuff without admin rights (mostly). It is simpler to run all as an admin but not necessary.

Or, in linux, running command by a different user than your own using a similar SU console command.
This is actually very easy:
Code:
loyce@desktop:~$ sudo xhost si:localuser:test3
[sudo] password for loyce:
localuser:test3 being added to access control list
loyce@desktop:~$ su - test3
Password:
test3@desktop:~$ xeyes
Yes it is quite a nice solution

Using a different user account is an overkill solution
Using a different account ensures untrusted software like BitcoinABC can't instantly access other data, although I'd prefer a VM for this.
What if OP can't run a vm? I can't on some of my computers, they need a certain virtualisation enhanced CPU (or something) to make them work.

Using a different user account is an overkill solution and it won't fix the port issue either. And it won't solve the problem for a beginner user that will have to switch users, mostly using sudo, leading to other worst problems (if you can't handle a single -datadir or -config flag properly, I'm not really confident that he will manage its system properly).

The SU command is different from sudo.
su-- is sudo.
su is merely switch user.
su jackg takes me to a user account called jackg (after inputting my password).
full member
Activity: 198
Merit: 130
Some random software engineer
Using a different user account is an overkill solution
Using a different account ensures untrusted software like BitcoinABC can't instantly access other data, although I'd prefer a VM for this.

You have lxc containers (docker) for this.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Make two extra admin user profiles on your computer. One called "Bitcoin", the other called "BitcoinABC".
I'm not a Windows user, but if this means running software with Admin privilages, I wouldn't recommend it.

Or, in linux, running command by a different user than your own using a similar SU console command.
This is actually very easy:
Code:
loyce@desktop:~$ sudo xhost si:localuser:test3
[sudo] password for loyce:
localuser:test3 being added to access control list
loyce@desktop:~$ su - test3
Password:
test3@desktop:~$ xeyes

Using a different user account is an overkill solution
Using a different account ensures untrusted software like BitcoinABC can't instantly access other data, although I'd prefer a VM for this.
full member
Activity: 198
Merit: 130
Some random software engineer
Can you reread my whole post?
If you use two user accounts, the default data directory will be put in a different appdata/roaming place or a different /home/%user%/.Bitcoin. Thus, there will be no collisions and there won't be an attempt to load the wrong block database and corrupt it.

Using a different user account is an overkill solution and it won't fix the port issue either. And it won't solve the problem for a beginner user that will have to switch users, mostly using sudo, leading to other worst problems (if you can't handle a single -datadir or -config flag properly, I'm not really confident that he will manage its system properly).
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
The datadir thing might not work so well unless you run it with that command every time (sometimes they regress or pick up the wrong config file).

Using a different datadir is mandatory as both Bitcoin & BitcoinABC are using both $HOME/.bitcoin on Unices & %APPDATA%\Bitcoin on Windows. Not using a custom directory for one of the 2 daemons will make one not starting, and will lead to confusion and corruption.

Can you reread my whole post?
If you use two user accounts, the default data directory will be put in a different appdata/roaming place or a different /home/%user%/.Bitcoin. Thus, there will be no collisions and there won't be an attempt to load the wrong block database and corrupt it.
full member
Activity: 198
Merit: 130
Some random software engineer
The datadir thing might not work so well unless you run it with that command every time (sometimes they regress or pick up the wrong config file).

Using a different datadir is mandatory as both Bitcoin & BitcoinABC are using both $HOME/.bitcoin on Unices & %APPDATA%\Bitcoin on Windows. Not using a custom directory for one of the 2 daemons will make one not starting, and will lead to confusion and corruption.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Make two extra admin user profiles on your computer. One called "Bitcoin", the other called "BitcoinABC".

Use these accounts to run the relevant wallets (put the bitcoin-qt file in the desktop of each so you won't be tempeted to open it in the wrong one) and you should be good to go without any issues.

If you use the "switch user" commands for these accounts then they should both still be functioning in the background.

Or, in linux, running command by a different user than your own using a similar SU console command.

Change the dadtadir and the port and you should be good to go, or better still, run the BCash node in a VM.
While a vm is a good idea, it will slow you down a bit.
The datadir thing might not work so well unless you run it with that command every time (sometimes they regress or pick up the wrong config file).
sr. member
Activity: 322
Merit: 363
39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD
Change the dadtadir and the port and you should be good to go, or better still, run the BCash node in a VM.
newbie
Activity: 4
Merit: 0
Has anyone here done that?

What should we be looking out for or should take note of specifically to make sure it all goes smoothly? All tips are appreciated. From some research, I know the datadir's and the port's used to map to the same place, but I don't know if this is still the case,

and what about the files installed themselves, do they map to the same directories and how should we re-work the code? ie. Can we run both daemons at the same time?
I'm a tech noob here, but 200% willing to learn and figure it all out. 

Thanks in advance!!
Jump to: