-
Notifications
You must be signed in to change notification settings - Fork 9
Docker Setup
Robin Syihab edited this page Mar 5, 2021
·
4 revisions
Cara tercepat menjalankan Nuchain node selain menggunakan prebuilt binary bisa menggunakan Docker. Berikut adalah cara-cara menjalankan Nuchain Node menggunakan Docker.
Pull latest Nuchain docker image:
$ docker pull anvie/nuchain:latest-alpine
Menjalankan:
$ docker run --rm \
-v '/var/data/nuchain:/data' \
-p '9933:9933' \
-p '9944:9944' \
-p '30333:30333' \
--name nuchain anvie/nuchain:latest-alpine \
nuchain --base-path=/data \
--ws-external \
--rpc-external \
--rpc-methods=Unsafe
Apabila ingin menjalankan docker container sebagai servis bisa menggunakan konfigurasi systemd berikut:
# Systemd service configuration for Nuchain docker container.
# edit as you wish.
[Unit]
Description=Nuchain Node Container
After=docker.service
Requires=docker.service
[Service]
Type=simple
Restart=always
RestartSec=5
StartLimitBurst=5
LimitNOFILE=10000
ExecStartPre=-/usr/bin/docker stop nuchain
ExecStartPre=-/usr/bin/docker rm nuchain
ExecStart=/usr/bin/docker run --rm -v '/var/data:/data' -p '9933:9933' -p '9944:9944' -p '30333:30333' --name nuchain anvie/nuchain:latest-alpine nuchain --validator --base-path=/data --ws-external --rpc-external --rpc-methods=Unsafe
Simpan konfigurasi di atas ke file /etc/systemd/system/nuchain.service
lalu ketikkan:
$ systemctl systemctl daemon-reload
$ systemctl start nuchain