# Fair Math Controller

`fairmathd` is an executable operating with the FairMath Net. This tool contains plenty of command to communicate with the blockchain infrastructure. See help command of the application to explore all functionality.

This is a central application for the FairMath actor which connects all parts of a system.&#x20;

<figure><img src="/files/Djt6tJ6e8uDqWD29vo0y" alt=""><figcaption></figcaption></figure>

Actor controller receives tasks from FairMath Net, prepare data for VM operating with IPFS and update result of execution. It is configured by a several config files.

Actors config typically located at the `~/.fairmath` directory and looks like this:

```
actor-id: 1
tx:
    owner: "actor-owner"
    gas-adjustment: 1.5
query:
  query-grpc-address: "testnet.computer.fairmath.xyz:9090"
orders:
    acquire-interval: 30s
    main-actor-ping: 1m0s
    backup-actor-ping: 1m0s
    min-price: 0fmth
    backup-min-price: 0fmth
ext-storage:
    ipfs:
      node-url: 167.235.197.94:5001
interpreter:
    path: /home/actor/path/to/vm

```

For correct work there should one more config file with correct parameters: `~/.fairmath/config/client.toml`

The most important sections are

* `query` - grpc address of a validator to perform query requests
* `interpreter.path` - a path to Fairmath Virtual Machine
* `ext-storage.ipfs.node-url` - address of IPFS node, be sure that kubo API is available, controller operates through this API

Its content usually looks like this:

```
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml

###############################################################################
###                           Client Configuration                            ###
###############################################################################

# The network chain ID
chain-id = "fairmath-tn1"
# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory)
keyring-backend = "test"
# CLI output format (text|json)
output = "text"
# <host>:<port> to CometBFT RPC interface for this chain
node = "https://testnet.computer.fairmath.xyz"
# Transaction broadcasting mode (sync|async)
broadcast-mode = "sync"

# gRPC server endpoint to which the client will connect.
# It can be overwritten by the --grpc-addr flag in each command.
grpc-address = "https://testnet.computer.fairmath.xyz:9090"
```

* `chain-id` - set the chain id. To operate with fairmath testnet use `fairmath-tn1`&#x20;
* `keyring-backend` - specify key storage backend, use test only for testnet because this backend keep all keys opened with no security.
* `node` - a validator address. You can use FairMath TestNet validators specifying the following URL: `https://testnet.computer.fairmath.xyz:9090`  &#x20;

It is convenient to configure actor as a daemon through `systemd`


---

# 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.fairmath.xyz/fhe-computer/fair-math-actor/fair-math-controller.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.
