@othentic/othentic-cli
v1.4.3
Published
Othentic CLI
Downloads
1,980
Keywords
Readme
🍀 Othentic CLI
Stateless Rollups (i.e. oracle, bridge, rollup watchers) provide services to other networks without being constrained by any particular blockchain. However, infrastructure for the submission and auditing of the Operators' work is required. One of the primary goals of Othentic is to support diverse node tasks to enable AVS’s Operators to submit unique task specifications. Operator tasks can be classified into two primary categories: On-chain tasks - include arbitrary transactions that Operators are required to execute as part of core responsibilities. Off-chain tasks - occur outside the blockchain and require a different approach for submission and validation.
You can find more information in our gitbook: https://othentic.gitbook.io/
🎮 Usage
Prerequisites
- Node 22.6 (preferably via NVM)
- OpenSSL
Install the Othentic CLI via npm:
npm i -g @othentic/cli
It is also possible to run othentic-cli
via npx
with:
npx othentic-cli [args]
Commands
The available commands are divided into subcommands:
othentic-cli node <mode> [args]
othentic-cli network <action> [args]
othentic-cli operator <action> [args]
othentic-cli wallet <action> [args]
Use the -h
flag to see the help text for each command.
⚙️ P2P Setup
.env file
Change the .env.example
file to .env
and add the empty values as per the
documentation.
[!NOTE] The
.env.example
file contains a bootstrap seed & id. While you can use these for starters, it is recommended to generate a new seed & id (see below).
Aggregator node
An Aggregator node is required for the AVS to function. Run it using the following command:
othentic-cli node aggregator
Attester nodes
You can have as many attester nodes as you like. Every participant in your AVS should be able (or even required) to run an attester node. Attester nodes need to know the address of the Aggregator node, as the aggregator node also acts as a bootstrap node (see below for details about the architecture).
To run an attester node, use the following command:
othentic-cli node attester /ip4/<BOOTSTRAP_IP>/tcp/9876/p2p/<BOOTSTRAP_NODE_ID>
To use DNS resolution, use this format:
othentic-cli node attester /dns/<DOMAIN_NAME>/tcp/9876/p2p/<BOOTSTRAP_NODE_ID>
Generating bootstrap seed & id
Your bootstrap node requires a seed for its encrypted transport. A bootstrap seed is simply a random 32-byte sequence.
To generate a new bootstrap seed, use openssl
:
openssl rand -hex 32
If you like to immediately insert it into the .env
, use the following command:
echo "OTHENTIC_BOOTSTRAP_SEED=$(openssl rand -hex 32)" >> .env
Once you added the new seed to your .env
, use the aggregator get-id
command:
othentic-cli node aggregator get-id
...
Your node ID is:
12D3KooWBNFG1QjuF3UKAKvqhdXcxh9iBmj88cM5eU2EK5Pa91KB
✨ Done in 3.72s.
Copy the generated node ID and save it in your .env
:
OTHENTIC_BOOTSTRAP_ID=12D3KooWBNFG1QjuF3UKAKvqhdXcxh9iBmj88cM5eU2EK5Pa91KB
📐 Architecture
The Othentic Framework utilizes libp2p for inter-node communication.
Two node types exist:
- Attesters
- Aggregator
The Othentic Framework lets you deploy a whole network including boostrapped peer discovery which allows nodes to find each other over the network.
Bootstrap node
The Aggregator node also plays the part of a bootstrap node. A bootstrap node is the node responsible for connecting peers on the network. Every peer initially connects to the bootstrap node to discover other peers. You can also run multiple bootstrap nodes spread out geographically.
[!NOTE] The bootstrap node is a crucial part of your P2P network. It should have high availability so new nodes can join the network. If the bootstrap node is down, new nodes cannot join the network (existing nodes continue to work).
Aggregator
The Aggregator (which also plays the role of a bootstrap node) listens to events from the Attester nodes and monitors the necessary voting power which validated each task. If enough voting power validated the task, the Attester submits the task onchain.
[!NOTE] Currently the Aggregator node also acts as your bootstrap node. This might change in the future.
Attesters
The Attester nodes are responsible for attesting to tasks. Every task they see must be attested as either "valid" or "invalid". If enough Attester nodes attest a task as "valid", the aggregator will submit this task onchain.