Geth-1.10.16 私链搭建

本文详细介绍如何在CentOS 7环境下安装配置Geth客户端,包括创建账户、初始化创世块、启动Geth节点等步骤,并提供了命令行操作示例。

0、安装环境

虚拟机中安装的操作系统:Centos7

参考官网文档:Private Networks | Go Ethereum

1、创建账户

(1)创建目录rungeth并进入

[root@localhost local]# cd geth-alltools-1.10.16/     #进入geth目录
[root@localhost geth-alltools-1.10.16]# mkdir rungeth #创建目录rungeth
[root@localhost geth-alltools-1.10.16]# cd rungeth    #进入rungeth目录

(2)创建账户

[root@localhost rungeth]# geth account new --datadir data
INFO [03-25|00:43:10.089] Maximum peer count                       ETH=50 LES=0 total=50
INFO [03-25|00:43:10.089] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
Your new account is locked with a password. Please give a password. Do not forget this password.
Password:         #输入密码(我输入的是abc)
Repeat password:  #确认密码

Your new key was generated

Public address of the key:   0x654FFcC87B54280d5BAA24CA7D366AD21E3A3C73  #生成账户地址
Path of the secret key file: data/keystore/UTC--2022-03-24T16-43-17.897096805Z--654ffcc87b54280d5baa24ca7d366ad21e3a3c73

- 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!

(3)查看生成目录及文件

[root@localhost rungeth]# tree data
data
└── keystore
    └── UTC--2022-03-24T16-43-17.897096805Z--654ffcc87b54280d5baa24ca7d366ad21e3a3c73

1 directory, 1 file

(4)查看账户信息

[root@localhost rungeth]# cat data/keystore/UTC--2022-03-24T16-43-17.897096805Z--654ffcc87b54280d5baa24ca7d366ad21e3a3c73  | jq .
{
  "address": "654ffcc87b54280d5baa24ca7d366ad21e3a3c73",
  "crypto": {
    "cipher": "aes-128-ctr",
    "ciphertext": "3928f93d9aafef698c5ce1fe199a0437b0ac5efc853c94886a22bbff826f6282",
    "cipherparams": {
      "iv": "8976121cedcef7ba44be2176ce58f569"
    },
    "kdf": "scrypt",
    "kdfparams": {
      "dklen": 32,
      "n": 262144,
      "p": 1,
      "r": 8,
      "salt": "5981b38618d601c62befd9e40f38ba7de7cc82c83fcdef4e0900ab9318db59be"
    },
    "mac": "921527ffdc1ffc752157b114397f7d869e69840d80be58daec80d4217d272530"
  },
  "id": "b0a493e2-6d39-43b6-ae8e-6a3874e7e7d9",
  "version": 3
}

也可通过如下方式查看账户(此账户查看

评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值