Skip to content

Latest commit

 

History

History
197 lines (126 loc) · 5.65 KB

setup.md

File metadata and controls

197 lines (126 loc) · 5.65 KB

DIN CLI — Setup Guide

This guide walks you through the complete setup process for the DIN CLI (dincli) from installation to first use.

Tip

Hit an error or get stuck anywhere in this guide? Post it in the DevNet 2.0 pre-launch discussion.


1. Virtual Environment

It is recommended to install dincli inside a Python virtual environment.

# Create a virtual environment
python3 -m venv venv

# Activate the virtual environment
source venv/bin/activate

Note

Recommended python version is 3.12.3


2. Install dincli

Option A — Install from a Downloaded Wheel

# Download the wheel file
wget https://github.com/InfiniteZeroFoundation/DevNet/raw/refs/heads/main/dist/dincli-0.1.0-py3-none-any.whl
# Install it
pip install dincli-0.1.0-py3-none-any.whl

Option B — Install Directly from GitHub

pip install git+https://github.com/InfiniteZeroFoundation/devnet.git@main#subdirectory=dist

for any missing dependency please install it using pip. Please see a complete dependency list in requirements.txt

Verify Installation

dincli --version
# or
dincli system welcome

3. Initialize the CLI

dincli system init

Creates the required config and cache directories and generates an empty configuration file.


4. Configuration

# Disable demo mode to use your own wallet and private keys
dincli system configure-demo --mode no

# Set the default network  [local | sepolia_devnet | sepolia_op_devnet | mainnet]
dincli system configure-network --network sepolia_op_devnet

> [!NOTE]
> Use `sepolia_op_devnet` for devnet. Testnet and Mainnet support will be rolled out in a future release.

# Set the log level  [debug | info | warning | error | critical]
dincli system configure-logging --level info

5. Environment Variables (.env)

Create a .env file in the root directory of your project and populate it with the variables below.

Wallet Password

The DIN CLI encrypts your private key using this password.

DIN_WALLET_PASSWORD=your_secure_password

RPC URL

The CLI needs an RPC endpoint to communicate with the blockchain. The variable name follows the pattern [NETWORK]_RPC_URL (uppercase).

You can obtain an RPC URL from providers such as Alchemy, Infura, or Ankr. You must set the RPC URL for optimism-sepolia network as SEPOLIA_OP_DEVNET_RPC_URL in .env file at root of your project.

# Sepolia - Optimism Devnet
# must set this for devnet usage
SEPOLIA_OP_DEVNET_RPC_URL=https://optimism-sepolia.infura.io/v3/<auth_token>


# Local network (e.g. a Hardhat node) - OPTIONAL
# LOCAL_RPC_URL=http://127.0.0.1:8545

Private Key

⚠️ Local development only. The ETH_PRIVATE_KEY_<n> pattern stores raw private keys in plaintext. If you are running a production validator node, use the encrypted keystore instead — see wallet-setup.md.

Store private keys using the pattern ETH_PRIVATE_KEY_<account_index> in .env file at root of your project. You can define as many accounts as needed by incrementing the index.

ETH_PRIVATE_KEY_0 = 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
ETH_PRIVATE_KEY_1 = 0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890

Note

Be sure to use your own private keys, as the private keys provided in the example are for demonstration purposes only.

Important

register-wallet is for your own real key material and refuses to run while demo mode is on — disable it first (dincli system init already defaults it off, so this is only needed if you turned it on earlier):

dincli system configure-demo --mode no

Register a stored account with:

dincli system register-wallet --account 0

For local Hardhat testing with a well-known dev key instead of your own .env key, see dincli system connect-demo-wallet in cli-reference.md.


6. IPFS Setup

dincli requires an IPFS provider to store and retrieve model data.

Detailed reference: IPFS Configuration Guide

Option A — Filebase (Managed IPFS) - RECOMMENDED OPTION

Obtain an API key from Filebase and configure it:

dincli system configure-ipfs --provider filebase --api-key <your_api_key>

Note

Please create a bucket on Filebase and get bucket's IPFS RPC API token from Filebase Console. Use that as your_api_key in the command above. IPFS RPC API token dashboard is located at bottom of the page.

Option B — .env provider (default)

If you do not configure a provider, dincli uses the env provider automatically.

Add the following to the project .env:

IPFS_API_URL_ADD=http://127.0.0.1:5001/api/v0
IPFS_API_URL_RETRIEVE=http://127.0.0.1:5001/api/v0

You can set it explicitly if you want:

dincli system configure-ipfs --provider env

Ensure your IPFS backend retains uploaded artifacts. If using a local node, manage pinning and garbage collection carefully.

Option C — Custom IPFS service

When the built-in env and filebase providers are not enough, point dincli at your own Python module:

dincli system configure-ipfs --provider custom --service-path /abs/path/to/custom_ipfs.py

The module must implement upload_to_ipfs(...) and retrieve_from_ipfs(...). See the IPFS Configuration Guide for the full contract.