> For the complete documentation index, see [llms.txt](https://bluwhale.gitbook.io/bluwhaleai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bluwhale.gitbook.io/bluwhaleai/oceanum-oxn/smart-contract-development/development-environment-setup.md).

# Development Environment Setup

Before writing your first line of Solidity, get the environment right. This page lists what to install and how to configure it for Oceanum (OXN).

### Required tools <a href="#required-tools" id="required-tools"></a>

| Tool                             | Purpose                                  | Recommended version |
| -------------------------------- | ---------------------------------------- | ------------------- |
| **Node.js**                      | JavaScript runtime for Hardhat and SDKs  | 18 or newer         |
| **npm** (or **pnpm** / **yarn**) | Package manager                          | Comes with Node.js  |
| **Hardhat** or **Foundry**       | Solidity build / test / deploy toolchain | Latest stable       |
| **Git**                          | Version control                          | Any recent version  |
| **A code editor**                | VS Code recommended                      | -                   |

You do **not** need Rust, Go, or any special Oceanum (OXN)-specific toolchain to develop dApps.

### Recommended VS Code extensions <a href="#recommended-vs-code-extensions" id="recommended-vs-code-extensions"></a>

For Solidity development:

* **Solidity** (`JuanBlanco.solidity`) — syntax highlighting, linting, compiler integration
* **Prettier - Code formatter** — consistent formatting
* **ESLint** — JavaScript / TypeScript linting for scripts

### Environment variables <a href="#environment-variables" id="environment-variables"></a>

Most dApp projects use a `.env` file for secrets and endpoint URLs. Recommended contents:

.env

```
PRIVATE_KEY=0x...                                # your funded testnet account
OXN_RPC_URL=https://rpc.bout.network
OXN_CHAIN_ID=186
```

**Never commit `.env`** — add it to `.gitignore`. For CI, use encrypted secrets rather than committed files.

### Directory layout <a href="#directory-layout" id="directory-layout"></a>

For a standard Hardhat project:

```
my-oxn-dapp/
├── contracts/                    # Solidity source
├── scripts/                      # deployment and interaction scripts
├── test/                         # tests
├── hardhat.config.js             # Hardhat configuration
├── package.json
├── .env                          # secrets (do not commit)
└── .gitignore
```

For Foundry:

```
my-oxn-foundry/
├── src/                          # Solidity source
├── test/                         # Solidity tests
├── script/                       # deployment scripts
├── lib/                          # dependencies (git submodules)
├── foundry.toml
├── remappings.txt
└── .gitignore
```

### OXN-specific packages <a href="#oxn-specific-packages" id="oxn-specific-packages"></a>

For confidential contract interaction from JavaScript, you'll want:

```
npm install --save @oasisprotocol/sapphire-ethers-v6
```

For Hardhat integration:

```
npm install --save-dev @oasisprotocol/sapphire-hardhat
```

See [Quickstart: Hardhat](https://docs.bout.network/quickstart/hardhat-hello-world) for the complete setup walkthrough, or [SDKs: TypeScript / JavaScript](https://docs.bout.network/sdks/typescript) for the SDK reference.

### Sanity checks <a href="#sanity-checks" id="sanity-checks"></a>

Run these before starting development to confirm your environment is correct:

```
node --version                   # >= 18
npm --version                    # any recent
git --version                    # any recent
curl -s https://rpc.bout.network -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","method":"eth_chainId","id":1}' | grep '"0xba"'
```

The last check confirms the Oceanum (OXN) RPC is reachable and returning the expected chain ID.

### Next steps <a href="#next-steps" id="next-steps"></a>

* [**Compiling Contracts**](https://docs.bout.network/build/compiling) — critical compiler settings
* [**Deploy Your First Contract (Hardhat)**](https://docs.bout.network/quickstart/hardhat-hello-world) — end-to-end walkthrough

[Edit this page](https://github.com/oxn-network/oxn-docs/edit/main/docs/06-build/dev-environment.md)[PreviousSmart Contract Development](https://docs.bout.network/category/smart-contract-development)[NextCompiling Contracts](https://docs.bout.network/build/compiling)
