geth如何新建帐户?

若是你但愿立刻开始学习以太坊DApp开发,能够访问汇智网提供的出色的在线互动教程:ide

使用geth的account命令管理帐户,例如建立新帐户、更新帐户密码、查询帐户等:学习

geth account <command> [options...] [arguments...]

命令 - command

list    列表显示现有帐户
new     建立一个新的帐户
update  修改帐户
import  导入私钥建立新帐户

可使用--help获取这些命令的帮助信息,例如:区块链

~$ geth account list --help
list [command options] [arguments...]

Print a short summary of all accounts

OPTIONS:
  --datadir "/home/bas/.ethereum"  Data directory for the databases and keystore
  --keystore                       Directory for the keystore (default = inside the datadir)

区块链开发课程精选

建立新帐户

使用geth account new命令新建帐户:this

$ geth account new
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase:
Repeat Passphrase:
Address: {168bc315a2ee09042d83d7c5811b533620531f67}

导入私钥建立新帐户

可使用geth account import命令,经过导入私钥来建立一个新帐户,3d

~$ geth account import --datadir /someOtherEthDataDir ./key.prv
The new account will be encrypted with a passphrase.
Please enter a passphrase now.
Passphrase:
Repeat Passphrase:
Address: {7f444580bfef4b9bc7e14eb7fb2a029336b07c9d}

更新帐户密码

使用geth account update命令来更新指定帐户的密码:code

~$ geth account update a94f5374fce5edbc8e2a8697c15331677e6ebf0b
Unlocking account a94f5374fce5edbc8e2a8697c15331677e6ebf0b | Attempt 1/3
Passphrase:
0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b
Account 'a94f5374fce5edbc8e2a8697c15331677e6ebf0b' unlocked.
Please give a new password. Do not forget this password.
Passphrase:
Repeat Passphrase:
0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b

显示已有帐户

使用geth account list命令列表显示已有帐户,可选的可使用--keystore指定keystore目录:blog

~$ geth account list --keystore /tmp/mykeystore/
Account #0: {5afdd78bdacb56ab1dad28741ea2a0e47fe41331} keystore:///tmp/mykeystore/UTC--2017-04-28T08-46-27.437847599Z--5afdd78bdacb56ab1dad28741ea2a0e47fe41331
Account #1: {9acb9ff906641a434803efb474c96a837756287f} keystore:///tmp/mykeystore/UTC--2017-04-28T08-46-52.180688336Z--9acb9ff906641a434803efb474c96a837756287f

原文: geth帐户管理指南教程

相关文章
相关标签/搜索