Skip to content

Commit 140d26c

Browse files
revamp readme
1 parent c7686a8 commit 140d26c

File tree

6 files changed

+52
-72
lines changed

6 files changed

+52
-72
lines changed

README.md

+50-35
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,57 @@
1-
# Infernet Services Registry
1+
# Infernet Recipes
22

3-
This is a collection of [recipes](#what-is-a-recipe) for running [Infernet](https://docs.ritual.net/infernet/about)-compatible services. This repo aims to:
4-
1. Standardize service IDs across the Infernet network.
5-
2. Document service descriptions, configurations, and data schemas.
6-
3. Make it trivial to configure and run services on an [Infernet Node](https://docs.ritual.net/infernet/node/introduction) via [recipes](#what-is-a-recipe).
3+
This is a collection of [recipes](#what-is-a-recipe) that aims to simplify:
4+
1. Configuring and running an [Infernet Node](https://docs.ritual.net/infernet/node/introduction).
5+
2. Configuring and running [services](https://infernet-services.docs.ritual.net/) on an Infernet Node.
76

8-
To ensure consistent identification and configuration of official Infernet-compatible services across the network, Infernet Nodes **enforce** the use of recipes for official services. As such, you cannot run custom containers with an ID matching any of the official services under the `services/` directory; and you can ONLY run an official service using a [recipe](#what-is-a-recipe).
7+
## Node Recipes
98

10-
### Structure
9+
Node recipes reside under the `node/` directory.
10+
- Sub-directories `node/**` represent different connected chain configurations.
11+
- Sub-directories under each chain (e.g. `node/base/**`) represent Infernet Node versions.
12+
- Each directory `node/<chain>/<version>/` contains a `config.json`, the node recipe file, along with auxiliary files required for node deployment.
1113

12-
- Services are represented by directories under `services/`, and are versioned using subdirectories.
13-
- Service IDs:
14-
- **Consist of** a `name` and a `version`, in the format `<name>_<version>`, corresponding to the directory `services/<name>/<version>` within this repo.
15-
- **Are reserved**, i.e. they uniquely describe a service across the [Infernet](https://docs.ritual.net/infernet/about) network.
16-
- Each `<name>/<version>/` is a directory that contains:
17-
- A `README.md` with the service description, configuration details, and input data structure.
18-
- A `recipe.json`, i.e. the recipe for running the Infernet-compatible service.
14+
## Service recipes
1915

20-
### What is a Recipe?
21-
22-
Recipes are `json` files used to [configure containers](https://docs.ritual.net/infernet/node/configuration/v1_1_0#containers-arraycontainer_spec) (i.e. _services_) on an [Infernet Node](https://docs.ritual.net/infernet/node/introduction). They are identified by a `name` and a `version`.
23-
24-
#### Rules
16+
Service (container) recipes reside under `services/`.
17+
- Sub-directories `services/**` represent different Infernet-compatible [services](https://infernet-services.docs.ritual.net/).
18+
- Sub-directories under each service (e.g. `services/onnx-inference/**`) represent service versions.
19+
- Each directory `services/<service>/<version>/` contains a `recipe.json`, the service recipe file, along with a README with more details.
2520

26-
- Recipes **must** contain:
27-
- `id` (`string`): Service ID.
28-
- `image` (`string`): [Dockerhub](https://hub.docker.com) image ID.
29-
- Recipes **may** contain:
30-
- `command` (`string`): Command to run the container with.
31-
- `env` (`object`): Environment variables to pass into the container.
32-
- `description` (`string`): A brief description of the service.
33-
- The above _may_ contain __templated__ variables that must be specified by the node operator, in the form of `${TEMPLATED_VARIABLE}` (see `recipe_vars` below).
34-
- Some templated variables are _required_, others may be optional and defaulted.
35-
36-
#### Usage
37-
38-
To use a recipe, you must specify:
39-
- `recipe_id` (`string`): The Service ID of the desired service, i.e. `<name>_<version>`.
40-
- `recipe_vars` (`object`, optional): The variables to substitute for any templated recipe variables.
21+
### What is a Recipe?
4122

42-
See Infernet's [container configuration](https://docs.ritual.net/infernet/node/configuration/v1_1_0#container_spec-object) docs for complete configuration instructions.
23+
Recipes are `json` files that contain:
24+
- A `config` section, which is the (incomplete) configuration object with several required and/or optional fields pre-specified.
25+
- An `inputs` section, which describes the user inputs necessary to transform the `config` into a complete configuration object. See [Inputs](#inputs).
26+
27+
#### Inputs
28+
29+
Recipe inputs are specified by the following fields:
30+
- `id` (string): The ID of the variable.
31+
- `path` (string): The path in the `config` object where the variable belongs. See [Path Rules](#path-rules).
32+
- `type` (string): The type of the variable.
33+
- `required` (boolean): Whether user input is required.
34+
- `default` (any, _optional_): The default value of the variable, if applicable.
35+
- `description` (string, _optional_): The description of the variable.
36+
37+
#### Path Rules
38+
39+
Object properties within the `config` object are specified as paths joined by `.` (dots). For example, path
40+
41+
```js
42+
chain.wallet.private_key
43+
```
44+
refers to
45+
```js
46+
config["chain"]["wallet"]["private_key"]
47+
```
48+
49+
**Partial substitutions** are also possible with the `#`. For example, path
50+
```js
51+
command#NUM_WORKERS
52+
```
53+
54+
refers to the substring `${NUM_WORKERS}` within
55+
```js
56+
config["command"]
57+
```

node/anvil/1.3.0/config.json

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
"starting_sub_id": 0
2323
}
2424
},
25-
"docker": {
26-
"username": "",
27-
"password": ""
28-
},
2925
"redis": {
3026
"host": "redis",
3127
"port": 6379

node/base-sepolia/1.3.0/config.json

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
"starting_sub_id": 0
2323
}
2424
},
25-
"docker": {
26-
"username": "",
27-
"password": ""
28-
},
2925
"redis": {
3026
"host": "redis",
3127
"port": 6379

node/base/1.3.0/config.json

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
"starting_sub_id" : 0
2323
}
2424
},
25-
"docker": {
26-
"username": "",
27-
"password": ""
28-
},
2925
"redis": {
3026
"host": "redis",
3127
"port": 6379

node/eth/1.3.0/config.json

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
"starting_sub_id": 0
2323
}
2424
},
25-
"docker": {
26-
"username": "",
27-
"password": ""
28-
},
2925
"redis": {
3026
"host": "redis",
3127
"port": 6379

node/other/1.3.0/config.json

+2-21
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"port": 4000
77
},
88
"chain": {
9-
"enabled": true,
9+
"enabled": false,
1010
"trail_head_blocks": 3,
1111
"rpc_url": "",
1212
"registry_address": "",
@@ -22,31 +22,12 @@
2222
"starting_sub_id" : 0
2323
}
2424
},
25-
"docker": {
26-
"username": "",
27-
"password": ""
28-
},
2925
"redis": {
3026
"host": "redis",
3127
"port": 6379
3228
},
3329
"forward_stats": false,
3430
"containers": []
3531
},
36-
"inputs": [
37-
{
38-
"id": "private_key",
39-
"path": "chain.wallet.private_key",
40-
"description": "Private key for the wallet",
41-
"type": "string",
42-
"required": true
43-
},
44-
{
45-
"id": "payment_address",
46-
"path": "chain.wallet.payment_address",
47-
"description": "Payment address for the wallet",
48-
"type": "string",
49-
"required": false
50-
}
51-
]
32+
"inputs": []
5233
}

0 commit comments

Comments
 (0)