Multi crypto node setup, management and monitoring.
- 64-bit installation
- 3.10 or higher version of the Linux kernel (latest is recommended)
(If you run on VPS provider, which uses OpenVZ, setup requires at OpenVZ 7)
Run bellow commands as root.
- install unzip
- Ubuntu:
apt install unzip -y
- Ubuntu:
- download and unzip unit binary:
wget https://raw.githubusercontent.com/cryon-io/unit/master/install.sh -O /tmp/install.sh && sh /tmp/install.sh
- (optional) `unit help` # check help
- Prepare /etc/unit/unit.json configuration file
nano /etc/unit/unit.json
- for examples check out templates in this repository.
unit setup
# setups all nodes defined in unit.jsonunit start
# starts all nodes defined in unit.jsonunit info
# prints details about nodes and VPS
If you want to get latest unstable release you can use:
wget https://raw.githubusercontent.com/cryon-io/unit/master/install-prerelease.sh -O /tmp/install.sh && sh /tmp/install.sh
It is unit configuration file. Unit looks up for unit.json in following paths and in order:
- directory the unit is located in
- current working directory
/etc/unit/unit.json
You can specify swap space size in GB required for template, e.g. configuration for 2GB swap space:
...
"swap" : 2
...
Defaults to 0.
Swap is created/adjusted automatically when executed setup
command or manually by configure-swap
command.
unit update
# updates binary to latestunit auto-update [status|apply]
# shows status/applies auto update based on unit.json
You can specify "auto_update":true
in unit.json to enable auto updates on setup
These options are all passed to all nodes, but do not override node specific options.
-
"logLevel" : [string from below]
# level of unit log output (default is info)"trace"
"debug"
"info"
"warn"
"error"
-
"path": [fully qualified path]
# path where are nodes saved unless overridden by node options -
"global": { [options from below] }
# options available for all nodes"environment": [ "env1=val1" ]
# array of environment variables passed to all nodes, separated by comma # for list of supported env variables check out specific node docs"parameters": [ "par1=val1" ]
# array of parameters passed to all nodes, separated by comma # for list of supported params check out specific node docs"auto_updates" : "all"
# auto update option passed to all nodes as default valueoff
# no auto updatesnode
# auto update node binariesservice
# auto update node binaries and node container definitionall
# above + ans auto updates
-
"nodes" : [ { ... }, {...} ]
# array of nodes
"id": "node1"
# required unique node id"type": "node_type"
# required Node type from list of supported nodes"path": "fully qualified path"
# path where where to store node"environment": [...]
# similar to global "environment" but node specific"parameters": [...]
# similar to global "parameters" but node specific"auto_updates": "all"
# similar to global "auto_updates" but node specific"user": "user1"
# user under which to setup node"binds": [ "192.168.52.28:5001:5000" ]
# list of binds separated by comma # binds specified node ports to host ports # above example binds port 5000 of node to 192.168.52.28:5001"ans-branch": "master"
# uses specific branch of ans repository (defaults master)"node-branch": "master"
# uses specific branch of node repository (defaults master)
If you want to rerun from clean setup you can run prune command:
unit prune
# removes service definitions and data for all nodes from unit.jsonunit prune [node id]
# removes service definitions and data for selected node/s from unit.jsonunit prune-data
# removes data for all nodes rom unit.jsonunit prune-data [node id]
# removes data for selected node/s from unit.json
In case your node got into invalid state (e.g. blockchain corruption caused by power loss), you can reset it with:
unit reset-node
# resets all nodes from unit.json = 'stop' + 'prune-data' + 'setup' + 'start'unit reset-node [nodeId], [nodeId]
# resets selected nodes from unit.json = 'stop' + 'prune-data' + 'setup' + 'start'