当前位置: 首页 > news >正文

以太坊节点搭建私链(POA)

geth

下载

# 克隆以太坊Go实现的仓库
git clone https://github.com/ethereum/go-ethereum.git
cd go-ethereum# 切换到v1.9.25 / v1.10.26 版本的代码
git checkout v1.9.25# 编译并安装
make geth
cp build/bin/geth /usr/local/bin/  # 复制编译好的二进制文件

安装

创建挖矿账户

geth account new --datadir data
==========================================
Your new account is locked with a password. Please give a password. Do not forget this password.
Password: 
Repeat password: Your new key was generatedPublic address of the key:   0x90233e23D4FfBD0954e038d78A68C6c6306Cf6c3
Path of the secret key file: data/keystore/UTC--2025-06-20T07-29-58.379560000Z--90233e23d4ffbd0954e038d78a68c6c6306cf6c3- You can share your public address with anyone. Others need it to interact with you.
- You must NEVER share the secret key with anyone! The key controls access to your funds!
- You must BACKUP your key file! Without the key, it's impossible to access account funds!
- You must REMEMBER your password! Without the password, it's impossible to decrypt the key!

创世文件 genesis.json

{"config": {"chainId": 6666,"homesteadBlock": 0,"eip150Block": 0,"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000","eip155Block": 0,"eip158Block": 0,"byzantiumBlock": 0,"constantinopleBlock": 0,"petersburgBlock": 0,"istanbulBlock": 0,"clique": {"period": 10,"epoch": 30000}},"nonce": "0x0","timestamp": "0x685513ea","extraData": "0x000000000000000000000000000000000000000000000000000000000000000090233e23d4ffbd0954e038d78a68c6c6306cf6c30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","gasLimit": "0x2625a00","difficulty": "0x1","mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000","coinbase": "0x0000000000000000000000000000000000000000","alloc": {"0000000000000000000000000000000000000000": {"balance": "0x1"},"1234e4c33249458534fcaa38aa38b194e1d0efc4": {"balance": "0x200000000000000000000000000000000000000000000000000000000000000"}},"number": "0x0","gasUsed": "0x0","parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000","baseFeePerGas": null
}

对创世区块进行初始化

geth init --datadir ./data genesis.json
cp UTC--2025-06-20T07-29-58.379560000Z--90233e23d4ffbd0954e038d78a68c6c6306cf6c3 ./data/keystore/

v1.9.25启动

geth --datadir ./data --networkid=6666 --http --http.api "eth,net,web3,personal,admin,miner" --http.vhosts --rpcport 8545 --mine --miner.threads 1 --allow-insecure-unlock --unlock "0x90233e23D4FfBD0954e038d78A68C6c6306Cf6c3" --password ./password.txt --nodiscover

v1.10.26启动

geth --datadir ./data --networkid=6666 --http --http.api "eth,net,web3,personal,admin,miner" --http.addr 0.0.0.0 --http.port 8545 --mine --miner.threads 1 --allow-insecure-unlock --unlock "0x90233e23D4FfBD0954e038d78A68C6c6306Cf6c3" --password ./password.txt --nodiscover

相关文章:

  • 【Mini-F5265-OB开发板试用测评】3、MDS 可编程 IP 互联模块
  • WebServer实现:muduo库的主丛Reactor架构
  • 高并发秒杀系统实战(Redis+Lua分布式锁防超卖与库存扣减优化)
  • JVM对象内存分配机制全解析
  • PCB板高速飞拍检测系统 助力电子制造自动化领域
  • 如何导出和迁移离线 Conda 环境
  • Cisco Nexus93240接口带宽显示异常高故障- bug
  • 【目标检测】什么是目标检测?应用场景与基本流程
  • [持续集成]
  • 【案例】性能优化在持续集成与持续交付中的应用
  • element-ui使用el-button去掉focus,删除el-button的focus效果
  • 魔音音乐 5.0.2 | 无损下载 同步网易云歌单UI美观
  • 数据分析对比图表-雷达图全面指南
  • 纯视觉SOTA!华科小米推出ReCogDrive:结合VLM和强化学习的端到端自动驾驶框架
  • 数据库中间件ShardingSphere5
  • 高性能群集部署技术-Nginx+Tomcat负载均衡群集
  • Zephyr 开发进阶:设备树 DTS、板卡 BSP 与驱动模型全解析
  • C++11 GC Interface:从入门到精通
  • window显示驱动开发—使用状态刷新回调函数
  • C# WPF程序界面美化方法与详细步骤
  • 中铁建设集团官网/aso优化的主要内容
  • 网站建立软件/手机管家一键优化
  • 保定哪里有做网站的/百度最新秒收录方法2023
  • 软件外包公司绩效考核/关键词优化外包
  • 武汉培训网站建设/如何做平台推广赚钱
  • 郑州微网站制作/做推广的公司