当前位置: 首页 > 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.lqws.cn/news/448507.html

相关文章:

  • davinci本地启动
  • 全面掌握 C++ 基础:关键特性与进化
  • uni-app-配合iOS App项目开发apple watch app
  • 巧用云平台API实现开源模型免费调用的实战教程
  • 电子电气架构 --- 软件供应商如何进入OEM体系
  • Git 命令全景图:从 clone 到 merge 的完整流程解析
  • 基于深度学习的智能视频行为识别系统:技术与实践
  • 【音视频 | RTP】RTP协议详解(H.264的RTP封包格式、AAC的RTP封包格式)
  • CSS3 3D 转换
  • GitHub Copilot 是什么,怎么使用
  • 上海人工智能实验室明珠湖会议首开,解答AI前沿疑问,推进科学智能
  • 【新手向】GitHub Desktop 的使用说明(含 GitHub Desktop 和 Git 的功能对比)
  • java面试题02访问修饰符有哪些?区别是什么?
  • 如何自建服务器并开启公网IP:本地内网网址让外网访问详细教学
  • 华为CE交换机抓包
  • 如何导出和迁移离线 Conda 环境
  • Java八股文——数据结构「排序算法篇」
  • 【目标检测】什么是目标检测?应用场景与基本流程
  • Spring 中的依赖注入(DI)详解
  • Transformer实战——Hugging Face环境配置与应用详解
  • 【编译原理】语句的翻译
  • Docker环境部署
  • Centos 离线部署(MQTT)EMOX脚本并设置开机自启
  • 4、做中学 | 二年级下期 Golang整型和浮点型
  • 高并发网络通信Netty之空轮询问题
  • 【LUT技术专题】采样间隔自适应3DLUT-AdaInt
  • STM32 HAL 初始化I2C启动DS1307
  • 第1章: 伯努利模型的极大似然估计与贝叶斯估计
  • apisix-使用hmac-auth插件进行接口签名身份验证\apisix consumer
  • 机构运动分析系统开发(Python实现)