Skip to content

Instantly share code, notes, and snippets.

@okdas
Last active April 3, 2024 19:07
Show Gist options
  • Save okdas/c20a2c0d778f4c291c8388a386b52d20 to your computer and use it in GitHub Desktop.
Save okdas/c20a2c0d778f4c291c8388a386b52d20 to your computer and use it in GitHub Desktop.
# TODO_CONSIDERATION: We don't need this now, but it would be beneficial if the
# logic handling this config file could be designed in such a way that it allows for
# "hot" config changes in the future, meaning changes without restarting a process.
# This would be useful for adding a new supplier without interrupting the service.
# Name of the key (in the keyring) used to sign transactions.
signing_key_name: supplier1
# Relative path (on the relayminer's machine) to the SMT KV store data on disk.
smt_store_path: smt_stores
# Prometheus exporter configuration
metrics:
# Enable or disable the metrics exporter
enabled: true
# The address (host:port or just port) for the metrics exporter to listen on.
addr: :9090
pocket_node:
# Pocket node URL exposing the CometBFT JSON-RPC API.
# Used by the Cosmos client SDK, event subscriptions, etc.
# If unspecified, defaults to `tx_node_rpc_url`.
query_node_rpc_url: tcp://poktroll-validator:36657
# Pocket node URL exposing the Cosmos gRPC service for querying purposes.
query_node_grpc_url: tcp://poktroll-validator:36658
# Pocket node URL exposing the TendermintRPC service.
tx_node_rpc_url: tcp://poktroll-validator:36658
# Suppliers are different services offered on Pocket Network,
# proxied through Relay Miner.
suppliers:
# The `service_id` of the service offered on the network.
# Must match the Service.Id of the staked service.
# Must be unique in the `suppliers` array.
# Required.
- service_id: ethereum
# Type of the supplier exposed by Relay Miner.
# Use `http` for all protocols using `http` (`json_rpc`, `ws`).
# Required.
server_type: http
# Configuration of the service offered through RelayMiner.
service_config:
# Backend URL is the endpoint RelayMiner proxies the requests to.
# Also known as the data node or service node.
# Required.
backend_url: http://anvil.servicer:8545
# Authentication for the service (HTTP Basic Auth).
# Optional.
authentication:
username: user
password: pwd
# TODO_IMPROVE: This is not implemented in code yet.
# Authentication via a static header might be desirable for high-traffic services.
# Example: If the service requires a header like `Authorization: Bearer <PASSWORD>`
# Optional.
headers: {}
# A list of addresses relayminer accepts requests from.
#
# 1. Multiple hosts can be configured per supplier.
# 2. Must be unique per listen_address to avoid conflicts.
# 3. Host must be reachable from the internet if staked on the network.
# 4. A supplier must be staked on this endpoint for traffic to be routed.
#
# TODO_CONSIDERATION(@protocol-team): If there's a way to differentiate a `service_id` of incoming relay (assuming type: `http`), we can remove the host uniqueness requirement - as this is how it currently works on Pocket Network Morse (v0) - one domain/host to serve all traffic. This would allow node runners to reduce maintenance burden (TLS certificates for HTTPS and DNS names), as one single domain is easier to maintain compared to one domain per supplier.
#
# In most scenarios, only one host is specified. Multiple hosts might be useful for:
# - Migrating from one domain to another (accepting requests on both old and new domains).
# - Having a different domain for internal requests.
#
# Required.
publicly_exposed_endpoints:
# Note: No schema or port is specified.
# - HTTPS/TLS termination can be handled by a separate layer (e.g., nginx or HAproxy).
# - Port can differ from the staked port (e.g., Relay Miner on port 80, TLS on port 443).
- ethereum.devnet1.relayminer.com
# Listen address, usually `0.0.0.0:80` (all network interfaces, port `80`).
# Multiple suppliers can share one listen address.
# Required.
listen_address: 0.0.0.0:80
# Example of exposing an ollama LLM endpoint.
- service_id: ollama:mistral:7b
server_type: http
service_config:
backend_url: http://localhost:11434
publicly_exposed_endpoints:
- mistral-7b.devnet1.poktroll.com
listen_address: 0.0.0.0:80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment