Prior to this commit, BisqExecutable has been responsible for parsing command line and config file options and BisqEnvironment has been responsible for assigning default values to those options and providing access to option values to callers throughout the codebase. This approach has worked, but at considerable costs in complexity, verbosity, and lack of any type-safety in option values. BisqEnvironment is based on the Spring Framework's Environment abstraction, which provides a great deal of flexibility in handling command line options, environment variables, and more, but also operates on the assumption that such inputs have String-based values. After having this infrastructure in place for years now, it has become evident that using Spring's Environment abstraction was both overkill for what we needed and limited us from getting the kind of concision and type saftey that we want. The Environment abstraction is by default actually too flexible. For example, Bisq does not want or need to have environment variables potentially overriding configuration file values, as this increases our attack surface and makes our threat model more complex. This is why we explicitly removed support for handling environment variables quite some time ago. The BisqEnvironment class has also organically evolved toward becoming a kind of "God object", responsible for more than just option handling. It is also, for example, responsible for tracking the status of the user's local Bitcoin node, if any. It is also responsible for writing values to the bisq.properties config file when certain ban filters arrive via the p2p network. In the commits that follow, these unrelated functions will be factored out appropriately in order to separate concerns. As a solution to these problems, this commit begins the process of eliminating BisqEnvironment in favor of a new, bespoke Config class custom-tailored to Bisq's needs. Config removes the responsibility for option parsing from BisqExecutable, and in the end provides "one-stop shopping" for all option parsing and access needs. The changes included in this commit represent a proof of concept for the Config class, where handling of a number of options has been moved from BisqEnvironment and BisqExecutable over to Config. Because the migration is only partial, both Config and BisqEnvironment are injected side-by-side into calling code that needs access to options. As the migration is completed, BisqEnvironment will be removed entirely, and only the Config object will remain. An additional benefit of the elimination of BisqEnvironment is that it will allow us to remove our dependency on the Spring Framework (with the exception of the standalone pricenode application, which is Spring-based by design). Note that while this change and those that follow it are principally a refactoring effort, certain functional changes have been introduced. For example, Bisq now supports a `--configFile` argument at the command line that functions very similarly to Bitcoin Core's `-conf` option. |
||
---|---|---|
.. | ||
docker | ||
src | ||
.dockerignore | ||
bisq-seednode.env | ||
bisq-seednode.service | ||
bitcoin.conf | ||
bitcoin.service | ||
blocknotify.sh | ||
create_jar.sh | ||
create_jaronly_archive.sh | ||
docker-compose.yml | ||
install_seednode_debian.sh | ||
README.md | ||
torrc | ||
uninstall_seednode_debian.sh |
Bisq Seed Node
Hardware
Highly recommended to use SSD! Minimum specs:
- CPU: 4 cores
- RAM: 8 GB
- SSD: 512 GB (HDD is too slow)
Software
The following OS are known to work well:
- Ubuntu 18
- FreeBSD 12
Installation
Start with a clean Ubuntu 18.04 LTS server installation, and run the script
curl -s https://raw.githubusercontent.com/bisq-network/bisq/master/seednode/install_seednode_debian.sh | sudo bash
This will install and configure Tor, Bitcoin, and Bisq-Seednode services to start on boot.
Firewall
Next, configure your OS firewall to only allow SSH and Bitcoin P2P
ufw allow 22/tcp
ufw allow 8333/tcp
ufw enable
Syncing
After installation, watch the Bitcoin blockchain sync progress
sudo tail -f /bitcoin/debug.log
After Bitcoin is fully synced, start the bisq-seednode service
sudo systemctl start bisq-seednode
sudo journalctl --unit bisq-seednode --follow
After Bisq is fully synced, check your Bitcoin and Bisq onion hostnames:
sudo -H -u bitcoin bitcoin-cli getnetworkinfo|grep address
sudo cat /bisq/bisq-seednode/btc_mainnet/tor/hiddenservice/hostname
Testing
After your Bisq seednode is ready, test it by connecting to your new btcnode and bisq-seednode!
macOS:
/Applications/Bisq.app/Contents/MacOS/Bisq --seedNodes=foo.onion:8000 --btcNodes=foo.onion:8333
Upgrading
To upgrade your seednode to a new tag, for example v1.2.5
sudo -u bisq -s
cd bisq
git fetch origin
git checkout v1.2.5 # new tag
./gradlew clean
./gradlew build -x test
exit
sudo service bisq-seednode restart
sudo journalctl --unit bisq-seednode --follow
Uninstall
If you need to start over, you can run the uninstall script in this repo
sudo ./delete_seednode_debian.sh
WARNING: this script will delete all data!