Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
Siegrift committed Oct 20, 2023
1 parent 54bd030 commit 6a281fe
Showing 1 changed file with 74 additions and 15 deletions.
89 changes: 74 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,70 @@ simplified and only works with signed APIs.

## Configuration

Airseeker can be configured via a combination of [environment variables](#environment-variables) and
[configuration files](#configuration-files).

### Environment variables

For example:

```sh
# Defines a logger suitable for production.
LOGGER_ENABLED=true
LOG_COLORIZE=false
LOG_FORMAT=json
LOG_LEVEL=info
```

or

```sh
# Defines a logger suitable for local development or testing.
LOGGER_ENABLED=true
LOG_COLORIZE=false
LOG_FORMAT=json
LOG_LEVEL=info
```

#### `LOGGER_ENABLED`

Enables or disables logging. Options:

- `true` - Enables logging.
- `false` - Disables logging.

#### `LOG_FORMAT`

The format of the log output. Options:

- `json` - Specifies JSON log format. This is suitable when running in production and streaming logs to other services.
- `pretty` - Logs are formatted in a human-friendly "pretty" way. Ideal, when running the service locally and in
development.

#### `LOG_COLORIZE`

Enables or disables colors in the log output. Options:

- `true` - Enables colors in the log output. The output has special color setting characters that are parseable by CLI.
Recommended when running locally and in development.
- `false` - Disables colors in the log output. Recommended for production.

#### `LOG_LEVEL`

Defines the minimum level of logs. Logs with smaller level (severity) will be silenced. Options:

- `debug` - Enables all logs.
- `info` - Enables logs with level `info`, `warn` and `error`.
- `warn` - Enables logs with level `warn` and `error`.
- `error` - Enables logs with level `error`.

### Configuration files

Airseeker needs two configuration files, `airseeker.json` and `secrets.env`. All expressions of a form `${SECRET_NAME}`
are referring to values from secrets and are interpolated inside the `airseeker.json` at runtime. You are advised to put
sensitive information inside secrets.

### `sponsorWalletMnemonic`
#### `sponsorWalletMnemonic`

The mnemonic of the wallet used to derive sponsor wallets. Sponsor wallets are derived for each dAPI separately. It is
recommended to interpolate this value from secrets. For example:
Expand All @@ -27,7 +86,7 @@ recommended to interpolate this value from secrets. For example:
"sponsorWalletMnemonic": "${SPONSOR_WALLET_MNEMONIC}",
```

### `chains`
#### `chains`

A record of chain configurations. The record key is the chain ID. For example:

Expand All @@ -44,61 +103,61 @@ A record of chain configurations. The record key is the chain ID. For example:
}
```

#### `contracts` _(optional)_
##### `contracts` _(optional)_

A record of contract addresses used by Airseeker. If not specified, the addresses are loaded from
[Airnode protocol v1](https://github.com/api3dao/airnode-protocol-v1).

##### Api3ServerV1 _(optional)_
###### Api3ServerV1 _(optional)_

The address of the Api3ServerV1 contract. If not specified, the address is loaded from the Airnode protocol v1
repository.

#### `providers`
##### `providers`

A record of providers. The record key is the provider name. Provider name is only used for internal purposes and to
uniquely identify the provider for the given chain.

##### `providers[<NAME>]`
###### `providers[<NAME>]`

A provider configuration.

###### `url`
`url`

The URL of the provider.

#### `__Temporary__DapiDataRegistry`
##### `__Temporary__DapiDataRegistry`

The data needed to make the requests to signed API. This data will in the future be stored on-chain in a
`DapiDataRegistry` contract. For the time being, they are statically defined in the configuration file.

##### `airnodeToSignedApiUrl`
###### `airnodeToSignedApiUrl`

A mapping from Airnode address to signed API URL. When data from particular beacon is needed a request is made to the
signed API corresponding to the beacon address.

##### `dataFeedIdToBeacons`
###### `dataFeedIdToBeacons`

A mapping from data feed ID to a list of beacon data.

##### `dataFeedIdToBeacons<DATA_FEED_ID>`
###### `dataFeedIdToBeacons<DATA_FEED_ID>`

A single element array for a beacon data. If the data feed is a beacon set, the array contains the data for all the
beacons in the beacon set (in correct order).

###### `dataFeedIdToBeacons<DATA_FEED_ID>[n]`
`dataFeedIdToBeacons<DATA_FEED_ID>[n]`

A beacon data.

`airnode`
`dataFeedIdToBeacons<DATA_FEED_ID>[n].airnode`

The Airnode address of the beacon.

`templateId`
`dataFeedIdToBeacons<DATA_FEED_ID>[n].templateId`

The template ID of the beacon.

### `deviationThresholdCoefficient`
#### `deviationThresholdCoefficient`

The global coefficient applied to all deviation checks. Used to differentiate alternate deployments. For example:

Expand Down

0 comments on commit 6a281fe

Please sign in to comment.