2. Follow these instructions
You need to have some external IP.
Download binaries for your platform on release page. Package includes Hub, Miner and cli, that’s
what you need to start working with SONM Network.
As first, you need to review hub.yaml config file. There are two configured endpoints: the first one
allows hosts to connect to your hub, and the second one allows you to connect to the hub using cli
and perform management operations;
Start the Hub on the machine with publicly-accessible IP address:
Similar to the Hub, the Miner has it own config file miner.yaml.
If the Hub has no publicly-available IP address or if you start all the SONM components into a local
network, you must explicitly set Hub's IP via endpoint parameter into the config file.
Ensure that docker daemon is started.
Miner must be started with escalated privileges because it needs to perform operations with docker
socket, cgroups, etc
In the new terminal window start the Miner:
Run your task:
Discover available Miners to start task:
./sonmcli --addr 127.0.0.1:10001 miner list
There is a list of connected miners:
Miner: 127.0.0.1:42572 Idle
Use miner's address as id to retrieve detailed statistic:
./sonmcli --addr 127.0.0.1:10001 miner status 127.0.0.1:42572
To start a task you need to write the description file. For demo purposes we will use minimal allowed task file, full version with comments can be found
You need to specify docker image name and resource requirements, then save task definition into file named task.yaml
Then just pass task file and miner address as arguments to task start command:
./sonmcli --addr 127.0.0.1:10001 task start 127.0.0.1:42572 task.yaml
An output shows ID assigned to task and exposed container ports:
Starting "httpd:latest" on miner 127.0.0.1:42572...
Now you can get some info about running tasks by its ID and Miner address:
./sonmcli --addr 127.0.0.1:10001 task status 127.0.0.1:42572 eb081f7d-bd1c-4d9b-976f-7674a293b199