当前位置: 首页 > 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
http://www.lryc.cn/news/572619.html

相关文章:

  • 【秒杀系统设计】
  • Vue3+TypeScript+ Element Plus 从Excel文件导入数据,无后端(点击按钮,选择Excel文件,由前端解析数据)
  • 拓客软件有哪些?
  • AI Agent开发与安全
  • 企业级文档搜索系统架构设计与实践指南
  • 巧用云平台API实现开源模型免费调用的实战教程
  • 数据库从零开始:MySQL 中的 DDL 库操作详解【Linux版】
  • 从生活场景学透 JavaScript 原型与原型链
  • 链接过程使用链接器将该目标文件与其他目标文件、库文件、启动文件等链接起来生成可执行文件。附加的目标文件包括静态连接库和动态连接库。其中的启动文件是什么意思?
  • 【内存】Linux 内核优化实战 - vm.max_map_count
  • Spring AOP @AfterReturning (返回通知)的使用场景
  • MySQL 分页查询列表;Explain ;深度分页 ;管理系统,筛选系统
  • AR 眼镜之-条形码识别-实现方案
  • 【AI时代速通QT】第二节:Qt SDK 的目录介绍和第一个Qt Creator项目
  • AI人工智能与LLM大语言模型有什么区别
  • Node.js 在前端开发中的作用与 npm 的核心理解
  • 1.22Node.js 中操作 Redis
  • Kafka线上集群部署方案:从环境选型到资源规划思考
  • 源易信息:领先GEO供应商的市场布局与服务优势
  • 【生活点滴】车辆过户、新车挂牌
  • 变幻莫测:CoreData 中 Transformable 类型面面俱到(五)
  • 学习华为 ensp 的学习心得体会
  • 百胜软件荣膺零售商业评论“《2024创新零售》优秀服务商TOP”奖项
  • 学习华为 ensp 的学习心得体会(适合新手)
  • Python 数据分析与可视化 Day 2 - 数据清洗基础
  • 如何轻松将照片从 iPhone 传输到 Android?
  • 从“数据困境”到“数据生态”:DaaS重塑三甲医院医疗数据治理
  • 【RTSP从零实践】2、使用RTP协议封装并传输H264
  • 基于Gold-YOLO的聚合-分发机制改进YOLOv8教程
  • 电影感户外柔和光线人像街拍摄影后期Lr调色教程,手机滤镜PS+Lightroom预设下载!