geth new account php,geth账户管理指南

使用geth的account命令管理账户:

geth account [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命令新建账户:

$ 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 list命令列表显示已有账户,可选的可以使用--keystore指定keystore目录:

~$ 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 account import命令,通过导入私钥来创建一个新账户,

~$ 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命令来更新指定账户的密码:

~$ 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

如果你希望马上开始学习以太坊DApp开发,安利几个教程:

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值