Skip to Content
Devkit CLIOverview

conflux-devkit CLI

A local Conflux development environment — start a node, open a browser dashboard, compile and deploy contracts, and run the Bootstrap catalog — all from one command.


Getting started

npx conflux-devkit

Or install globally:

npm install -g conflux-devkit conflux-devkit

Opens http://localhost:7748  automatically and starts both a Conflux eSpace node (port 8545) and a Core Space node (port 12537).


Docker

docker run -p 7748:7748 -p 8545:8545 -p 12537:12537 cfxdevkit/devkit

What’s in the dashboard

SectionDescription
AccountsPre-funded genesis accounts with private keys
BootstrapDeploy pre-built contract templates (ERC-20, ERC-721, staking, etc.)
CompilerUpload and compile .sol files in-browser
WalletSet up a local HD wallet
LogsLive node logs and transaction history

Configuration

Create a devkit.config.json in your project root:

{ "port": 7748, "evmPort": 8545, "corePort": 12537, "accounts": 10, "mnemonic": "test test test test test test test test test test test junk", "blockTime": 0 }
OptionDefaultDescription
port7748Dashboard HTTP port
evmPort8545Conflux eSpace RPC port
corePort12537Conflux Core Space RPC port
accounts10Number of pre-funded genesis accounts
mnemonicrandomBIP-39 mnemonic for genesis accounts
blockTime0Block time in seconds (0 = on-demand mining)

Connect your wallet (MetaMask)

Add a custom network in MetaMask:

FieldValue
Network nameConflux eSpace Local
RPC URLhttp://localhost:8545
Chain ID2030
SymbolCFX

Use with the SDK

import { ClientManager } from '@cfxdevkit/core' const client = new ClientManager({ network: 'local' }) // eSpace local → http://localhost:8545 const block = await client.evm.publicClient.getBlockNumber() // Core Space local → http://localhost:12537 const epoch = await client.core.publicClient.getEpochNumber()
Last updated on