Skip to content

Commit

Permalink
Fixed broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
Olshansk committed Apr 10, 2024
1 parent 8af6461 commit cb12dd8
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 55 deletions.
13 changes: 6 additions & 7 deletions docusaurus/docs/develop/packages/client_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ sidebar_position: 2
- [Features](#features)
- [Usage (`EventsQueryClient`)](#usage-eventsqueryclient)
- [Basic Example](#basic-example)
- [Advanced Usage](#advanced-usage)
- [Advanced Usage - Query Client](#advanced-usage---query-client)
- [Configuration](#configuration)
- [Usage (`EventsReplayClient`)](#usage-eventsreplayclient)
- [Basic Usage](#basic-usage)
- [Advanced Usage](#advanced-usage-1)
- [- Replay Client](#--replay-client)
- [Best Practices](#best-practices)
- [FAQ](#faq)
- [Why use `events` over directly using Gorilla WebSockets?](#why-use-events-over-directly-using-gorilla-websockets)
Expand Down Expand Up @@ -238,7 +238,7 @@ for eitherEvent := range observer.Ch() {
}
```

### Advanced Usage
### Advanced Usage - Query Client

```go
// Given some custom dialer & connection implementation, e.g.:
Expand Down Expand Up @@ -359,19 +359,18 @@ lastEventType = latestEventsObs.Last(ctx, 1)[0]
cancel()
```

### Advanced Usage
### - Replay Client

The `EventsReplayClient` can be lightly wrapped to define a custom client for
a respective type. Examples of these include the `client.BlockClient` and
`client.DelegationClient` interfaces which under-the-hood are wrappers for the
`EventsReplayClient`.

:::danger
TODO: Update links for BlockClient and DelegationClient when they are added to the documentation.
TODO(@bryanchriswhite): Update links for BlockClient and DelegationClient when they are added to the documentation.
:::

See: [BlockClient](#TODO) and
[DelegationClient](#TODO) for more detailed examples
See: **BlockClient** and **DelegationClient** for more detailed examples
on how to wrap and use the `EventsReplayClient` in a more advanced setting.

## Best Practices
Expand Down
95 changes: 56 additions & 39 deletions docusaurus/docs/operate/configs/relayminer_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: RelayMiner config
sidebar_position: 1
---

## `relayer/config/relayminer_configs_reader`
# `relayer/config/relayminer_configs_reader` <!-- omit in toc -->

_This document describes the configuration options available through the
`relayminer_config.yaml` file. It drives how the `RelayMiner` is setup in terms
Expand Down Expand Up @@ -33,11 +33,12 @@ queries from and which services it forwards requests to._
- [`headers`](#headers)
- [`hosts`](#hosts)
- [`proxy_names`](#proxy_names)
- [Proxy -\> Supplier referencing](#proxy---supplier-referencing)
- [RelayMiner config -\> On-chain service relationship](#relayminer-config---on-chain-service-relationship)
- [Proxy to Supplier referencing](#proxy-to-supplier-referencing)
- [RelayMiner config -\> On-chain service relationship](#relayminer-config---on-chain-service-relationship)
- [Full config example](#full-config-example)
- [Supported proxy types](#supported-proxy-types)
# Usage

## Usage

The `RelayMiner` start command accepts a `--config` flag that points to a configuration
`yaml` file that will be used to setup the `RelayMiner` instance.
Expand All @@ -46,38 +47,40 @@ The `RelayMiner` start command accepts a `--config` flag that points to a config
poktrolld relayminer --config ./relayminer_config.yaml --keyring-backend test
```

# Structure
## Structure

The `RelayMiner` configuration file is a `yaml` file that contains `top level options`,
`proxies` and `suppliers` sections.

# Top level options
## Top level options

```yaml
signing_key_name: <string>
smt_store_path: <string>
```
## `signing_key_name`
_`Required`_
### `signing_key_name`

_`Required`_

The name of the key that will be used to sign transactions, derive the public key
and the corresponding address. This key name must be present in the keyring that is used
to start the `RelayMiner` instance.

## `smt_store_path`
### `smt_store_path`

_`Required`_

The relative or absolute path to the directory where the `RelayMiner` will store
the `SparseMerkleTree` data on disk. This directory is used to persist the `SMT`
in a BadgerDB KV store data files.

## `metrics`
### `metrics`

_`Optional`_

This section configures a Prometheus exporter endpoint, enabling the collection
and export of metrics data. The `addr` field specifies the network address for
This section configures a Prometheus exporter endpoint, enabling the collection
and export of metrics data. The `addr` field specifies the network address for
the exporter to bind to. It can be either a port number, which assumes binding
to all interfaces, or a specific host:port combination.

Expand All @@ -93,8 +96,7 @@ When `enabled` is set to `true`, the exporter is active. The addr `value` of
`:9090` implies the exporter is bound to port 9090 on all available network
interfaces.


# Pocket node connectivity
## Pocket node connectivity

```yaml
pocket_node:
Expand All @@ -103,7 +105,8 @@ pocket_node:
tx_node_rpc_url: tcp://<hostname>:<port>
```

## `query_node_rpc_url`
### `query_node_rpc_url`

_`Required`_

The RPC URL of the Pocket node that allows the `RelayMiner` to subscribe to events
Expand All @@ -112,20 +115,22 @@ and establishes a persistent connection to the Pocket node to stream events such
latest blocks, application staking events, etc...
If unspecified, `tx_node_rpc_url` value will be used.

## `query_node_grpc_url`
### `query_node_grpc_url`

_`Optional`_

The gRPC URL of the Pocket node that allows the `RelayMiner` to query/pull data from
the Pocket network (eg. Sessions, Accounts, etc...).

## `tx_node_rpc_url`
### `tx_node_rpc_url`

_`Required`_

The RPC URL of the Pocket node that allows the `RelayMiner` to broadcast transactions to the a Pocket network Tendermint node.
It may have a different host than the `query_node_rpc_url` but the same value is
acceptable too.

# RelayMiner proxies
## RelayMiner proxies

The `proxies` section of the configuration file is a list of proxies that the
`RelayMiner` will use to start servers by listening on the configured host.
Expand All @@ -139,28 +144,31 @@ proxies:
host: <host>
```

## `proxy_name`
### `proxy_name`

_`Required`_, _`Unique`_

Is the name of the proxy which will be used as a unique identifier to reference
proxies in the [Suppliers](#suppliers) section of the configuration file.
It corresponds to a server that will be started by the `RelayMiner` instance
and must be unique across all proxies.

## `type`
### `type`

_`Required`_

The type of the proxy server to be started. Must be one of the [supported types](#supported-proxy-types).
When other types are supported, the `type` field could determine if additional
configuration options are allowed be them optional or required.

## `host`
### `host`

_`Required`_, _`Unique`_

The host to which the proxy server will be started and listening to. It must be
a valid host according to the `type` filed and must be unique across all proxies.

# Suppliers
## Suppliers

The `suppliers` section of the configuration file is a list of suppliers that
represent the services that the `RelayMiner` will offer to the Pocket network
Expand Down Expand Up @@ -190,7 +198,8 @@ suppliers:
- <string>
```

## `service_id`
### `service_id`

_`Required`_, _`Unique`_

The Id of the service which will be used as a unique identifier to reference
Expand All @@ -199,43 +208,49 @@ a service provided by the `Supplier` and served by the `RelayMiner` instance.
It must match the `Service.Id` specified by the supplier when staking for the
service.

## `type`
### `type`

_`Required`_

The transport type that the service will be offered on. It must match the `type` field
of the proxy that the supplier is referencing through `proxy_names`.
Must be one of the [supported types](#supported-proxy-types).

## `service_config`
### `service_config`

_`Required`_

The `service_config` section of the supplier configuration is a set of options
that are specific to the service that the `RelayMiner` will be offering to the
Pocket network.

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

_`Required`_

The URL of the service that the `RelayMiner` will forward the requests to when
a relay is received, also known as **data node** or **service node**.
It must be a valid URL (not just a host) and be reachable from the `RelayMiner` instance.

### `authentication`
#### `authentication`

_`Optional`_

The `authentication` section of the supplier configuration is a pair of `username`
and `password` that will be used by the basic authentication mechanism to authenticate
the requests that are forwarded to the service.

### `headers`
#### `headers`

_`Optional`_

The `headers` section of the supplier configuration is a set of key-value pairs
that will be added to the request headers when the `RelayMiner` forwards the
requests to the service. It can be used to add additional headers like
`Authorization: Bearer <TOKEN>` for example.

## `hosts`
### `hosts`

_`Required`_, _`Unique` for each referenced proxy_, _`Unique` within the supplier's `hosts` list_

The `hosts` section of the supplier configuration is a list of hosts that the
Expand All @@ -247,12 +262,13 @@ the referenced proxy server as well as to check if the request's RPC-Type matche
the on-chain endpoint's RPC-Type.

There are various reasons to having multiple hosts for the same supplier services.

- The on-chain Supplier may provide the same Service on multiple domains
(e.g. for different regions).
(e.g. for different regions).
- The operator may want to route requests of different RPC types to
the same proxy
the same proxy
- Migrating from one domain to another. Where the operator could still
accept requests on the old domain while the new domain is being propagated.
accept requests on the old domain while the new domain is being propagated.
- The operator may want to have a different domain for internal requests.
- The on-chain Service configuration accepts multiple endpoints.

Expand All @@ -262,17 +278,18 @@ _Note: The `service_id` of the supplier is automatically added to the `hosts` li
it may help troubleshooting the `RelayMiner` and/or send requests internally
from a k8s cluster for example._

## `proxy_names`
### `proxy_names`

_`Required`_, _`Unique` within the `proxy_names` list_

The `proxy_names` section of the supplier configuration is the list of proxies
that the `RelayMiner` will use to serve the requests for the given supplier entry.

It must be a valid proxy name that is defined in the `proxies` section of the
configuration file, must be unique across the supplier's `proxy_names` and the
configuration file, must be unique across the supplier's `proxy_names` and the
`supplier` `type` must match the `type` of the referenced `proxy`.

# Proxy -> Supplier referencing
## Proxy to Supplier referencing

To illustrate how the `suppliers.proxy_names` and `proxies.proxy_name` fields are used
to reference proxies and suppliers, let's consider the following configuration file:
Expand All @@ -298,7 +315,7 @@ In this example, the `ethereum` supplier is referencing two proxies, `http-examp
and `http-example-2` and the `7b-llm-model` supplier is referencing only the
`http-example` proxy. This would result in the following setup:

```
```yaml
- http-example
- ethereum
- 7b-llm-model
Expand Down Expand Up @@ -354,13 +371,13 @@ end
svc2Config-->svc2
```

# Full config example
## Full config example

A full and commented example of a `RelayMiner` configuration file can be found
at [localnet/poktrolld/config/relayminer_config_full_example.yaml](https://github.com/pokt-network/poktroll/tree/main/localnet/poktrolld/config/relayminer_config_full_example.yaml)

---

# Supported proxy types
## Supported proxy types

The list of supported proxy types can be found at [pkg/relayer/config/types.go](https://github.com/pokt-network/poktroll/tree/main/pkg/relayer/config/types.go#L8)
The list of supported proxy types can be found at [pkg/relayer/config/types.go](https://github.com/pokt-network/poktroll/tree/main/pkg/relayer/config/types.go#L8)
2 changes: 1 addition & 1 deletion docusaurus/docs/protocol/actors/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services available on Pocket Network as a function of volume and time.

## Schema

The on-chain representation of an `Application` can be found at [application.proto](../../../proto/poktroll/application/application.proto).
The on-chain representation of an `Application` can be found at [application.proto](https://github.com/pokt-network/poktroll/blob/main/proto/poktroll/application/application.proto).

## Configuration

Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/protocol/actors/gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on behalf of an [Application](./application.md).

## Schema

The on-chain representation of a `Gateway` can be found at [gateway.proto](../../../proto/poktroll/gateway/gateway.proto).
The on-chain representation of a `Gateway` can be found at [gateway.proto](https://github.com/pokt-network/poktroll/blob/main/proto/poktroll/gateway/gateway.proto).

## Configuration

Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/protocol/actors/supplier.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ providing services as a function of volume and time.

## Schema

The on-chain representation of a `Supplier` can be found at [supplier.proto](../../../proto/poktroll/shared/supplier.proto).
The on-chain representation of a `Supplier` can be found at [supplier.proto](https://github.com/pokt-network/poktroll/blob/main/proto/poktroll/shared/supplier.proto).

## Configuration

Expand Down
Loading

0 comments on commit cb12dd8

Please sign in to comment.