DxChain Wiki
  • 👋Welcome to DxChain!
    • About $DX
    • About DxChain V3
    • Important Links
    • Project Updates
  • 📝The Basics
    • 📖DxChain V3 LitePaper
      • Notice
      • 1. Background
      • 2. Introduction
      • 3. The Ecosystem Powered by DxChain 3.0
      • 4. DxChain Design Principles & Architecture
        • 4.1 Fully Compatible with EVM
        • 4.2 DPoS Consensus Algorithm
        • 4.3 Cross Chain
        • 4.4 API Layer
        • 4.5 Blacklist Management
        • 4.6 P2P Decentralized Network Layer
        • 4.7 MPT + LevelDB
        • 4.8 Ellipse Curve Digital Signature Algorithm
      • 5. Economic system
      • 6. Governance
      • 7. Roadmap
      • 8. Follow Us
      • 9. Reference
      • 10. Risk Warning
  • 🪙Stake and Trade
    • About DX DPoS
    • How to Earn DX
    • Stake on DxChain
      • DxChain V3 Staking
      • Wallet
      • Consensus
      • How to Stake
    • Develop on DxChain
      • Compile and Run
      • On-chain Interaction
        • DPoS API
      • Smart Contract
      • Private Chain Construction
      • Genesis Block
      • Parameters Table
      • Mainnet
      • Testnet
      • Participate as Validator
    • Trade on DxChain
      • Cross Chain Bridge
  • ⛏️Liquidity Mining
    • Introduction of DxFarm
      • Functions
    • Tutorial
  • 🎙️Media Press
  • 🌏中文社区
    • 📙DxChain新人手册
    • 📜DxChain V3技术文档
      • 1. 背景
      • 2. 简介
      • 3. DxChain 3.0赋能的生态系统
      • 4. 技术的设计原理与架构
        • 4.1 全面兼容EVM
        • 4.2 DPOS共识机制
        • 4.3 跨链
        • 4.4 接口层
        • 4.5 严格的黑名单管理
        • 4.6 P2P分布式网络层
        • 4.7 MPT + LevelDB
        • 4.8 椭圆曲线数字签名算法
      • 5. 经济系统
      • 6. 社区治理
      • 7. 在社交媒体上与我们互动
      • 8. 参考文献
      • 9. 风险提示
      • 免责声明
    • ⛓️重要链接
    • 💻开发者文档
      • 关于DxChain 3.0
      • 钱包
      • 共识
      • 创世块
      • 开发者
        • 编译和运行
        • 链上交互
          • DPoS API
        • 智能合约
        • 私链搭建
        • 主网
        • 测试网
      • 参与区块验证
      • 参数表
    • 💎「DX V3去中心化质押」
      • 质押投票
        • 1)连接钱包
        • 2)进行投票
          • 可能出现的问题
        • 3)领取奖励
        • 4)取消投票
      • 成为节点
        • 1)部署节点
        • 2)申请节点
        • 3)同意节点
        • 4)成为节点
        • 5)取消节点
        • 6)恢复节点
      • 测试环境
    • 💎「DX V3托管社区」
      • 托管社区FAQ
      • 矿机节点
        • 1)进行投票
        • 2)领取奖励
        • 3)取消投票
      • 超级节点
        • 1)成为超级节点
        • 2)修改奖励比例和质押数
        • 3)查看节点托管费用
        • 4)查看节点收益
        • 5)恢复/取消节点
    • 💡骆驼小课堂
      • 🪙USDT是什么?
      • 🪙什么是币币交易?
      • 🪙如何支付节点托管费用?
      • 💬如何加入DxChain全球社区
      • 🌉【跨链桥】进行了跨链交易但不到账
      • 📱DxChain3.0测试教程
      • 🧬区块链的共识机制
      • 🔐私钥/助记词是什么
      • 🌉什么是区块链的跨链技术
    • 🪧社区布告
      • 节点托管收费细则
      • DxChain V3节点公告
      • 「提现白名单」功能上线公告
      • DX关于热钱包使用安全的公告
      • DX关于Coinbase钱包支持DX-ERC20的公告
Powered by GitBook
On this page
  • Prepare an Account
  • Create genesis.json
  • Initialize the Genesis Block
  • Start the Node
  • Start Mining
  • Multi-nodes Mining

Was this helpful?

  1. Stake and Trade
  2. Develop on DxChain

Private Chain Construction

PreviousSmart ContractNextGenesis Block

Last updated 2 years ago

Was this helpful?

Prepare an Account

Access the working directory /directory/of/geth

$ ./geth account new --datadir ./data

The keystore file of the new account is located under the path/directory/of/dxc/build/bin/data/keystore.

Import the JSON file in Metamask.

Create genesis.json

  1. Create gensis.json file under /path/to/dxc/build/bin/

  2. Change chainId to 72

  3. Replace the initial address in extraData with your new account address

"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000a88548e97af8809afac9dc7a930650c1179510590000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
===>>>
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000'your new account'0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",

4. Set the initial balance in alloc for the new address, at least 0x50c783eb9b5c85f2a80000000

{
    "config": {
        "chainId": 72,
        "homesteadBlock": 0,
        "eip150Block": 0,
        "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "eip155Block": 0,
        "eip158Block": 0,
        "byzantiumBlock": 0,
        "constantinopleBlock": 0,
        "petersburgBlock": 0,
        "istanbulBlock": 0,
        "muirGlacierBlock": 0,
        "dpos": {
            "period": 3,
            "epoch": 28800
        }
    },
    "nonce": "0x0",
    "timestamp": "0x5fc58968",
    "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000a88548e97af8809afac9dc7a930650c1179510590000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "gasLimit": "0x280de80",
    "difficulty": "0x1",
    "alloc": {
        "0xa88548e97af8809afac9dc7a930650c117951059": {
            "balance": "0x50c783eb9b5c85f2a80000000"
        }
    },
    "number": "0x0",
    "gasUsed": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}

Initialize the Genesis Block

$ ./geth init /path/to/genesis.json --datadir ./data

Start the Node

Start Mining

  • Open the console ./geth attach --datadir ./data

  • Unlock miner account personal.unlockAccount("miner address","password",0)

  • Start mining miner.start()

Multi-nodes Mining

  1. Other nodes use the same genesis.json initial nodes

  2. Get the enode information for the master nodeadmin.nodeInfo

  3. New node geth attach

  4. Open the console, add the node information for master node admin.addPeer("enode info")

🪙
Compile and Run