ChainBrain Framework CLI v1

Quickstart guide to the OnChainBrain Framework CLI v1


Overview

The OnChainBrain Framework enables developers to create and manage intelligent agents through a command-line interface. This open-source solution integrates with the OnChainBrain API, facilitating seamless interaction with your deployed AI agents.

viceo guide on how to interact with the OCB Framework

✨ Core Features

  • Blockchain Integration: Launch intelligent agents on Solana

  • Natural Language: Communicate with agents using everyday language

  • Data Analytics: Access live blockchain metrics and statistics

  • Pattern Recognition: Monitor token movements and market trends

  • Advanced Queries: Perform sophisticated blockchain analysis

  • Data Provider: Direct integration with Bitquery for real-time data


💡 Technical Capabilities

  • Asset Analytics: Extract detailed token information and metrics

  • Market Intelligence: Monitor market movements and trading patterns

  • Extensible Design: Build and integrate custom functionality

  • Universal Support: Works across all Node.js-supported platforms


🔧 Setup Guide

System Requirements

  • Node.js version 16 or higher

  • Package manager (npm/yarn)

  • Bitquery API credentials

  • Additional requirements listed in .env.example

Setup Process

  1. Get the code:

    git clone https://github.com/onchainbrain/onchainbrain-fw-v1.git
    cd onchainbrain-fw-v1
  2. Install required packages:

    npm install
  3. Configure environment: Create a .env file with these parameters:

    PRIVATE_KEYPAIR=<YOUR_SOLANA_KEYPAIR>
    OPENAI_API_KEY=<YOUR_OPENAI_KEY>
    RPC_ENDPOINT=https://api.mainnet-beta.solana.com
    BITQUERY_API_KEY=<YOUR_BITQUERY_KEY>
  4. Compile the source:

    npm run build

📋 Framework Commands

Agent Interaction

npm run interact-ocb-agent {agent_name} ask "Your question"

Example:

npm run interact-ocb-agent Aura ask "Trending token 24h"

Market Analysis Commands

Token Trends:

npm run interact-ocb-agent {agentName} ask "Trending token 24h"

Holder Analysis:

npm run interact-ocb-agent {agentName} ask "Top holders: {mintAddress}"

Example:

npm run interact-ocb-agent {agentName} ask "Top holders: 6LKbpcg2fQ84Ay3kKXVyo3bHUGe3s36g9EVbKYSupump"

Market Metrics:

npm run interact-ocb-agent {agentName} ask "Marketcap count:{count} term:'{term}'"

Example:

npm run interact-ocb-agent {agentName} ask "Marketcap count:50 term:'pump'"

Buyer Analysis:

npm run interact-ocb-agent {agentName} ask "First top {count} buyers for: {mintAddress}"

Example:

npm run interact-ocb-agent {agentName} ask "First top 10 buyers for: 6LKbpcg2fQ84Ay3kKXVyo3bHUGe3s36g9EVbKYSupump"

Trading Operations:

npm run ocb-trade {agent_name}

📚 Technology Stack

Core Dependencies

Package

Version

Purpose

@solana/web3.js

^1.98.0

Solana blockchain connectivity

dotenv

^16.4.7

Environment configuration

firebase

^11.1.0

Data persistence and management

node-fetch

^3.3.2

Network request handling

openai

^4.77.3

AI processing capabilities

bs58

^6.0.0

Address encoding utilities

form-data

^4.0.1

Data structure handling

punycode

^2.3.1

Unicode processing

Development Tools

Package

Version

Purpose

typescript

^5.7.3

Type-safe development

ts-node

^10.9.2

TypeScript execution

tsconfig-paths

^4.2.0

Module resolution


⚙️ Available Scripts

  • npm run build: Compile TypeScript code

  • npm run interact-ocb-agent: Agent communication

  • npm run ocb-trade: Execute trading operations


🔍 Architecture Overview

  • Data Storage: Firebase backend integration

  • Market Data: Bitquery data provider integration

  • Command Processing: Advanced query parsing system

  • Extensibility: Modular architecture design


🛠️ How to Run the OnChainBrain Framework

  1. Ensure all dependencies are installed using npm install

  2. Set up environment variables by configuring the .env file

  3. Build the project with:

    npm run build
  4. Interact with your agent using:

    npm run interact-ocb-agent {agent_name} ask "Your question"
  5. Analyze blockchain data using:

    npm run interact-ocb-agent {agent_name} ask "Trending token 24h"
  6. Execute trading operations via:

    npm run ocb-trade {agent_name}

Last updated