Othentic
  • Introduction
    • Introducing Othentic Stack
    • Use Cases
  • AVS Framework
    • Abstract
    • Quick Start
    • Othentic CLI
      • Key Management
      • Contracts Deployment
      • Operator Registration
      • AVS Logic Implementation
      • Operator Deposit
      • Node Operators
      • Rewards Distribution
      • P2P Config
        • Custom P2P Messaging
        • P2P Auth Layer
        • Metrics and Monitoring
        • Logging
        • Persistent storage
        • Latency
      • CLI Command Reference
    • Smart Contracts
      • AVS Governance
      • Attestation Center
      • Hooks
        • Task Logic
        • Operator Management
        • Rewards Fee Calculator
      • OBLS
      • Othentic Registry
      • Message Handlers
    • Othentic Consensus
      • Abstract
      • Task & Task Definitions
      • Leader Election
      • Proof of Task
      • Execution Service
      • Validation Service
      • Voting Power
      • Rewards and Penalties
      • Internal Tasks
    • FAQ
    • Supported Networks
    • Explainers
      • Networking
      • Multichain
      • Production Guidelines
      • Operator Allowlisting
      • Governance Multisig
  • External
    • AVS Examples
  • GitHub
  • Othentic Hub
Powered by GitBook
On this page
  1. AVS Framework
  2. Othentic CLI
  3. P2P Config

Persistent storage

Configuring a persistent storage for the node

PreviousLoggingNextLatency

Last updated 1 month ago

The persistent storage is responsible for maintaining information about peers in the P2P network, all the received attestations and tasks submitted. Persistent storage ensures that this information is retained across restarts of the application. The storage is managed using , which stores the data on the local filesystem.

A new flag, --p2p.datadir, has been introduced to specify the directory where the data should be stored. If the specified directory does not exist (e.g., when running the CLI with this option for the first time), the application will create it, provided the process has the necessary write permissions.

Ensure that the path given is relative to the location where you are running the CLI command. For example, specifying data/peerstore will create the directory under the current working directory.

Setting Up the Data Directory with Correct Permissions

If the application encounters permission issues when creating the directory, you may need to manually create it and assign appropriate read/write permissions:

# e.g. your data path is .othentic/data/p2p
mkdir -p .othentic/data/p2p
chmod -R 755 .othentic

The --p2p.datadir flag can be used in the aggregator and attester commands as follows:

othentic-cli node aggregator \
    --json-rpc \
    --p2p.datadir /path/to/aggregator/data/dir

othentic-cli node attester \
    /ip4/127.0.0.1/tcp/9876/p2p/<BOOTSTRAP_NODE_ID> \
    --avs-webapi <HOST> \
    --avs-webapi-port <PORT> \
    --p2p.datadir /path/to/attester/data/dir

After restarting the node, it will attempt to reconnect to all known peers that are persisted in the storage.

If you're running in Docker, make sure to configure Volumes in the Docker file:

services: 
  aggregator:
      command: [
            "--p2p.datadir", "/path/to/aggregator/data/dir"
          ]
      volumes:
            - ./path/to/aggregator/data/dir: /app/path/to/aggregator/data/dir

When running the node through Docker, you need to identify which user ID (UID) runs the process and grant permissions.

To determine the UID for the above `docker-compose` setup, run:

// docker-compose exec <service_name> id
> docker-compose exec aggregator id
uid=1000(node) gid=1000(node) groups=1000(node)

This output lets us know the process is run with UID `1000`.

Therefore, grant the directory correct permissions using the following command:

sudo chown -R 1000:1000 .othentic/

For more details, check the Docker file in

datastore-level
Simple Price Oracle Repository.