Quick Start

Prerequisites

Required Software

# Go 1.23.8+
go version

# Python 3.10+ with virtual environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Solidity compiler
# Brahma contracts use 0.8.22+, but 0.8.24 is compatible with all
solc-select install 0.8.24
solc-select use 0.8.24

# Foundry (for Solidity testing and deployment)
curl -L https://foundry.paradigm.xyz | bash
foundryup

Build & Test

Building the Blockchain

Local Testnet Setup

Important: Credential Initialization

Testnet setup requires explicit credential initialization for security.

Docker Setup (Alternative)

Credential Management

  • .env file stores all account credentials

  • File permissions automatically set to 600

  • Deterministic mode generates same test addresses

  • Production requires manual credential configuration

  • Run make validate-env to verify configuration

Network Endpoints

Contract Development

Compiling Contracts

E2E Testing Scripts

Query Examples

AutoCLI Command Generation

Important: Manual query commands are disabled in x/brahma/module.go:112-117. The CLI uses AutoCLI to auto-generate commands from gRPC service definitions.

AutoCLI Naming Convention:

  1. RPC method names are converted to kebab-case

  2. Full method name is preserved (Query prefix is NOT dropped by AutoCLI)

  3. Commands are generated directly from proto service definitions

  4. Example: QueryCoreGrantApplicationquery-core-grant-application

Command Generation Examples:

Proto RPC Method
Generated CLI Command
Notes

AITensorByBlockHeight

aitensor-by-block-height

No "Query" prefix to drop

ContributionByWalletAddress

contribution-by-wallet-address

No "Query" prefix to drop

QueryCoreGrantApplication

query-core-grant-application

Full method name preserved

GetAllBlockHeightsByAIID

get-all-block-heights-by-aiid

No "Query" prefix to drop

QueryCore

query-core

Full method name preserved

QueryAITokens

query-aitokens

Full method name preserved

Params

params

Standard params query

QueryClaimableRewards

query-claimable-rewards

Full method name preserved

QueryClaimStatistics

query-claim-statistics

Full method name preserved

CLI Queries

The CLI uses AutoCLI to generate commands from gRPC service definitions:

REST API (Alternative to CLI)

REST endpoints follow the exact paths defined in proto files:

Discovering Available Commands

Note: The command names shown above are based on standard AutoCLI behavior in BitSDK (built on Cosmos SDK v0.53.3), where RPC method names are converted to kebab-case without dropping prefixes. If you find the actual commands differ, use evmd query brahma --help to see the exact generated command names for your version.

Transaction Examples

The Brahma module exposes one direct CLI transaction: Request for Core (rfc). This is used by platforms to submit AI tensor contributions on behalf of users with approved Core grant allocations.

How it works:

  1. Platform creates a JSON file with transaction details (requester address, AI tensors, contributions)

  2. Platform submits the transaction using evmd tx brahma rfc command

  3. The module validates the allocation, calculates cores to mint, and updates balances

  4. Users claim their minted cores through the platform's interface (which calls the smart contract's claimCore() function)

Request for Core

Create a request.json file:

Important JSON field requirements:

  • Field names use PascalCase: Requester, AITensors, Address, Contributions

  • AI field must be base64-encoded bytes (e.g., "ZG9uYWxkLWFp" = "donald-ai")

  • To encode: echo -n "donald-ai" | base64ZG9uYWxkLWFp

  • Address can be hex string (0x-prefixed Ethereum address)

  • Contributions is an array of uint64 values

Submit transaction:

Note: Core grant applications and removals are governance proposals, not direct CLI transactions.

Next Steps

Last updated