赛亚开发工具使用指南 (4)

此水龙头代码在石墨烯水龙头源码(https://github.com/cryptonomex/faucet )上修改,指南示例在DigitalOcean 的 ubuntu 16.04 服务器上测试正常。ubuntu 18.04、更高版本ruby,甚至相同配置下的vultr服务器均有各种报错,欢迎填坑。
此使用SEER测试网络,若有需要,请更换为主网。

在服务器运行一个SEER命令行钱包

新建一个screen,命名为seer。

screen -S seer

新建一个目录,命名为seer。

mkdir seer

下载最新版本SEER命令行钱包到seer目录,并重命名为seer.tar.gz,示例中的版本是0.0.4,请替换为最新版。

curl -Lo seer/seer.tar.gz https://github.com/seer-project/seer-core-package/releases/download/v0.04/seer-ubuntu-0.0.4.tar.gz

进入seer目录

cd seer

解压缩seer.tar.gz

tar xzvf seer.tar.gz

启动命令行钱包,此例中的chain-id为测试网络,通过任意命令行钱包输入info指令获取,默认为主网chain-id,-s参数为钱包连接的节点api,此处为测试网络公告api节点,-r参数为钱包暴露的websocket RPC端口,水龙头程序即是通过此端口控制命令行钱包进行操作, -H为钱包暴露的HTTP RPC端口,所有端口都可以自行修改。

./cli_wallet --chain-id="da68a9c5f2fd9ed48e626ea301db1c77505523884ba0dd409e779246c6ea26cf" -s ws://123.206.78.97:8002 -r 127.0.0.1:9991 -H 127.0.0.1:9992

以上指令可以复制以下命令粘贴至终端,一次性执行:

screen -S seer mkdir seer curl -Lo seer/seer.tar.gz https://github.com/seer-project/seer-core-package/releases/download/v0.04/seer-ubuntu-0.0.4.tar.gz cd seer tar xzvf seer.tar.gz ./cli_wallet --chain-id="da68a9c5f2fd9ed48e626ea301db1c77505523884ba0dd409e779246c6ea26cf" -s ws://123.206.78.97:8002 -r 127.0.0.1:9991 -H 127.0.0.1:9992

钱包启动后,先设置钱包解锁密码,123替换为你想设置的密码

set_password 123

解锁钱包

unlock 123

导入账号资金私钥

import_key okok 5JkbV8aTaYRVaarTUJQ9Y56cr4QajxNFfCoQj6Q9JFL8XvUZ5CQ import_key else 5KiSC6rRAEkTj72fg3G3zF8RHmCEgZw7aSXBjKqDfvY2XN1qvyd

以上指令可以复制以下命令粘贴至终端,一次性执行:

set_password 123 unlock 123 import_key okok 5JkbV8aTaYRVaarTUJQ9Y56cr4QajxNFfCoQj6Q9JFL8XvUZ5CQ import_key else 5KiSC6rRAEkTj72fg3G3zF8RHmCEgZw7aSXBjKqDfvY2XN1qvyd

钱包需要在unlocked状态,才能被水龙头调用。

钱包连接正常的显示:

mkdir seer curl -Lo seer/seer.tar.gz https://github.com/seer-project/seer-core-package/releases/download/v0.04/seer-ubuntu-0.0.4.tar.gz cd seer tar xzvf seer.tar.gz ./cli_wallet --chain-id="da68a9c5f2fd9ed48e626ea301db1c77505523884ba0dd409e779246c6ea26cf" -s ws://123.206.78.97:8002 -r 127.0.0.1:9991 -H 127.0.0.1:9992 root@ubuntu-s-1vcpu-1gb-sfo2-01:~# mkdir seer root@ubuntu-s-1vcpu-1gb-sfo2-01:~# curl -Lo seer/seer.tar.gz https://github.com/seer-project/seer-core-package/releases/download/v0.04/seer-ubuntu-0.0.4.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 615 0 615 0 0 1044 0 --:--:-- --:--:-- --:--:-- 1045 100 13.7M 100 13.7M 0 0 904k 0 0:00:15 0:00:15 --:--:-- 2220k root@ubuntu-s-1vcpu-1gb-sfo2-01:~# cd seer root@ubuntu-s-1vcpu-1gb-sfo2-01:~/seer# tar xzvf seer.tar.gz cli_wallet witness_node root@ubuntu-s-1vcpu-1gb-sfo2-01:~/seer# ./cli_wallet --chain-id="da68a9c5f2fd9ed48e626ea301db1c77505523884ba0dd409e779246c6ea26cf" -s ws://123.206.78.97:8002 -r 127.0.0.1:9991 -H 127.0.0.1:9992 Logging RPC to file: logs/rpc/rpc.log 3562294ms th_a main.cpp:131 main ] key_to_wif( committee_private_key ): 5KCBDTcyDqzsqehcb52tW5nU6pXife6V2rX9Yf7c3saYSzbDZ5W 3562295ms th_a main.cpp:135 main ] nathan_pub_key: SEER6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV 3562295ms th_a main.cpp:136 main ] key_to_wif( nathan_private_key ): 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 Starting a new wallet with chain ID da68a9c5f2fd9ed48e626ea301db1c77505523884ba0dd409e779246c6ea26cf (from CLI) 3562296ms th_a main.cpp:183 main ] wdata.ws_server: ws://123.206.78.97:8002 3562921ms th_a main.cpp:188 main ] wdata.ws_user: wdata.ws_password: Please use the set_password method to initialize a new wallet before continuing 3564395ms th_a main.cpp:227 main ] Listening for incoming RPC requests on 127.0.0.1:9991 3564396ms th_a main.cpp:252 main ] Listening for incoming HTTP RPC requests on 127.0.0.1:9992 new >>> set_password 123 set_password 123 null locked >>> unlock 123 unlock 123 null unlocked >>> import_key okok 5JkbV8aTaYRVaarTUJQ9Y56cr4QajxNFfCoQj6Q9JFL8XvUZ5CQ import_key okok 5JkbV8aTaYRVaarTUJQ9Y56cr4QajxNFfCoQj6Q9JFL8XvUZ5CQ 3572083ms th_a wallet.cpp:793 save_wallet_file ] saving wallet to file wallet.json 3572084ms th_a wallet.cpp:467 copy_wallet_file ] backing up wallet wallet.json to after-import-key-1cd0784e.wallet true unlocked >>> import_key else 5KiSC6rRAEkTj72fg3G3zF8RHmCEgZw7aSXBjKqDfvY2XN1qvyd import_key else 5KiSC6rRAEkTj72fg3G3zF8RHmCEgZw7aSXBjKqDfvY2XN1qvyd 3572941ms th_a wallet.cpp:467 copy_wallet_file ] backing up wallet wallet.json to before-import-key-1bece5d8.wallet 3573189ms th_a wallet.cpp:793 save_wallet_file ] saving wallet to file wallet.json 3573191ms th_a wallet.cpp:467 copy_wallet_file ] backing up wallet wallet.json to after-import-key-1bece5d8.wallet true unlocked >>>

完成后隐藏此screen:

Control + a d

安装mysql和依赖环境 apt update apt-get install -y mysql-server libmysqlclient-dev libreadline-dev build-essential nodejs ruby-railties libssl-dev

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpsjwp.html