Farmerbot is a service that a farmer can run allowing him to automatically manage the nodes of his farm.
- Make sure to start redis server, and get redis DB address for example: localhost:6379
sudo systemctl start redis-server
- Create a new json file
config.json
and add your farm, nodes and power configurations:
{
"farm": {
"id": "<your farm ID>"
},
"nodes": [{
"id": "<your node ID>",
"twinID": "<your node twin ID>",
"resources": {
"total": {
"SRU": "<enter total sru>",
"MRU": "<enter total mru>",
"HRU": "<enter total hru>",
"CRU": "<enter total cru>"
}
}
}],
"power": {
"periodicWakeUp": "08:30AM",
"wakeUpThreshold": 80
}
}
- Get the binary
Download the latest from the releases page
- Run the bot
After downloading the binary
sudo cp farmerbot /usr/local/bin
farmerbot -c config.json -m <mnemonics> -n dev -r <redis address> -d false -l farmerbot.log
Where:
-c config.json
is the json file of farmerbot configurations, with a defaultconfig.json
.-m <mnemonics>
is your farm mnemonics.-n dev
is your network and can be main, qa and test with a defaultdev
.-r <redis address>
is your redis DB address.-d false
is the value of debug mode with a defaultfalse
.-l farmerbot.log
is log file to include logs generated by farmerbot with a defaultfarmerbot.log
.
Note:
30 minutes
are set for a timeout node power change
You can start farmerbot server with the following command
farmerbot server -m <mnemonics> -n <grid network> -r <redis address> -d <debug> -l <log file>
-
farmerbot powermanager configure
-
farmerbot nodemanager define
-
farmerbot farmmanager define
-
farmerbot powermanager poweron
-
farmerbot powermanager poweroff
-
farmerbot nodemanager findnode
For more examples and explanations for supported commands, see the examples
To run examples:
- Run the server then:
go run examples/example.go
You can get the latest version of the farmerbot by running the following command:
farmerbot version
make test
- Check
goreleaser check
- Create a tag
git tag -a v1.0.1 -m "release v1.0.1"
- Push the tag
git push origin v1.0.1
- A goreleaser workflow will release the created tag.