Development Setup

Overview

This guide will help you set up a complete development environment for building on OPN Chain. Whether you're new to blockchain development or an experienced Ethereum developer, you'll find everything you need to get started.

Prerequisites

Required Software

Software
Version
Purpose

Node.js

16.0+

JavaScript runtime

npm/yarn

Latest

Package management

Git

2.0+

Version control

VS Code

Latest

Recommended IDE

Optional Tools

Tool
Purpose

Docker

Container deployment

Python

For Brownie/Ape frameworks

Rust

For Foundry framework

Step 1: Install Node.js

macOS:

# Using Homebrew
brew install node

# Or download from nodejs.org

Linux:

Windows: Download installer from nodejs.orgarrow-up-right

Step 2: Install Development Framework

Choose your preferred framework:

Hardhat (Recommended)

Foundry

Truffle

Step 3: Configure for OPN Chain

Hardhat Configuration

Create hardhat.config.js:

Foundry Configuration

Create foundry.toml:

Step 4: Environment Setup

Create .env file:

Add to .gitignore:

Step 5: Install Development Tools

Essential npm Packages

VS Code Extensions

Install these extensions for the best development experience:

  • Solidity (Juan Blanco)

  • Hardhat Solidity

  • Prettier - Code formatter

  • ESLint

  • GitLens

  • Better Comments

Create .vscode/settings.json:

Step 6: Create Project Structure

Step 7: Configure Git

Commands

Initial commit

git add . git commit -m "Initial OPN Chain project setup"

2. Write Tests

3. Run Tests

4. Deploy Contracts

Deploy with:

5. Verify Contracts

Advanced Setup

Multi-Signature Wallet Setup

For production deployments, use a multi-sig:

CI/CD Pipeline

Create .github/workflows/test.yml:

Security Setup

Install security tools:

Create security check script:

Troubleshooting

Common Issues

1. "Cannot find module" errors

2. Compilation errors

3. Network connection issues

4. Gas estimation errors

Getting Help


Last updated