Skip to main content

11. Node System Services

In this step you will configure, enable and start the xxnetwork-chain and xxnetwork-cmix systemd services.

About xxnetwork-chain.service

The service file for the xxnetwork-chain systemd service is the xxnetwork-chain.service file. It is located in /opt/xxnetwork/. In most cases, you will only need to modify the User and optionally add the --name flag.

Default xxnetwork-chain.service file
[Unit]
Description=Job that starts the xx network chain binary
After=local-fs.target network-online.target network.target
Wants=local-fs.target network-online.target network.target

[Service]
User=ubuntu
Type=simple

ExecStart=/bin/bash -c "/opt/xxnetwork/bin/xxnetwork-chain --validator --telemetry-url 'wss://telemetry.polkadot.io/submit/ 0' --base-path /opt/xxnetwork/db --port 15974 --ws-port 63007 >> /opt/xxnetwork/log/chain.log 2>&1"

LimitNOFILE=infinity
Restart=always
RestartSec=120

[Install]
WantedBy=multi-user.target

About xxnetwork-cmix.service

The service file for the xxnetwork-cmix systemd service is the xxnetwork-cmix.service file. It is located in /opt/xxnetwork/. In most cases, you will only need to modify the User.

Default xxnetwork-cmix.service file
[Unit]
Description=Job that starts the cmix Wrapper service
StartLimitIntervalSec=5
StartLimitBurst=10
After=local-fs.target network-online.target network.target
Wants=local-fs.target network-online.target network.target

[Service]
User=ubuntu
Type=simple

ExecStart=/opt/xxnetwork/cmix-wrapper.py \
--err-path /opt/xxnetwork/log/cmix-err.log \
--cmd-dir /opt/xxnetwork/log/cmix-cmd \
--wrapper-log /opt/xxnetwork/log/cmix-wrapper.log \
--binary-path /opt/xxnetwork/bin/xxnetwork-cmix \
--gpu-lib /opt/xxnetwork/lib/libpowmosm75.so \
--gpu-bin /opt/xxnetwork/lib/libpow.fatbin \
--config-path /opt/xxnetwork/config/cmix.yaml \
--id-path /opt/xxnetwork/cred/cmix-IDF.json \
--log-path /opt/xxnetwork/log/cmix.log \
--management-cert /opt/xxnetwork/cred/network-management.crt \
--s3-access-key KEY \
--s3-secret SECRET \
--s3-region us-west-1 \
--s3-management-bucket elixxir-management-mainnet \
--s3-bin-bucket elixxir-bins \
--cloudwatch-log-group xxnetwork-logs-mainnet \
--tmp-dir /tmp/xxnetwork/cmix/

LimitNOFILE=infinity
Restart=always

[Install]
WantedBy=multi-user.target

Confirm Username

The output of whoami is the username that must accompany the User setting.

whoami

Open xxnetwork-chain.service

nano /opt/xxnetwork/xxnetwork-chain.service

Set User

The default user in the service file is ubuntu. Change this to your username.

Set Name (Optional)

You can set a name for the blockchain node. To do so, between the --validator and --telemetry-url flags, add --name [name]. If you choose supernode as the name, you would add --name supernode. It is recommended names should be simple and not contain spaces or special characters.

Save xxnetwork-chain.service and Exit nano

Press Ctrl + s then Ctrl + x

Open xxnetwork-cmix.service

nano /opt/xxnetwork/xxnetwork-cmix.service

Set User

The default user in the service file is ubuntu. Change this to your username.

Save xxnetwork-cmix.service and Exit nano

Press Ctrl + s then Ctrl + x

sudo ln -s /opt/xxnetwork/xxnetwork-chain.service /etc/systemd/system
sudo systemctl daemon-reexec
sudo systemctl enable xxnetwork-chain.service
sudo systemctl start xxnetwork-chain.service
systemctl status xxnetwork-chain

The xxnetwork-chain.service should be Active: active (running) since [some day date and time]; [duration] ago.

sudo ln -s /opt/xxnetwork/xxnetwork-cmix.service /etc/systemd/system
sudo systemctl daemon-reexec
sudo systemctl enable xxnetwork-cmix.service
sudo systemctl start xxnetwork-cmix.service
systemctl status xxnetwork-cmix

The xxnetwork-cmix.service should be Active: active (running) since [some day date and time]; [duration] ago.