steem奇幻旅:用steem官方docker镜像中的命令行钱包cli_wallet创建Steem安全新号

in #cn5 years ago (edited)

0. 目标

主要流程

1. 搭建本地的docker环境

ubuntu18.04 安装 docker
添加专用系统账户 steemd

2. 获取Steem的官方docker镜像
3. 用docker镜像方式运行 cli_wallet
4. 在 cli_wallet 中导入旧账号的密钥
5. 在 cli_wallet 中 生成密钥对
6. 在 cli_wallet 中 用密钥对的公钥生成新账号
7. 用密钥对的私钥,在steemit上登录新账号的在线钱包
8. 在steemit的官方在线钱包中,更换新号的密码
9. 可以正常用新号(记住密码,以备将来被盗号后的恢复)
附录:源码释疑

0. 目标

cli_wallet 是 Steem 的命令行钱包,可以直接和 Steem 节点交互,完成很多重要的钱包相关的操作,包括创建新号.

通过 cli_wallet 创建的新号,更安全,不受任何号码的控制(包括自己的旧号或steemit官方).

但cli_wallet需要Steem节点支持WebSocket RPC(ws/wss),暂时找到一个(也可以自己搭建):wss://steemd.privex.io

主要流程

1. 搭建本地的docker环境  
2. 获取Steem的官方docker镜像  
3. 用docker镜像方式运行 cli_wallet  
4. 在 cli_wallet 中导入旧账号的密钥(负责支付创建账号的3STEEM费用)  
5. 在 cli_wallet 中 生成密钥对  
6. 在 cli_wallet 中 用密钥对的公钥生成新账号,新号各种密码都是这个密钥对  
7. 用密钥对的私钥,在steemit上登录新账号的在线钱包  
8. 在steemit的官方在线钱包中,更换新号的密码,让各种密码都不一样,方便分级管理  
9. 可以正常用新号(记住密码,以备将来被盗号后的恢复).  

1. 搭建本地的docker环境

ubuntu18.04 安装 docker

这里以ubuntu18.04为例,其他系统的docker安装,很容易google/baidu.

安装docker包:$ sudo apt update && sudo apt install git containerd docker.io -y
也可通过 get.docker.com 安装 docker:

$ curl -fsSL get.docker.com -o get-docker.sh 
$ sh get-docker.sh

启动 docker 服务:$ service docker restart
查看 docker 状态(报错):$ systemctl status docker.service$ journalctl -xn

添加专用系统账户 steemd

添加专用系统账户 steemd,并加入到 docker 组:

$ sudo adduser steemd
$ sudo usermod -aG sudo steemd
$ sudo usermod -aG docker steemd
$ sudo su - steemd 

这样,steemd用户就可以直接运行docker,而不需要经常sudo操作了.

2. 获取Steem的官方docker镜像

使用官方 docker 镜像,便于灾备恢复或硬分叉时能快速操作,也可以自己从github上下载源码编译.
获取官方 docker 镜像:$ docker pull steemit/steem
查看获取情况 : $ docker images | grep steemit

steemit/steem       latest              1325632326e0        5 weeks ago         2.24GB

如果无法访问官方 docker.com/docker.io ,可修改docker 镜像源:$ sudo vi /etc/docker/daemon.json

{
"registry-mirrors":  ["https://registry.docker-cn.com","http://hub-mirror.c.163.com"]
}

其他可选:

  1. 中国科技大学:https://docker.mirrors.ustc.edu.cn
  2. Docker 官方中国区:https://registry.docker-cn.com
  3. 网易:http://hub-mirror.c.163.com
  4. 阿里云:https://pee6w651.mirror.aliyuncs.com

3. 用docker镜像方式运行 cli_wallet

以docker镜像方式运行 cli_wallet: $ docker run -it steemit/steem /usr/local/steemd-default/bin/cli_wallet -s wss://steemd.privex.io

Logging RPC to file: logs/rpc/rpc.log
Starting a new wallet
3104566ms main.cpp:169                  main                 ] wdata.ws_server: wss://steemd.privex.io 
Please use the set_password method to initialize a new wallet before continuing
new >>> 

首次使用,需要为本地钱包设置密码:new >>> set_password yourpwd

new >>> set_password yourpwd
set_password yourpwd
null
locked >>> 

此时钱包处于锁定状态,解锁钱包:locked >>> unlock yourpwd

locked >>> unlock yourpwd
unlock yourpwd
null
unlocked >>> 

如果在使用过程中,出现没有反应,可能是 cli_wallet 断开了和steem节点之间的网络连接,需要ctrl+d退出,重新按之前的操作重做.

4. 在 cli_wallet 中导入旧账号的密钥

cli_wallet创建新号,需要向steem节点支付3steem费用,因此必须先有一个旧账号,里面至少有支付创建账号所需的3STEEM.
导入旧号的钱包密钥(active key):unlocked >>> import_key 5J-active-key

import_key 5J-active-key
3555971ms wallet.cpp:427                save_wallet_file     ] saving wallet to file wallet.json
true
unlocked >>> 

查看导入的账号资产:unlocked >>> list_my_accounts

unlocked >>> list_my_accounts 
list_my_accounts 
585041ms websocket_api.cpp:102         on_message           ] message: {"jsonrpc":"2.0","result":[["acu.fund"]],"id":1} 
585171ms websocket_api.cpp:102         on_message           ] message: {"jsonrpc":"2.0","result":[{...} 
olduser              102.164 STEEM        614866.009468 VESTS        0.499 SBD
-------------------------------------------------------------------------
TOTAL                 102.164 STEEM        614866.009468 VESTS        0.499 SBD

5. 在 cli_wallet 中 生成密钥对

生成密钥对:unlocked >>> suggest_brain_key

suggest_brain_key
{
  "brain_priv_key": "WACE other words COGNATE",
  "wif_priv_key": "5JY-wif_priv_key-5iB",
  "pub_key": "STM8QhX-pub_key-Dw1KB"
}
unlocked >>> 

6. 在 cli_wallet 中 用密钥对的公钥生成新账号

用 suggest_brain_key 生产的 pub_key ,创建新号(旧号为olduser,新号为newuser):create_account_with_keys "olduser" "newuser" "" "STM8QhX-pub_key-Dw1KB" "STM8QhX-pub_key-Dw1KB" "STM8QhX-pub_key-Dw1KB" "STM8QhX-pub_key-Dw1KB" true

创建的新号,各种密码都是这个密钥对,返回信息显示,旧账号作为creator支付了 3 STEEM费用:

{
  "ref_block_num": 62156,
  "ref_block_prefix": 3768508021,
  "expiration": "2019-10-12T14:18:15",
  "operations": [[
      "account_create",{
        "fee": "3.000 STEEM",
        "creator": "olduser",
        "new_account_name": "newuser",

7. 用密钥对的私钥,在steemit上登录新账号的在线钱包

浏览器打开 https://steemitwallet.com , 用新用户名和密钥对的私钥(wif_priv_key)登录.

8. 在steemit的官方在线钱包中,更换新号的密码

新号的所有密码都是密钥对的私钥,不利于分级管理,因此登录官方在线钱包后,立即更改密码,让各种密码都不一样,方便分级管理 : https://steemitwallet.com/@newuser/password

9. 可以正常用新号(记住密码,以备将来被盗号后的恢复)

分别备份四个密码,在不同的场合,用不同的秘密:/post/Active/Owner/Memo

附录:源码释疑

为何这样创建账号,可以不受其他任何账号的控制,可以从源码和源码注释中,找到说明.
更多的 cli_wallet 操作,可以参考源码中的说明.

Sort:  

@busy 太呕心吧? 默认把自己放到收益名单中,而且10%呢.
屏幕快照 2019-10-12 下午11.17.58.png
刚才点发布的时候,没在意.默认是选中状态:
屏幕快照 2019-10-12 下午11.20.45.png

至少也应该让新手确认一下吧?

是有点过分呢!scanme

Congratulations~ You are free from any blacklists~

thanks!
and what's mean?

能翻译成英文吗?要么我帮你翻译也行?:)

可以啊,不过注意busy默认的选项.加上原文链接,方便中文社区看见.

你是专门做匿名注册的?

不过这个教程的匿名性,还不够哦

!thumbup
恭喜你!您的这篇文章入选 @justyy 今日 (2019-10-14) 榜单 【优秀的文章】, 回复本条评论24小时内领赏,点赞本评论将支持 @dailychina 并增加将来您的奖赏。
@justyy 是CN区的见证人,请支持他,给他投票,或者设置justyy为见证人代理。感谢!@justyy的主要贡献:https://steemyy.com

Congratulations! This post has been selected by @justyy as today's (2019-10-14) 【Good Posts】, Steem On! Reply to this message in 24 hours to get rewards. Upvote this comment to support the @dailychina and increase your future rewards! ^_^

SteemIt 工具、API接口、机器人和教程
SteemIt Tools, Bots, APIs and Tutorial



If you believe what I am doing, please consider a spare vote voting me here, thank you very much indeed.

@justyy - the author of https://SteemYY.com and I have been a Steem Witness for more than a year now.

Hello @dailychina! You are awesome!


command: !thumbup is powered by witness @justyy and his contributions are: https://steemyy.com
More commands are coming!

写的不错@tipu curate

可惜了一幅原创贴

还了点念想,没全部踩没了

  • 스팀 코인판 커뮤니티를 이용해주셔서 감사합니다.
  • 2019년 10월 15일부터는 스팀코인판에서 작성한 글만 SCT 토큰을 보상받을 수 있습니다
  • 스팀 코인판 이외의 곳에서 작성된 글은 SCT 보상에서 제외되니 주의 바랍니다.
  • Thanks to everyone who continues to participate in SteemCoinPan community.
  • From Oct 15, 2019, we will provide SCT rewards for postings published on SteemCoinPan.
  • You won't get SCT rewards at all if you create a posting on other Steem Dapps after Oct 15, 2019.

Congratulations @dappcoder! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 50 upvotes. Your next target is to reach 100 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

The new SteemFest⁴ badge is ready
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.29
TRX 0.11
JST 0.033
BTC 63945.57
ETH 3135.76
USDT 1.00
SBD 4.00