This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Nibiru Chain is a breakthrough L1 blockchain and smart contract ecosystem providing superior throughput, reduced latency, and improved security. It operates two virtual machines in parallel:
- NibiruEVM: Ethereum Virtual Machine for Ethereum compatibility
- Wasm: For CosmWasm smart contracts
/x/- Custom blockchain modules (oracle, evm, devgas, epochs, inflation, tokenfactory, sudo)/app/- Core blockchain application logic and module integration/eth/- Ethereum-specific implementations (accounts, crypto, RPC)/proto/- Protocol Buffer definitions for blockchain messages/cmd/nibid/- CLI binary for interacting with the blockchain/evm-core-ts/- TypeScript library for EVM interactions/gosdk/- Go SDK for programmatic blockchain interactions
- evm: Ethereum Virtual Machine implementation
- oracle: Decentralized price oracle system
- devgas: Revenue sharing for smart contract developers
- epochs: Time-based hook system for periodic tasks
- inflation: Tokenomics implementation
- tokenfactory: Token creation and management
# Install the nibid binary
make install
# Build the project
make build
# Alternative with just
just build
just install# Run a local blockchain node
make localnet
# Alternative single-node testnet
just init-local-testnet [moniker]
just start# Run all unit tests
make test-unit
# Run specific package tests
go test ./x/evm/...
# Run with coverage
make test-coverage
# Run integration tests
make test-coverage-integration
# Run EVM E2E tests
cd evm-e2e && npm test# Format code
make format
# Run linter
make lint
# Fix linting issues
make lint-fix
# Generate protobuf code
make proto-gen# Install development tools
make tools-clean
# Run simulation tests
make sim-full
# Generate documentation
make docs-generate
# Check for breaking changes
make proto-break-check- Go version 1.22.2 or higher
- Node.js 20+ and npm 10+ (for TypeScript/EVM tests)
- Make and Git
- For validators: 8-core x64 CPU, 64GB RAM, 1TB+ SSD
-
Setup Environment
git clone https://github.com/NibiruChain/nibiru cd nibiru make install -
Run Local Network
make localnet # or just init-local-testnet test-moniker just start -
Make Changes
- Core logic:
/x/modules - Application:
/app/ - Tests:
*_test.gofiles
- Core logic:
-
Test Changes
# Test specific module go test ./x/oracle/... # Run integration tests make test-coverage-integration
-
Lint & Format
make lint-fix make format
- Primary: Makefile with includes from
/contrib/make/ - Alternative: justfile for common tasks
- Protocol Buffers: buf for proto compilation
- Cosmos SDK v0.47.11
- CometBFT/Tendermint consensus
- go-ethereum fork for EVM compatibility
- CosmWasm for WASM smart contracts
- Go: Built-in testing with testify assertions
- TypeScript: Jest for EVM E2E tests
- Simulation: Custom simulation framework
- Import errors: Run
go mod tidyandgo mod download - Proto errors: Run
make proto-gen - Build failures: Ensure Go 1.22.2+ is installed
- Test failures: Check if local node is running for integration tests
- RPC: http://localhost:26657
- gRPC: localhost:9090
- EVM RPC: http://localhost:8545
- API: http://localhost:1317
- Main docs: https://docs.nibiru.fi
- Contracts: https://github.com/NibiruChain/contracts
- TypeScript SDK: https://www.npmjs.com/package/@nibiruchain/ts-sdk
- Oracle docs: See
/x/oracle/README.md
- Discord: https://discord.gg/nibiru
- Twitter: https://twitter.com/NibiruChain
- Telegram: https://t.me/nibiruchainofficial