# Job Modules

## What is a CoopHive Module?

A CoopHive module is a git repository structured using predefined templates and inputs to run computational jobs on the network.

## How Are Modules Structured?

1. Create a git repository for your CoopHive module. The module's versions will be identified using their git tags.
2. 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.
3. Alternatively, use Go templates to set defaults and perform other template-related operations. Some examples can be found [here](https://github.com/orgs/CoopHive/repositories).

## Handling Inputs

Inputs are passed to your CoopHive module as a key/value pairs. For example:

```bash
hive run github.com/username/repo:tag -i Message=moo
```

## Tips for Deterministic Outputs

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

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.co-ophive.network/creating-jobs/build-a-job-module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
