# 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="https://90165124-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmHu1qRdgJeHeQup4pe3R%2Fuploads%2FQtpaGQOTZkDw4mivCt0N%2Fimage.png?alt=media&#x26;token=7363fa07-e41a-46ce-a351-59c3a7462f61" 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`
