Job Modules
Last updated
Was this helpful?
Last updated
Was this helpful?
A CoopHive module is a git repository structured using predefined templates and inputs to run computational jobs on the network.
Create a git repository for your CoopHive module. The module's versions will be identified using their git tags.
In the module's repository, create a file named module.coophive
. This file will serve as a JSON template with Go text/template style sections, like {{.Message}}
, which will be replaced by CoopHive with JSON-encoded inputs.
Alternatively, use Go templates to set defaults and perform other template-related operations. Some examples can be found .
Inputs are passed to your CoopHive module as a key/value pairs. For example:
Try to follow the following recommendations to increase the chances that your CoopHive module will be deterministic:
Make the output of your module reproducible
Strip timestamps and time measurements from the output, including to stdout and stderr
Avoid reading from sources of entropy, such as /dev/random
When referencing Docker images, specify their sha256 hashes