Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: uxBLN01 on September 19, 2022, 09:23:28 AM



Title: How to add a node in regtest mode via GUI?
Post by: uxBLN01 on September 19, 2022, 09:23:28 AM
Hi guys,

I am in the regtest mode via the GUI of bitcoincore. How can I add here an extra node so I am able to send him a fresh mined block and check if he receives it?
Any help here to solve this issue ?

Thanks.


Title: Re: How to add a node in regtest mode via GUI?
Post by: joniboini on September 19, 2022, 09:55:33 AM
If you want to test sending some coins to others, wouldn't testnet be preferable? AFAIK regtest is a local network and you can just create a new address to generate new coins to see whether a block is created successfully or not and so on. If you want to connect two clients to it, maybe run one in a sandbox while others run normally. I'm also a newbie on this stuff by the way, so wait for others to give you some tips. CMIIW.

This might help you: https://bitcointalk.org/index.php?topic=5268794.0.


Title: Re: How to add a node in regtest mode via GUI?
Post by: NotATether on September 19, 2022, 10:28:46 AM
AFAIK, there is currently no way to send RPC calls from the GUI. So it is only possible using a terminal and bitcoin-cli.

Assuming you have two different regtest nodes running on the same machine (it will suffice to give them different P2P ports, RPC ports, and data dirs), all you have to do, is connect the second node to the first one using bitcoin-cli addnode:

Code:
bitcoin-cli --port=xxxx --rpcport=yyyy addnode aaa.bbb.ccc.ddd

Replace aaa.bbb.ccc.ddd with the IP address of the second node, and the (p2p) port and RPC port respectively.


Title: Re: How to add a node in regtest mode via GUI?
Post by: nc50lc on September 19, 2022, 12:27:10 PM
I am in the regtest mode via the GUI of bitcoincore. How can I add here an extra node so I am able to send him a fresh mined block and check if he receives it?
Any help here to solve this issue ?
I have a working setup of 3 Bitcoin-qt (GUI) Regtest in the same machine, I start them separately using these command line options:
Node1:
Code:
bitcoin-qt --regtest --port=8330 --datadir="E:\AppData\Bitcoin-altdir1
Node2:
Code:
bitcoin-qt --regtest --connect=127.0.0.1:8330 --datadir="E:\AppData\Bitcoin-altdir2
Node3:
Code:
bitcoin-qt --regtest --connect=127.0.0.1:8330 --datadir="E:\AppData\Bitcoin-altdir3

Basically, the three regtest nodes should have different data directories (existing directory) and using the same port.
Second, third and additional nodes have to be set to connect to localhost.