Skip to content

Commit

Permalink
Fix full node script (#41)
Browse files Browse the repository at this point in the history
Running service failed due to not exists dir.
  • Loading branch information
DarianShawn authored Oct 24, 2023
1 parent 6d9faa1 commit 60bcfd7
Showing 1 changed file with 33 additions and 36 deletions.
69 changes: 33 additions & 36 deletions docs/get-started/full-node-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,38 @@ Full node deployment of the Dogechain blockchain.
* wget:

```shell
$ DOGECHAIN_VERSION=$(wget -qO- https://api.github.com/repos/dogechain-lab/dbsc/releases/latest | grep tag_name | cut -d '"' -f 4 | cut -d 'v' -f 2)
$ wget -c https://github.com/dogechain-lab/dbsc/releases/download/v${DOGECHAIN_VERSION}/dogechain_${DOGECHAIN_VERSION}_linux_amd64.tar.gz
DOGECHAIN_VERSION=$(wget -qO- https://api.github.com/repos/dogechain-lab/dbsc/releases/latest | grep tag_name | cut -d '"' -f 4 | cut -d 'v' -f 2)
# You should check the binary architecture to meet your platform.
wget -c https://github.com/dogechain-lab/dbsc/releases/download/v${DOGECHAIN_VERSION}/geth_linux
```

* curl:

```shell
$ DOGECHAIN_VERSION=$(curl -s https://api.github.com/repos/dogechain-lab/dbsc/releases/latest | grep tag_name | cut -d '"' -f 4 | cut -d 'v' -f 2)
$ curl -OL https://github.com/dogechain-lab/dbsc/releases/download/v${DOGECHAIN_VERSION}/dogechain_${DOGECHAIN_VERSION}_linux_amd64.tar.gz
DOGECHAIN_VERSION=$(curl -s https://api.github.com/repos/dogechain-lab/dbsc/releases/latest | grep tag_name | cut -d '"' -f 4 | cut -d 'v' -f 2)
# You should check the binary architecture to meet your platform.
curl -OL https://github.com/dogechain-lab/dbsc/releases/download/v${DOGECHAIN_VERSION}/geth_linux
```

## copy binary to /usr/local/bin

```shell
$ tar -xvf dogechain_${DOGECHAIN_VERSION}_linux_amd64.tar.gz
$ cp dogechain /usr/local/bin/dogechain
$ chmod +x /usr/local/bin/dogechain
cp geth_linux /usr/local/bin/geth
chmod +x /usr/local/bin/geth
```

## Create system user

```shell
$ useradd -m -s /usr/sbin/nologin -d /var/lib/dogechain dogechain
useradd -m -s /usr/sbin/nologin -d /var/lib/dogechain dogechain
```

## Create Data Directory

```shell
$ mkdir -p /data/dbsc
$ mkdir -p /etc/dbsc
mkdir -p /data/dbsc
# set permission
$ chown -R dogechain:dogechain /data/dbsc
$ chown -R dogechain:dogechain /etc/dbsc
chown -R dogechain:dogechain /data/dbsc
```

## Copy genesis.json to etc directory
Expand Down Expand Up @@ -279,12 +278,12 @@ The bootnodes are hosted by the official network, and not yet set within the cod
Remember `daemon-reload` your system config and re-run your dbsc client, if you change the bootnodes or other configuration.

```shell
$ tee /etc/systemd/system/dbsc.service <<EOF
tee /etc/systemd/system/dbsc.service <<SERVICE_EOF
[Unit]
Description=Dogechain network with dbsc client
After=network.target
StartLimitIntervalSec=60
StartLimitIntervalSec=600
StartLimitBurst=5
[Install]
Expand All @@ -297,8 +296,8 @@ Restart=on-failure
RestartSec=5s
Type=simple
KillSignal=SIGINT
TimeoutStopSec=120
LimitNOFILE=65535
TimeoutStopSec=300
LimitNOFILE=26214000
LimitNPROC=65535
PrivateTmp=true
# MemoryMax setting replaces MemoryLimit in newer systemd versions
Expand All @@ -307,21 +306,19 @@ MemoryHigh=15G
# keep MemoryLimit for compatibility with older systemd versions
MemoryLimit=15G
WorkingDirectory=/var/lib/dbsc
ExecStart=/usr/local/bin/geth \
--datadir=/data/dbsc/data \
--genesis=/data/dbsc/genesis.json \
--syncmode=snap \
--gcmode=full \
--networkid=2000 \
--txlookuplimit=0 \
--txpool.pricelimit=250000000000 \
--miner.gasprice=250000000000 \
--miner.gaslimit=300000000 \
--bootnodes="enode://c2d67c2fc2bd060a77bc850430a87fd8847d689302f6447c1cfef1422e2d0d91607574d4a7707ca57c20c4ecc94b0561653f5ade5ed15065954479fcbb306eee@54.210.49.16:30303,enode://38bd46ce29743660e236db29f50e049d3973c93cea835effc4f3cc642aab4e80baf9960906adb742ff676e0047b332f112cf723864d07c87319a277bf420ccbe@44.207.147.216:30303"
EOF

WorkingDirectory=/data/dbsc/
ExecStart=/usr/local/bin/geth \\
--datadir=/data/dbsc/data \\
--genesis=/data/dbsc/genesis.json \\
--syncmode=snap \\
--gcmode=full \\
--networkid=2000 \\
--txlookuplimit=0 \\
--txpool.pricelimit=250000000000 \\
--miner.gasprice=250000000000 \\
--miner.gaslimit=300000000
SERVICE_EOF
```

> You need to append set `--nat` flag of `ExecStart` command if you’re in NAT network or gateway.
Expand All @@ -336,19 +333,19 @@ ExecStart= ......
### Start service

```shell
$ systemctl daemon-reload
$ systemctl enable dbsc
$ systemctl start dbsc
systemctl daemon-reload
systemctl enable dbsc
systemctl start dbsc
```

### Check service status

```shell
$ systemctl status dbsc
systemctl status dbsc
```

### Check service logs

```shell
$ journalctl -u dbsc
journalctl -u dbsc
```

0 comments on commit 60bcfd7

Please sign in to comment.