Skip to content

farmerbot is a service that a farmer can run allowing him to automatically manage the nodes of his farm.

License

Notifications You must be signed in to change notification settings

rawdaGastan/farmerbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Farmerbot

Codacy Badge gopherbadger-tag-do-not-edit

Farmerbot is a service that a farmer can run allowing him to automatically manage the nodes of his farm.

How to start farmerbot

  • 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 default config.json.
  • -m <mnemonics> is your farm mnemonics.
  • -n dev is your network and can be main, qa and test with a default dev.
  • -r <redis address> is your redis DB address.
  • -d false is the value of debug mode with a default false.
  • -l farmerbot.log is log file to include logs generated by farmerbot with a default farmerbot.log.

Note: 30 minutes are set for a timeout node power change

Server

You can start farmerbot server with the following command

farmerbot server -m <mnemonics> -n <grid network> -r <redis address> -d <debug> -l <log file>

Supported commands

For more examples and explanations for supported commands, see the examples

Examples

To run examples:

go run examples/example.go

Version

You can get the latest version of the farmerbot by running the following command:

farmerbot version

Test

make test

Release

  • 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.

About

farmerbot is a service that a farmer can run allowing him to automatically manage the nodes of his farm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published