The Infernet Node is the off-chain counterpart to the Infernet SDK from Ritual, responsible for servicing compute workloads and delivering responses to on-chain smart contracts.
Developers can flexibily configure an Infernet Node for both on- and off-chain compute consumption, with extensible and robust parameterization at a per-container level.
Important
Infernet Node architecture, quick-start guides, and in-depth documentation can be found on the Ritual documentation website
Warning
This software is being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the software.
At its core, the Infernet Node operates according to a set of runtime configurations. Some of these configurations have sane defaults and do not need modification. See config.sample.json for an example, or copy to begin modifying:
# Copy and modify sample config
cp config.sample.json config.json
vim config.json
- log_path (
string
). The local file path for logging. - startup_wait (
float
, optional). The number of seconds to wait for containers to start up before starting the node. - chain (
object
). Chain configurations.- enabled (
boolean
). Whether chain is enabled on this node. - trail_head_blocks (
integer
). if enabled: how many blocks to stay behind head when syncing. Set to0
to ignore. - rpc_url (
string
). if enabled: the HTTP(s) JSON-RPC url. - registry_address (
string
). if enabled: theRegistry
contract address. - wallet (
object
). if enabled:- max_gas_limit (
integer
). Maximum gas limit per node transaction - private_key (
string
). Node wallet private key - payment_address (
string
, optional). Public address of the node's escrow wallet. This is an instance of Infernet'sWallet
contract. If not provided, the node will skip subscriptions that provide payment. - allowed_sim_errors (
array[string]
, optional). Allowed error messages to ignore when simulating transactions. Checks for inclusion in error message. Case-insensitive. i.e.["out of gas"]
matches"Contract reverted: Out of gas"
. Defaults to[]
.
- max_gas_limit (
- snapshot_sync (
object
, optional). Snapshot sync configurations.- sleep (
float
, optional). Number of seconds to sleep between snapshot syncs. Defaults to1.0
. - batch_size (
int
, optional). Number of subscriptions to sync in each batch. Defaults to200
.
- sleep (
- enabled (
- docker (
object
, optional). Docker credentials to pull private containers with- username (
string
). The Dockerhub username. - password (
string
). The Dockerhub Personal Access Token (PAT).
- username (
- containers (
array[container_spec]
). Array of supported container specifications.- container_spec (
object
). Specification of supported container.- id (
string
). Must be unique. ID of supported service. - image (
string
). Dockerhub image to run container from. Must be local, public, or accessible with provided DockerHub credentials. - command (
string
). The command and flags to run the container with. - env (
object
). The environment variables to pass into the container. - port (
integer
). Local port to expose this container on. - rate_limit (
object
, optional). REST server rate-limiting configurations. If not provided, defaults are used.- num_requests (
integer
, optional). Maximum number of requests perperiod
. Defaults to60
. - period (
float
, optional). Time period in seconds for allowingnum_requests
. Defaults to60.0
.
- num_requests (
- external (
boolean
). Whether this container can be the first container in a JobRequest. - description (
string
, optional). Description of service provided by this container. - allowed_ips (
array[string]
). Container-level firewall. Only specified IPs and/or CIDR blocks allowed to request execution of this container.- Leave empty for no restrictions.
- allowed_addresses (
array[string]
). Container-level firewall. Only specified addresses allowed to request execution of this container, with request originating from on-chain contract.- Leave empty for no restrictions.
- accepted_payments (
dict[string, string]
, optional). Payment configurations for this container. This is a dictionary of accepted token addresses (zero address for native token i.e. ETH) and their corresponding minimum payment amount. If not provided, no payments will be received. If provided, subscriptions that don't meet these requirements will be skipped.- Leave empty for no payment requirements.
- generates_proofs (
boolean
). Whether this container generates proofs. Defaults tofalse
. Iffalse
, the node will skip subscriptions that require proofs from this container. - allowed_delegate_addresses (
array[string]
). Container-level firewall. Only specified addresses allowed to request execution of this container, with request originating from on-chain contract but via off-chain delegate subscription (with this address corresponding to the delegate subscriptionowner
).- Leave empty for no restrictions.
- gpu (
boolean
). Whether this should be a GPU-enabled container. Host must also be GPU-enabled. - volumes (
array[string]
). The volume mounts for this container.
- id (
- container_spec (
- server (
object
). Server configurations.- port (
integer
). Port to run server on. Defaults to4000
.
- port (
- redis (
object
). Redis configurations.- host (
string
). Host to connect to. Defaults to"redis"
. - port (
integer
). Port to connect to. Defaults to6379
.
- host (
- forward_stats (
boolean
). Whether to send diagnostic system stats to Ritual. Defaults totrue
. - startup_wait (
float
). Number of seconds to wait for containers to start up before starting the node. Defaults to60
.
# Set tag
tag="0.1.0"
# Build image from source
docker build -t ritualnetwork/infernet-node:$tag .
# Configure node
cd deploy
cp ../config.sample.json config.json
# FILL IN config.json #
# Run node and dependencies
docker compose up -d
The GPU-enabled version of the image comes pre-installed with the NVIDIA CUDA Toolkit. Using this image on your GPU-enabled machine enables the node to interact with the attached accelerators for diagnostic and purposes, such as heartbeat checks and utilization reports.
# Set tag
tag="0.1.0"
# Build GPU-enabled image from source
docker build -f Dockerfile-gpu -t ritualnetwork/infernet-node:$tag-gpu .
# Configure node
cd deploy
cp ../config.sample.json config.json
# FILL IN config.json #
# Run node and dependencies
docker compose -f docker-compose-gpu.yaml up -d
# Create and source new python venv
python3.11 -m venv env
source ./env/bin/activate
# Install dependencies
make install
# Configure node
cp config.sample.json config.json
# FILL IN config.json #
# Run node
make run
Follow README instructions in the infernet-deploy repository.
# Set tag
tag="0.1.0"
# Build for local platform
make build
# Multi-platform build and push to repo
make build-multiplatform