seednode: remove some files, add dockerfile and readme with instructions

This commit is contained in:
erciccione 2022-07-08 09:33:14 +02:00 committed by woodser
parent 1512ed9db3
commit 1498423b4e
10 changed files with 41 additions and 240 deletions

View File

@ -1,95 +1,23 @@
# Bisq Seed Node
# Haveno Seednode
## Hardware
Currently a seednode can be deployed using the Dockerfile in the `docker/` folder.
Highly recommended to use SSD! Minimum specs:
Make sure you have Tor installed in your host environment (`apt install tor`), then navigate to the `docker` folder and from there build the Docker image:
* CPU: 4 cores
* RAM: 8 GB
* SSD: 512 GB (HDD is too slow)
## Software
The following OS's are known to work well:
* Ubuntu 18.04
* Ubuntu 20.04
* FreeBSD 12
### Installation
Start with a clean Ubuntu server installation, and run the script
```bash
curl -s https://raw.githubusercontent.com/bisq-network/bisq/master/seednode/install_seednode_debian.sh | sudo bash
```
docker build -t haveno-seednode .
```
This will install and configure Tor, Bitcoin, and Bisq-Seednode services to start on boot.
Then create a container from it:
### Firewall
Next, configure your OS firewall to only allow SSH and Bitcoin P2P
```bash
ufw allow 22/tcp
ufw allow 8333/tcp
ufw enable
```
docker run -it -p 9050 -p 2002 --restart unless-stopped --name haveno-seednode haveno-seednode
```
### Syncing
After the seednode is deployed, you'll see a message similar to this in the log:
After installation, watch the Bitcoin blockchain sync progress
```bash
sudo tail -f /bitcoin/debug.log
```
[TorControlParser] INFO o.b.n.tor.Tor: Hidden Service 3jrnfkgkoh463zic54csvntz5w62dm2zno54c3c6jgvusafosqrgmnqd.onion has been announced to the Tor network.
```
After Bitcoin is fully synced, start the bisq service
```bash
sudo systemctl start bisq
sudo journalctl --unit bisq --follow
```
After Bisq is fully synced, check your Bitcoin and Bisq onion hostnames:
```bash
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!
macOS:
```bash
/Applications/Bisq.app/Contents/MacOS/Bisq --seedNodes=foo.onion:8000 --btcNodes=foo.onion:8333
```
### Monitoring
If you run a main seednode, you also are obliged to activate the monitoring feed by running
```bash
bash <(curl -s https://raw.githubusercontent.com/bisq-network/bisq/master/monitor/install_collectd_debian.sh)
```
Follow the instruction given by the script and report your certificate to the seednode group!
### Upgrading
To upgrade your seednode to a new tag, for example v1.2.5
```bash
sudo -u bisq -s
cd bisq
git fetch origin
git checkout v1.2.5 # new tag
./gradlew clean build -x test
exit
sudo service bisq restart
sudo journalctl --unit bisq --follow
```
### Uninstall
If you need to start over, you can run the uninstall script in this repo
```bash
sudo ./delete_seednode_debian.sh
```
WARNING: this script will delete all data!
Note the onion address. It will be needed by the Haveno instances wanting to connect to your seednode.

View File

@ -1,21 +0,0 @@
server=1
daemon=1
listen=1
discover=1
txindex=1
dbcache=1337
maxconnections=1337
peerbloomfilters=1
onion=127.0.0.1:9050
rpcallowip=127.0.0.1
rpcuser=__BITCOIN_RPC_USER__
rpcpassword=__BITCOIN_RPC_PASS__
blocknotify=/bitcoin/blocknotify.sh %s
[main]
bind=127.0.0.1:8333
rpcbind=127.0.0.1:8332
[test]
bind=127.0.0.1:18333
rpcbind=127.0.0.1:18332

View File

@ -1,22 +0,0 @@
[Unit]
Description=Bitcoind
After=network.target
[Service]
ExecStart=/usr/local/bin/bitcoind -daemon -printtoconsole -pid=/bitcoin/bitcoind.pid
ExecStop=/usr/local/bin/bitcoin-cli stop
Type=forking
PIDFile=/bitcoin/bitcoind.pid
Restart=on-failure
User=bitcoin
Group=bitcoin
PrivateTmp=true
ProtectSystem=full
NoNewPrivileges=true
PrivateDevices=true
[Install]
WantedBy=multi-user.target

View File

@ -1,22 +0,0 @@
version: '2.1'
services:
seednode:
build:
context: .
dockerfile: docker/development/Dockerfile
image: bisq-seednode
ports:
- 8000:8000
environment:
- NODE_PORT=8000
- BASE_CURRENCY_NETWORK=XMR_STAGENET
- SEED_NODES=seednode:8000
- MY_ADDRESS=seednode:8000
- USE_LOCALHOST_FOR_P2P=true
volumes:
- m2:/root/.m2
volumes:
m2:
name: m2

View File

@ -0,0 +1,29 @@
# docker run -it -p 9050 -p 2002 --restart-policy unless-stopped --name haveno-seednode haveno-seednode
# TODO: image very heavy, but it's hard to significantly reduce the size without bins
FROM openjdk:11
RUN set -ex && \
apt update && \
apt --no-install-recommends --yes install \
make \
git \
tor
RUN set -ex && adduser --system --group --disabled-password haveno && \
mkdir -p /home/haveno && \
chown -R haveno:haveno /home/haveno
USER haveno
WORKDIR /home/haveno
RUN set -ex && git clone https://github.com/haveno-dex/haveno.git && \
cd haveno && \
make skip-tests
WORKDIR /home/haveno/haveno
ENTRYPOINT [ "./haveno-seednode" ]
CMD ["--baseCurrencyNetwork=XMR_STAGENET", "--useLocalhostForP2P=false", "--useDevPrivilegeKeys=false", "--nodePort=2002", "--appName=haveno-XMR_STAGENET_Seed_2002" ]

View File

@ -1,21 +0,0 @@
# bisq-seednode docker
Both images use the same [startSeedNode.sh](startSeedNode.sh) script so inspect it to see what environment variables you can tweak.
## Production image
In order to build image:
docker build . -f docker/prod/Dockerfile -t bisq/seednode
Run:
docker run bisq/seednode
You might want to mount tor hidden service directory:
docker run -v /your/tor/dir:/root/.local/share/seednode/btc_mainnet/tor/hiddenservice/ bisq/seednode
## Development image
docker-compose build

View File

@ -1,18 +0,0 @@
###
# WARNING!!! THIS IMAGE IS FOR D E V E L O P M E N T USE ONLY!
###
FROM openjdk:8-jdk
RUN apt-get update && apt-get install -y --no-install-recommends \
openjfx && rm -rf /var/lib/apt/lists/*
WORKDIR /bisq-seednode
CMD ./docker/startSeedNode.sh
ENV APP_NAME=seednode
ENV NODE_PORT=8000
EXPOSE 8000
COPY . .

View File

@ -1,16 +0,0 @@
FROM openjdk:8-jdk
RUN apt-get update && apt-get install -y --no-install-recommends \
openjfx && rm -rf /var/lib/apt/lists/*
WORKDIR /bisq-seednode
CMD ./docker/startSeedNode.sh
ENV APP_NAME=seednode
ENV NODE_PORT=8000
EXPOSE 8000
COPY . .
RUN ./docker/setup.sh
ENV SKIP_BUILD=true

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
if [ "$SKIP_BUILD" != "true" ]; then
./gradlew build
fi

View File

@ -1,31 +0,0 @@
#!/bin/bash
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
SETUP_SCRIPT=${SCRIPT_DIR}/setup.sh
source ${SETUP_SCRIPT}
ARGS=""
if [ ! -z "$BASE_CURRENCY_NETWORK" ]; then
ARGS="$ARGS --baseCurrencyNetwork=$BASE_CURRENCY_NETWORK"
fi
if [ ! -z "$MAX_CONNECTIONS" ]; then
ARGS="$ARGS --maxConnections=$MAX_CONNECTIONS"
fi
if [ ! -z "$NODE_PORT" ]; then
ARGS="$ARGS --nodePort=$NODE_PORT"
fi
if [ ! -z "$APP_NAME" ]; then
ARGS="$ARGS --appName=$APP_NAME"
fi
if [ ! -z "$SEED_NODES" ]; then
ARGS="$ARGS --seedNodes=$SEED_NODES"
fi
if [ ! -z "$BTC_NODES" ]; then
ARGS="$ARGS --btcNodes=$BTC_NODES"
fi
if [ ! -z "$USE_LOCALHOST_FOR_P2P" ]; then
ARGS="$ARGS --useLocalhostForP2P=$USE_LOCALHOST_FOR_P2P"
fi
JAVA_OPTS='-Xms1800m -Xmx1800m' ./build/app/bin/bisq-seednode $ARGS