Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Noob_Is_Relative on May 06, 2022, 06:03:14 PM



Title: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: Noob_Is_Relative on May 06, 2022, 06:03:14 PM
Hello All,

I hope you all are safe and enjoying . . .

This is my first time configuring bisq.network to use as my DEX on Windows 11. I have backed up the directory, written my seed words, and have my passphrase.

Now I am looking at TWO NODES, that is, my BTC Full  Node, that  bisq.network recognizes and utilizes, as well as the option for Bisq DAO Full Node (network settings).

Question 1:

Bisq needs to ensure that in my BTC node, that:
bloom filters are enabled: peerbloomfilters=1 in bitcoin.conf AND that pruning is disabled: prune=0 in bitcoin.conf.

How do I check this? I cannot find bitcoin.conf and I cannot find a console command that could give me these confirmations.

Question 2:

I want to turn on Bisq Full Node in Settings. I need to enable RPC. bisq.network documentation gives me these parameters:


# The default rpcPort for regtest from Bitcoin Core 0.16 and higher is: 18443
# The default rpcPort for testnet is: 18332
# For mainnet: 8332
[regtest]
peerbloomfilters=1
rpcport=18443

Question 2:

Since I intend to use mainnet only, will it be sufficient to open 8332 mainnet port (in my router port forwarding config.) ONLY?  [I also see that the default rpc port for regtest for Bitcoin Core is the same as the rpcport, which is a little confusing].

What I’m not understanding is reciprocity, that is, what my running a bisq full node has to do with my use versus the uses of others. So that if I open the mainnet port only does that mean that I am preventing others from using regtest and testnet?

So again, open all ports or only what I need?

Side questions: Resources? Will I benefit the bisq network if I run a full node? FYI, I run BTC Core 24/7 to support the blockchain, not to use the wallet. If it helps, I'd like to do the same for bisq regardless of whether this DEX even works for me as an exchange.

Many thanks!





Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: BlackHatCoiner on May 06, 2022, 07:15:27 PM
How do I check this? I cannot find bitcoin.conf and I cannot find a console command that could give me these confirmations.
Your bitcoin.conf should be in:
Code:
C:\Users\<YourUsername>\AppData\Roaming\Bitcoin

Unless you set another during the installation.

Since I intend to use mainnet only, will it be sufficient to open 8332 mainnet port (in my router port forwarding config.) ONLY?
Yes, although you could avoid port forwarding by just relaying your node's info from Tor. Bisq routes your activity through Tor by default.

[I also see that the default rpc port for regtest for Bitcoin Core is the same as the rpcport, which is a little confusing].
The default RPC port for regtest is 18444 as far as I can see (https://github.com/bitcoin/bitcoin/blob/59ac8bacd573891d84e8ab96ff43ea12bd266f26/src/chainparams.cpp#L428), but you can change it in the configuration file.
Code: ("bitcoin.conf")
[regtest]
rpcport=XXXX

What I’m not understanding is reciprocity, that is, what my running a bisq full node has to do with my use versus the uses of others.
You will run your own node, and connect to it from Bisq, for your own good. It reduces your threat model as it preserves you privacy.


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: o_e_l_e_o on May 07, 2022, 11:09:06 AM
Will I benefit the bisq network if I run a full node?
Yes, you will.

If you are running a full Bisq node, then every time your node receives a block, Bisq will find all the BSQ transactions within that block and broadcast those BSQ transactions across the Bisq network. Your node can also respond to requests from other users not running full nodes for information regarding BSQ transactions. Essentially, even if you aren't actively trading on Bisq, your node helps to keep Bisq decentralized. Just as if even if you aren't making transactions with bitcoin, your node helps to keep bitcoin decentralized.

You can read more about it here: https://docs.bisq.network/dao-technical-overview.html#infrastructure


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: Noob_Is_Relative on May 07, 2022, 08:06:36 PM
Great! This is what I need to know. I will read the link. Whether it's the BTC CORE or the bisq DEX, I want to support decentralization regardless of whether bisq fits my use case for trading or not.


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: Noob_Is_Relative on May 07, 2022, 08:30:26 PM
How do I check this? I cannot find bitcoin.conf and I cannot find a console command that could give me these confirmations.
Your bitcoin.conf should be in:
Code:
C:\Users\<YourUsername>\AppData\Roaming\Bitcoin

THANK YOU FOR THIS. I have located my bitcoin.conf file. To my surprise, it had 0 bytes! From this I infer that default configurations do not get written to bitcoin.conf, ONLY user defined configurations--and I haven't defined any yet. I went to  https://en.bitcoin.it/wiki/Running_Bitcoin    (https://en.bitcoin.it/wiki/Running_Bitcoin) and there I discovered that
Quote
All command-line options (except for -conf) may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file. The configuration file is a list of setting=value pairs, one per line, with optional comments starting with the '#' character. The configuration file is not automatically created; you can create it using your favorite plain-text editor. By default, Bitcoin (or bitcoind) will look for a file named 'bitcoin.conf' in the bitcoin data directory 

The key point here is that I can use a text editor to edit bitcoin.conf and save there OR I can input from Console and write a configuration to bitcoin.conf I did download Vim but I've never used a text editor and it seems to be a lot of work only to set t(he two Core configurations that bisq requires. So I want to use the console to write these configurations to the bitcoin.conf file: (a) peerbloomfilters=1 and (b) prune=0    I have searched  and I cannot find the syntax, lots of general tutorials but little on syntax for specific configurations from the console. Can you help me with this syntax to write these configs. from the console?

Your other responses regarding bisq ports, I'm still working on and will get back. Roughly, I don't understand Tor and port forwarding. I decided to take the bisq documentation at face value. In my router I enabled ports for reg test, testnet, and mainnet. When I get bitcoin.conf configuration correct for bisq.network, then I'll turn on bisq's Full Node and see what happens and get back to you on that.



Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: n0nce on May 07, 2022, 11:13:52 PM
The key point here is that I can use a text editor to edit bitcoin.conf and save there OR I can input from Console and write a configuration to bitcoin.conf I did download Vim but I've never used a text editor and it seems to be a lot of work only to set the two Core configurations that bisq requires.
It's actually very easy. You can just use Notepad.exe for this. Right-click and 'open with...' Notepad.

So I want to use the console to write these configurations to the bitcoin.conf file: (a) peerbloomfilters=1 and (b) prune=0    I have searched  and I cannot find the syntax
You just write the two things into the file, one per line. You can see my Bitcoin Core config here (https://bitcointalk.org/index.php?topic=5366854.msg58233711#msg58233711) in step 6 when it comes to the syntax / format of this file. Though I obviously don't have the bloomfilters setting that seems to be required for Bisq.

Your other responses regarding bisq ports, I'm still working on and will get back. Roughly, I don't understand Tor and port forwarding. I decided to take the bisq documentation at face value. In my router I enabled ports for reg test, testnet, and mainnet. When I get bitcoin.conf configuration correct for bisq.network, then I'll turn on bisq's Full Node and see what happens and get back to you on that.
You don't need to open ports if using Tor, since Tor basically tunnels everything. That's one of my favourite aspects about it; no need to set port rules, no need for static IP and of course no risk of open ports in the router's firewall.


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: ABCbits on May 08, 2022, 11:26:30 AM
So I want to use the console to write these configurations to the bitcoin.conf file: (a) peerbloomfilters=1 and (b) prune=0    I have searched  and I cannot find the syntax
You just write the two things into the file, one per line. You can see my Bitcoin Core config here (https://bitcointalk.org/index.php?topic=5366854.msg58233711#msg58233711) in step 6 when it comes to the syntax / format of this file. Though I obviously don't have the bloomfilters setting that seems to be required for Bisq.

I just tried Jameson Lopp's config generator[1] and found out where it should be located[2]. Prune is disabled by default, so there's no need to add prune=0 manually.

Code:
# Generated by https://jlopp.github.io/bitcoin-core-config-generator/

# This config should be placed in following path:
# ~/.bitcoin/bitcoin.conf

# [network]
# Support filtering of blocks and transactions with bloom filters.
peerbloomfilters=1


# [Sections]
# Most options automatically apply to mainnet, testnet, and regtest networks.
# If you want to confine an option to just one network, you should add it in the relevant section.
# EXCEPTIONS: The options addnode, connect, port, bind, rpcport, rpcbind and wallet
# only apply to mainnet unless they appear in the appropriate section below.

# Options only for mainnet
[main]

# Options only for testnet
[test]

# Options only for regtest
[regtest]

[1] https://jlopp.github.io/bitcoin-core-config-generator (https://jlopp.github.io/bitcoin-core-config-generator)
[2] https://jlopp.github.io/bitcoin-core-config-generator/#config=eyJuZXR3b3JrIjp7InBlZXJibG9vbWZpbHRlcnMiOjF9fQ== (https://jlopp.github.io/bitcoin-core-config-generator/#config=eyJuZXR3b3JrIjp7InBlZXJibG9vbWZpbHRlcnMiOjF9fQ==)


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: n0nce on May 08, 2022, 01:41:58 PM
I just tried Jameson Lopp's config generator[1] and found out where it should be located[2]. Prune is disabled by default, so there's no need to add prune=0 manually.
That's right; but as his own website says, this file will be completely sufficient:

Code:
peerbloomfilters=1

You don't need all those sections if they're empty anyway, and the [network] section is just for legibility anyways.

For example, the config in my full node install guide has no sections at all:
[5] Create Bitcoin config file
Code:
mkdir ~/.bitcoin
nano ~/.bitcoin/bitcoin.conf

[6] Fill it like follows:
Code:
daemon=1
server=1
maxmempool=50
mempoolexpiry=2
rpcauth=user_chose_in_step_4:hash_created_in_step_4
dbcache=2048
banscore=10
datadir=/home/bitcoin/.bitcoin/


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: Noob_Is_Relative on May 08, 2022, 02:37:53 PM
The key point here is that I can use a text editor to edit bitcoin.conf and save there.

It's actually very easy. You can just use Notepad.exe for this. Right-click and 'open with...' Notepad.

I DOWNLOADED notepad.exe from the Microsoft Store. I then navigated to my bitcoin.conf file and right-clicked on it and selected "open with notepad." I then entered my parameters, one per line. When I saved, I see that my file now has changed its name because it's associated with notebad but it's still a .conf file and it's in the same location. I also see from properties that it has ~ 27 bytes (from the new text) whereas before it had none. IS THERE ANYWAY TO DETERMINE if these new config. changes are operational, just in case I made a mistake?


You don't need to open ports if using Tor, since Tor basically tunnels everything. That's one of my favourite aspects about it; no need to set port rules, no need for static IP and of course no risk of open ports in the router's firewall.

This appears as a contradiction. If bisq.network runs Tor by default, why does its documentation specify ports for mainnet, etc. Is it just a FYI that Tor uses these ports and that they do not need to be set manually? Compare this with BTC Core and 8113. If I don't set that port trigger in my router I will not have a Full Node as my "in" will be zero. And since bisq.network uses the BTC blockchain for verification, I think that setting that port is mandatory.

As a side question, do I have to do any configuration for Tor or is the process completely automated? And thanks for your help.



 Prune is disabled by default, so there's no need to add prune=0 manually.


OP: I messed up the text badly. Sorry. THANKS for pointing out that prune is disabled by default.


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: n0nce on May 08, 2022, 02:48:56 PM
You don't need to open ports if using Tor, since Tor basically tunnels everything. That's one of my favourite aspects about it; no need to set port rules, no need for static IP and of course no risk of open ports in the router's firewall.

This appears as a contradiction. If bisq.network runs Tor by default, why does its documentation specify ports for mainnet, etc. Is it just a FYI that Tor uses these ports and that they do not need to be set manually?

If you mean the following port specification, it's just referring to a local Bitcoin Core install (on the same machine).
If you're running a Bitcoin full node on the same machine as Bisq, Bisq should connect to your node on startup—it will look for Bitcoin Core or bitcoind running on localhost on port 8333.

It's not a contradiction; you don't need to open a port when using Tor. Tor tunnels the traffic and you're reachable simply by your Tor v3 address. These are even briefly mentioned a few lines later:
Bisq v1.7.4 and later releases support connecting to Bitcoin nodes with Tor v3 addresses.

Compare this with BTC Core and 8113. If I don't set that port trigger in my router I will not have a Full Node as my "in" will be zero. And since bisq.network uses the BTC blockchain for verification, I think that setting that port is mandatory.
If you run Bitcoin Core over clearnet and don't open your port, you won't get incoming connections, right. Besides this not being a big issue, that's exactly what I'm trying to say: clearnet nodes need opened firewall ports, while Tor nodes do not.
You actually don't need to open this port at all; Bitcoin Core works without it, by connecting 'outbound'. This just means someone can't initiate a connection towards you, but your node can connect to others and the two nodes will exchange Bitcoin messages just the same. You will still get the full blockchain, transactions and can verify everything. Bisq should work just fine with Bitcoin Core only having outbound connections.

As a side question, do I have to do any configuration for Tor or is the process completely automated? And thanks for your help.
I'm pretty sure you do need some configuration; there's no automated Tor setup. I would link to my own full node setup guide, but for simplicity, I had written it in a way that puts Bitcoin Core on clearnet (with closed ports) and everything else (electrs, Core Lightning) on Tor.


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: Noob_Is_Relative on May 08, 2022, 05:11:57 PM
You don't need to open ports if using Tor, since Tor basically tunnels everything. That's one of my favourite aspects about it; no need to set port rules, no need for static IP and of course no risk of open ports in the router's firewall.

This appears as a contradiction. If bisq.network runs Tor by default, why does its documentation specify ports for mainnet, etc. Is it just a FYI that Tor uses these ports and that they do not need to be set manually?

If you mean the following port specification, it's just referring to a local Bitcoin Core install (on the same machine).
If you're running a Bitcoin full node on the same machine as Bisq, Bisq should connect to your node on startup—it will look for Bitcoin Core or bitcoind running on localhost on port 8333.

It's not a contradiction; you don't need to open a port when using Tor. Tor tunnels the traffic and you're reachable simply by your Tor v3 address. These are even briefly mentioned a few lines later:
Bisq v1.7.4 and later releases support connecting to Bitcoin nodes with Tor v3 addresses.

YOUR CLARIFICATIONS are appreciated. While we are on the topic of Tor ports being routed automatically versus the clearnet instance of BTC Core, I need to ask you about a problem! Now that I am running bisq.network in DAO Full Node I am seeing > 10 outbound peers. BUT I receive an error messge that says that my environment is blocking Tor inbound. How do I enable Tor inbound? The error message mentioned VM as a possiblility but I'm not running a VM. I have checked bisq documentation and I cannot find details on this item.

Compare this with BTC Core and 8113. If I don't set that port trigger in my router I will not have a Full Node as my "in" will be zero. And since bisq.network uses the BTC blockchain for verification, I think that setting that port is mandatory.
If you run Bitcoin Core over clearnet and don't open your port, you won't get incoming connections, right. Besides this not being a big issue, that's exactly what I'm trying to say: clearnet nodes need opened firewall ports, while Tor nodes do not.
You actually don't need to open this port at all; Bitcoin Core works without it, by connecting 'outbound'. This just means someone can't initiate a connection towards you, but your node can connect to others and the two nodes will exchange Bitcoin messages just the same. You will still get the full blockchain, transactions and can verify everything. Bisq should work just fine with Bitcoin Core only having outbound connections.

As a side question, do I have to do any configuration for Tor or is the process completely automated? And thanks for your help.
I'm pretty sure you do need some configuration; there's no automated Tor setup. I would link to my own full node setup guide, but for simplicity, I had written it in a way that puts Bitcoin Core on clearnet (with closed ports) and everything else (electrs, Core Lightning) on Tor.


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: Noob_Is_Relative on May 08, 2022, 05:14:07 PM
@nOnce

My response is embedded and I don't know if you'll see it:

YOUR CLARIFICATIONS are appreciated. While we are on the topic of Tor ports being routed automatically versus the clearnet instance of BTC Core, I need to ask you about a problem! Now that I am running bisq.network in DAO Full Node I am seeing > 10 outbound peers. BUT I receive an error messge that says that my environment is blocking Tor inbound. How do I enable Tor inbound? The error message mentioned VM as a possiblility but I'm not running a VM. I have checked bisq documentation and I cannot find details on this item.


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: Noob_Is_Relative on May 09, 2022, 01:29:02 AM
OP: SOLVED  An inbound connection has showed up, after a few hours, with a lot of data, so I must have inbound!


Title: Re: Two Node Questions: (1) BTC Core + Bisq, (2) RPC and Bisq Full Node
Post by: n0nce on May 09, 2022, 10:40:51 AM
@nOnce

My response is embedded and I don't know if you'll see it:

YOUR CLARIFICATIONS are appreciated. While we are on the topic of Tor ports being routed automatically versus the clearnet instance of BTC Core, I need to ask you about a problem! Now that I am running bisq.network in DAO Full Node I am seeing > 10 outbound peers. BUT I receive an error messge that says that my environment is blocking Tor inbound. How do I enable Tor inbound? The error message mentioned VM as a possiblility but I'm not running a VM. I have checked bisq documentation and I cannot find details on this item.
Most guides on the web recommed to open Tor's control port so that Bitcoin Core can access it and set itself up (simplified explanation here), like this:
Now that Tor is installed, we need to edit the torrc file located in /etc/tor/. Navigate to it the traditional way, open it, and add the following lines into the file at the bottom:

Code:
SOCKSPort 9050
Log notice stdout
ControlPort 9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1
HiddenServiceDir /var/lib/tor/lnd/
HiddenServicePort 8080 127.0.0.1:8080

While this certainly works, it's also what was recommeded in the Core Lightning TOR install guide (https://github.com/ElementsProject/lightning/blob/master/doc/TOR.md), but I avoided it using a few other parameters in torrc and the lightningd config.
C-Lightning

[...]

[3] Below the other hidden service, add this info for Lightning.
Code:
HiddenServiceDir /var/lib/tor/lightningd_hidden_service/
HiddenServiceVersion 3
HiddenServicePort 9735 127.0.0.1:9735

[4] Then restart Tor and retrieve the new v3 Tor hostname for your Lightning installation. Copy it somewhere so you have it handy in step 7.
Code:
sudo service tor restart
sudo cat /var/lib/tor/lightningd_hidden_service/hostname

[5] Log into bitcoin user and download + build Lightning. v0.10.1 needs to be set to the latest version.
Code:
su - bitcoin
git clone https://github.com/ElementsProject/lightning.git
cd lightning
git checkout v0.10.2
./configure
make -j $(nproc)

[6] Create Lightning config.
Code:
mkdir -p /home/bitcoin/.lightning/bitcoin
nano /home/bitcoin/.lightning/bitcoin/lightningd.conf

[7] Enter the following. Alias can be chosen at will! :) Replace onion_address_you_got with the hidden service hostname you got in step 4!
Code:
daemon
alias=alias_for_your_node
network=bitcoin
log-level=debug
log-file=/home/bitcoin/.lightning/debug.log

# incoming via tor
bind-addr=127.0.0.1:9735
announce-addr=onion_address_you_got.onion

# outgoing via tor
proxy=127.0.0.1:9050
always-use-proxy=true

[...]

Something similar should be possible for Bitcoin Core as well, but I haven't yet tried it.