bitshares研究系列【水龙头(faucet)完整安装】

in #bitshares6 years ago (edited)

刚接触bitshares的时候,就听有人说起“水龙头”这个玩意,后来知道这是注册帐号的一个中心化服务,英文名叫faucet,而且是用Ruby写的,不熟悉Ruby就更不想理它了,最近有些需要还是得研究下这个“水龙头”与咱家的水龙头有什么不一样!

Mac下安装

官网文档和faucet下的README.md一步步安装吧

mysql

mysql在我机器上应该都已安装好了,下面这行就不执行了。

sudo apt-get install mysql-server libmysqlclient-dev
# put a master password for mysql

Ruby

Faucet是用Ruby语言编写的,所以要安装Ruby工具。

Ruby基本没接触过,一会看看代码再评估,不过我相信它没有Erlang难!

cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash

sudo rbenv install 2.2.3
sudo rbenv global 2.2.3
sudo gem install bundler

faucet源代码

git clone https://github.com/cryptonomex/faucet
cd faucet
sudo bundle   # ignore warnings

不过我执行时出错了:

bash-3.2$ sudo bundle
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break
this application for all non-root users on this machine.
Your Gemfile lists the gem devise (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of one of them later.
Fetching gem metadata from https://rubygems.org/.............
...
Fetching nokogiri 1.6.6.2
Installing nokogiri 1.6.6.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/Chaim/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20180429-66458-1sbi3sm.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
-----
The file "/usr/include/iconv.h" is missing in your build environment,
which means you haven't installed Xcode Command Line Tools properly.

To install Command Line Tools, try running `xcode-select --install` on
terminal and follow the instructions.  If it fails, open Xcode.app,
select from the menu "Xcode" - "Open Developer Tool" - "More Developer
Tools" to open the developer site, download the installer for your OS
version and run it.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

...
extconf failed, exit code 1

Gem files will remain installed in /Users/Chaim/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2 for
inspection.
Results logged to
/Users/Chaim/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-17/2.2.0-static/nokogiri-1.6.6.2/gem_make.out

An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.6.2'` succeeds before bundling.

In Gemfile:
  exception_notification was resolved to 4.1.1, which depends on
    actionmailer was resolved to 4.2.4, which depends on
      actionpack was resolved to 4.2.4, which depends on
        actionview was resolved to 4.2.4, which depends on
          rails-dom-testing was resolved to 1.0.7, which depends on
            nokogiri

说没安装啥就安装一遍:

xcode command line developer tools

bash-3.2$ xcode-select --install
xcode-select: note: install requested for command line developer tools

下面这个安装得等developer tools安装完。

bash-3.2$ sudo gem install nokogiri -v '1.6.6.2'

换了个错误,如下:

checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in -lxml2... no
checking for xmlParseDoc() in -llibxml2... no
-----
libxml2 is missing.  Please locate mkmf.log to investigate how it is failing.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

尝试以下方法解决:

bash-3.2$ gem uninstall nokogiri
bash-3.2$ brew install libxml2 libxslt libiconv
bash-3.2$ sudo NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri -- --use-system-libraries --with-iconv-dir="$(brew --prefix libiconv)" --with-xml2-config="$(brew --prefix libxml2)/bin/xml2-config" --with-xslt-config="$(brew --prefix libxslt)/bin/xslt-config"
bash-3.2$ sudo gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2 --use-system-libraries
bash-3.2$ sudo ARCHFLAGS="-arch x86_64" gem install nokogiri
bash-3.2$ NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri

这上面不确定哪步是正确的,也许都可以,重要的是要把bundle这个命令改成如下:

bash-3.2$ sudo bundle config build.nokogiri --use-system-libraries
bash-3.2$ sudo bundle install

这次执行成功,结果如下:

Bundle complete! 26 Gemfile dependencies, 77 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

配置

faucet.yml

cp config/faucet-example.yml config/faucet.yml
vim config/faucet.yml
cli_wallet_connection: ws://127.0.0.1:8098
registrar_account: barnard
referrer_percent: 50
refcode_prefix: F01

default_url: localhost
default_port: 3000

exception_notification:
  sender_address: [email protected]
  exception_recipients: [email protected]

smtp:
  address: address
  user_name: user
  password: password

从这个配置文件可以看出,faucet也是连接cli_wallet,还记得在bitshares研究系列【私链运行】中已经设置了可正常运行的私链,并且把barnard这个帐号提升到了永久会员,那就把barnard设为registrar_account吧!怎么看会员是永久会员,如下:

get_account barnard
{
  "id": "1.2.18",
  "membership_expiration_date": "1969-12-31T23:59:59",
  ...
}

如果会员过期时间是"1969-12-31T23:59:59"就是永久会员了!

secrets.yml

cp config/secrets-example.yml config/secrets.yml
rake secret
vim config/secrets.yml

这一步出错了,提示mysql版本不对,只是密钥设置,测试运行暂时不管,就用缺省的好了!

# Be sure to restart your server when you modify this file.

# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!

# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.

# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.

development:
  secret_key_base: abcdefg123456

test:
  secret_key_base: abcdefg123456

# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
  secret_key_base: abcdefg123456

database.yml

vim config/database.yml
default: &default
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: root
  password:
  host: localhost

development:
  <<: *default
  database: bitshares_faucet_dev

test:
  <<: *default
  database: bitshares_faucet_test

production:
  <<: *default
  database: bitshares_faucet

我机器上mysql用户root的密码就是空,就不用设置了!

刚才不想解决的mysql版本问题,果真还是躲不过!哎~

Bundler::GemRequireError: There was an error while trying to load the gem 'mysql2'.
Gem Load Error is: Incorrect MySQL client library version! This gem was compiled for 5.5.37 but the client library is 5.6.10.

看一下当前mysql版本:

bash-3.2$ mysql -V
mysql  Ver 14.14 Distrib 5.5.37, for osx10.6 (i386) using readline 5.1

此处跳过mysql版本解决方案,因为我也不确定哪个步骤解决的,可能问题是gem mysql库,此处不影响文章主题,不深究了~
gem uninstall mysql2
gem install mysql2 -v '0.3.18'

建立数据库

bash-3.2$ rake db:create; rake db:migrate; rake db:seed
Starting graphene websocket communication event-loop 'ws://127.0.0.1:11011'
Established connection to 'ws://127.0.0.1:11011'
== 1 CreateOrigSchema: migrating ==============================================
-- create_table("assets")
   -> 0.0287s
-- add_index("assets", ["objectid"], {:name=>"index_assets_on_objectid", :unique=>true})
   -> 0.0117s
-- add_index("assets", ["symbol"], {:name=>"index_assets_on_symbol", :unique=>true})
   -> 0.0142s
-- create_table("bts_accounts")
   -> 0.0116s
-- add_index("bts_accounts", ["name"], {:name=>"index_bts_accounts_on_key", :unique=>true})
   -> 0.0162s
-- add_index("bts_accounts", ["objectid"], {:name=>"index_bts_accounts_on_objectid", :unique=>true})
   -> 0.0129s
-- add_index("bts_accounts", ["user_id"], {:name=>"index_bts_accounts_on_user_id"})
   -> 0.0170s
-- create_table("identities")
   -> 0.0100s
-- add_index("identities", ["provider", "uid"], {:name=>"index_identities_on_provider_and_uid", :unique=>true})
   -> 0.0120s
-- add_index("identities", ["user_id"], {:name=>"index_identities_on_user_id"})
   -> 0.0111s
-- create_table("referral_codes")
   -> 0.0112s
-- add_index("referral_codes", ["asset_id"], {:name=>"index_referral_codes_on_asset_id"})
   -> 0.0115s
-- add_index("referral_codes", ["code"], {:name=>"index_referral_codes_on_code", :unique=>true})
   -> 0.0109s
-- create_table("user_actions")
   -> 0.0456s
-- add_index("user_actions", ["action"], {:name=>"index_user_actions_on_action"})
   -> 0.0120s
-- add_index("user_actions", ["campaign"], {:name=>"index_user_actions_on_campaign"})
   -> 0.0110s
-- add_index("user_actions", ["channel"], {:name=>"index_user_actions_on_channel"})
   -> 0.0126s
-- add_index("user_actions", ["referrer"], {:name=>"index_user_actions_on_referrer"})
   -> 0.0121s
-- add_index("user_actions", ["uid"], {:name=>"index_user_actions_on_uid"})
   -> 0.0106s
-- add_index("user_actions", ["widget_id"], {:name=>"index_user_actions_on_widget_id"})
   -> 0.0113s
-- create_table("users")
   -> 0.0120s
-- add_index("users", ["confirmation_token"], {:name=>"index_users_on_confirmation_token", :unique=>true})
   -> 0.0121s
-- add_index("users", ["email"], {:name=>"index_users_on_email"})
   -> 0.0111s
-- add_index("users", ["reset_password_token"], {:name=>"index_users_on_reset_password_token", :unique=>true})
   -> 0.0105s
-- add_index("users", ["uid"], {:name=>"index_users_on_uid"})
   -> 0.0122s
-- create_table("widgets")
   -> 0.0107s
-- add_index("widgets", ["user_id"], {:name=>"index_widgets_on_user_id"})
   -> 0.0120s
== 1 CreateOrigSchema: migrated (0.3770s) =====================================

Starting graphene websocket communication event-loop 'ws://127.0.0.1:11011'
Established connection to 'ws://127.0.0.1:11011'

看起来这个操作与graphene websocket还有通信,还建了一些表和索引,去mysql看看:

mysql> show databases;
+-----------------------+
| Database              |
+-----------------------+
| information_schema    |
| bitcoin               |
| bitshares_faucet_dev  |
| bitshares_faucet_test |
| ethaddr               |
| mysql                 |
| performance_schema    |
| sys                   |
+-----------------------+
8 rows in set (0.00 sec)

多了两个bitshares_xxx的库,这个在database.yml中指定的。

简单看下有哪些表:

mysql> use bitshares_faucet_dev
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+--------------------------------+
| Tables_in_bitshares_faucet_dev |
+--------------------------------+
| assets                         |
| bts_accounts                   |
| identities                     |
| referral_codes                 |
| schema_migrations              |
| user_actions                   |
| users                          |
| widgets                        |
+--------------------------------+
8 rows in set (0.00 sec)

表里数据就先不列出来了,大概就是资产、帐号相关的,后期看看faucet都用来干嘛。

继续执行:

bash-3.2$ RAILS_ENV=production bundle exec rake db:create db:schema:load

运行

rails s

rails命令,即使安装以后也一直错误提示:

bash-3.2$ rails
Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.

这个其实解决很简单,安装rails后要重启终端,无语~ 不熟悉的环境就得付出不少时间代价!

再次启动,成功了,如下:

bash-3.2$ rails s
/Users/Chaim/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-5.2.0/lib/rails/app_loader.rb:53: warning: Insecure world writable dir /Users/Chaim/android-sdk-macosx/platform-tools in PATH, mode 040777
=> Booting WEBrick
=> Rails 4.2.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Starting graphene websocket communication event-loop 'ws://127.0.0.1:11011'
Established connection to 'ws://127.0.0.1:11011'
[2018-04-29 16:27:33] INFO  WEBrick 1.3.1
[2018-04-29 16:27:33] INFO  ruby 2.2.3 (2015-08-18) [x86_64-darwin17]
[2018-04-29 16:27:33] INFO  WEBrick::HTTPServer#start: pid=51549 port=3000

注册帐户

用浏览器访问:http://localhost:3000/ ,显示一个"Loading"黑页面,日志报404错误:

Started GET "/" for ::1 at 2018-04-29 18:56:38 +0800
  ActiveRecord::SchemaMigration Load (0.2ms)  SELECT `schema_migrations`.* FROM `schema_migrations`
Processing by WalletController#index as HTML
  Rendered wallet/index.html.erb (1.8ms)
Completed 200 OK in 21ms (Views: 12.2ms | ActiveRecord: 0.0ms)


Started GET "/wallet/app.css" for ::1 at 2018-04-29 18:56:38 +0800
Processing by WelcomeController#error_404 as CSS
  Parameters: {"path"=>"wallet/app"}
  Rendered welcome/error_404.html.erb (0.3ms)
Completed 404 Not Found in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)

证明这个3000端口监听访问是没有问题了!

参考mac下bitshares-ui无法正常运行这篇文章,运行bitshares-ui

参考bitshares研究系列【初识cli_wallet】这篇文章,运行cli_wallet

这次需要指定 --rpc-endpoint=127.0.0.1:8098,这个与faucet.yml中配置

全部准备就绪后,运行浏览器:http://localhost:8080/ 进入本地私链网页钱包,设置节点为ws://127.0.0.1:8090,设置水龙头为 http://127.0.0.1:3000 ,进入注册帐号页面,注册帐号出现错误:

!!! register_account error: {"code"=>1, "message"=>"Assert Exception: base58str.substr( 0, prefix_len ) == prefix: ", "data"=>{"code"=>10, "name"=>"assert_exception", "message"=>"Assert Exception", "stack"=>[{"context"=>{"level"=>"error", "file"=>"types.cpp", "line"=>49, "method"=>"public_key_type", "hostname"=>"", "thread_name"=>"th_a", "timestamp"=>"2018-04-29T12:01:45"}, "format"=>"base58str.substr( 0, prefix_len ) == prefix: ", "data"=>{"base58str"=>"GPH4yM6i9Y3bpnrpBpUPWX3HK7ZbvEymXibr96re8ZghxRzU6fWdu"}}, {"context"=>{"level"=>"warn", "file"=>"websocket_api.cpp", "line"=>125, "method"=>"on_message", "hostname"=>"", "thread_name"=>"th_a", "timestamp"=>"2018-04-29T12:01:45"}, "format"=>"", "data"=>{"call.method"=>"call", "call.params"=>[0, "register_account", ["barnard18", "GPH4yM6i9Y3bpnrpBpUPWX3HK7ZbvEymXibr96re8ZghxRzU6fWdu", "GPH7RfCPdSYRb6DGBJu4YbHUx4EBn94QFoYZEiGa2rZ4rVyJfWa3w", "barnard", "barnard", 0, true]]}}]}}

为什么这里的密钥是"GPHxxx"呢?好像bitshares-core生成时是“BTSxxx”,也找到对应代码在ChainConfig.js里:

var ecc_config = {
    address_prefix: process.env.npm_config__graphene_ecc_default_address_prefix || "GPH"
};

可是...process.env.npm_config__graphene_ecc_default_address_prefix 我就是不会设,如果是个环境变量的话还不秒解决啊!硬是没设成。。。

不过我找到一个变通的方法,下面有个setPrefix()的方法可以设前缀,既然这样找找有哪个文件引用了bitsharesjs-ws这个库,很容易在api/accountApi.js中找到,也正是处理帐号的api,好吧,就先在这加着试试,加入以下代码:

import {ChainConfig} from "bitsharesjs-ws";
ChainConfig.setPrefix("BTS");

刷新页面,重新注册,这次faucet显示成功了!

Started POST "/api/v1/accounts" for ::1 at 2018-04-30 00:30:55 +0800
Processing by Api::V1::AccountsController#create as JSON
  Parameters: {"account"=>{"name"=>"barnard001", "owner_key"=>"BTS7qo71meYHoHuEwW7S1S98K3rrC61SyrKDaHunmrhZJdg5ojvnH", "active_key"=>"BTS7ptGyCM2EqBx7gKt9p5HrbATQpLzTx35Vuor7buSS7LHdKY6Sz", "memo_key"=>"BTS7ptGyCM2EqBx7gKt9p5HrbATQpLzTx35Vuor7buSS7LHdKY6Sz", "refcode"=>nil, "referrer"=>nil}}
   (0.2ms)  BEGIN
  BtsAccount Exists (0.7ms)  SELECT  1 AS one FROM `bts_accounts` WHERE `bts_accounts`.`remote_ip` = BINARY '::1' AND (created_at > '2018-04-30 00:25:55') LIMIT 1
---- Registering account: 'barnard001' BTS7ptGyCM2EqBx7gKt9p5HrbATQpLzTx35Vuor7buSS7LHdKY6Sz/BTS7qo71meYHoHuEwW7S1S98K3rrC61SyrKDaHunmrhZJdg5ojvnH referrer: 
call: [0, "get_account", ["barnard001"]]
call: [0, "get_account", ["barnard001"]]
Websocket RPC Error: {"code"=>1, "message"=>"Assert Exception: rec && rec->name == account_name_or_id: ", "data"=>{"code"=>10, "name"=>"assert_exception", "message"=>"Assert Exception", "stack"=>[{"context"=>{"level"=>"error", "file"=>"wallet.cpp", "line"=>588, "method"=>"get_account", "hostname"=>"", "thread_name"=>"th_a", "timestamp"=>"2018-04-29T16:30:55"}, "format"=>"rec && rec->name == account_name_or_id: ", "data"=>{}}, {"context"=>{"level"=>"warn", "file"=>"websocket_api.cpp", "line"=>125, "method"=>"on_message", "hostname"=>"", "thread_name"=>"th_a", "timestamp"=>"2018-04-29T16:30:55"}, "format"=>"", "data"=>{"call.method"=>"call", "call.params"=>[0, "get_account", ["barnard001"]]}}]}}
Websocket RPC Error: {"code"=>1, "message"=>"Assert Exception: rec && rec->name == account_name_or_id: ", "data"=>{"code"=>10, "name"=>"assert_exception", "message"=>"Assert Exception", "stack"=>[{"context"=>{"level"=>"error", "file"=>"wallet.cpp", "line"=>588, "method"=>"get_account", "hostname"=>"", "thread_name"=>"th_a", "timestamp"=>"2018-04-29T16:30:55"}, "format"=>"rec && rec->name == account_name_or_id: ", "data"=>{}}, {"context"=>{"level"=>"warn", "file"=>"websocket_api.cpp", "line"=>125, "method"=>"on_message", "hostname"=>"", "thread_name"=>"th_a", "timestamp"=>"2018-04-29T16:30:55"}, "format"=>"", "data"=>{"call.method"=>"call", "call.params"=>[0, "get_account", ["barnard001"]]}}]}}
call: [0, "register_account", ["barnard001", "BTS7ptGyCM2EqBx7gKt9p5HrbATQpLzTx35Vuor7buSS7LHdKY6Sz", "BTS7qo71meYHoHuEwW7S1S98K3rrC61SyrKDaHunmrhZJdg5ojvnH", "barnard", "barnard", 0, true]]
call: [0, "register_account", ["barnard001", "BTS7ptGyCM2EqBx7gKt9p5HrbATQpLzTx35Vuor7buSS7LHdKY6Sz", "BTS7qo71meYHoHuEwW7S1S98K3rrC61SyrKDaHunmrhZJdg5ojvnH", "barnard", "barnard", 0, true]]
{"ref_block_num"=>6305, "ref_block_prefix"=>3331236633, "expiration"=>"2018-04-29T16:31:25", "operations"=>[[5, {"fee"=>{"amount"=>514550, "asset_id"=>"1.3.0"}, "registrar"=>"1.2.18", "referrer"=>"1.2.18", "referrer_percent"=>0, "name"=>"barnard001", "owner"=>{"weight_threshold"=>1, "account_auths"=>[], "key_auths"=>[["BTS7ptGyCM2EqBx7gKt9p5HrbATQpLzTx35Vuor7buSS7LHdKY6Sz", 1]], "address_auths"=>[]}, "active"=>{"weight_threshold"=>1, "account_auths"=>[], "key_auths"=>[["BTS7qo71meYHoHuEwW7S1S98K3rrC61SyrKDaHunmrhZJdg5ojvnH", 1]], "address_auths"=>[]}, "options"=>{"memo_key"=>"BTS7qo71meYHoHuEwW7S1S98K3rrC61SyrKDaHunmrhZJdg5ojvnH", "voting_account"=>"1.2.5", "num_witness"=>0, "num_committee"=>0, "votes"=>[], "extensions"=>[]}, "extensions"=>{}}]], "extensions"=>[], "signatures"=>["200d8b2673c8cdba1be4d76f338482f45268a40e25cf50a38f8edfe2f152e33fa00525596de41e81510cc17939689e4b8fa716e362087c405fd436fd2643d7cd94"]}
  SQL (28.9ms)  INSERT INTO `bts_accounts` (`name`, `owner_key`, `active_key`, `memo_key`, `remote_ip`, `created_at`, `updated_at`) VALUES ('barnard001', 'BTS7qo71meYHoHuEwW7S1S98K3rrC61SyrKDaHunmrhZJdg5ojvnH', 'BTS7ptGyCM2EqBx7gKt9p5HrbATQpLzTx35Vuor7buSS7LHdKY6Sz', 'BTS7ptGyCM2EqBx7gKt9p5HrbATQpLzTx35Vuor7buSS7LHdKY6Sz', '::1', '2018-04-29 16:30:55', '2018-04-29 16:30:55')
   (27.7ms)  COMMIT
  Rendered api/v1/accounts/show.json.jbuilder (21.6ms)
Completed 201 Created in 292ms (Views: 37.3ms | ActiveRecord: 57.4ms)

本地钱包显示注册成功界面

折腾这么大半天就注册一个帐号太不值了,再注册一个!发现没法用水龙头提供的帐户免费注册了,一旦你浏览器已经注册过一个帐号,这个信息就记录在浏览器中,再注册新帐号会让你选择用哪个帐号付费!很简单,清浏览器缓存或者换个浏览器,我决定换个safari再注册个帐号"barnard002"!

这次很容易就注册成功了,我们看看注册这"barnard002"帐号前后barnard帐号的余额变化:

unlocked >>> list_account_balances barnard
list_account_balances barnard
1999979994.85450 BTS

unlocked >>> list_account_balances barnard
list_account_balances barnard
1999979989.70900 BTS

注册这个帐号,注册人成功花了5个BTS!

bitshares注册帐号是必须有注册人的,我们平时在bitshares上注册帐号没有看到注册人,其实注册人就是"水龙头"内置的帐户(registrar_account)。

结论

个人觉得faucet装一下比较容易,但是要真正在私链上能注册用户还是很麻烦的,好几个前题条件:bitshares节点运行在私链上、bitshares-ui正常运行、cli_wallet正常运行、faucet正常运行,而这几个东西的开发语言有c/c++、nodejs、ruby,运行环境也不一样,然后就是把这四大块联合起来,才能完成帐号的注册。

bitshares帐号注册流程:bitshares-ui钱包 ==> faucet(rpc) ==> cli_wallet ==> bitshares-core

本想一篇文章把faucet分析完的,结果安装花了这么多时间和文字说明,faucet的代码分析只能下回分解了!


感谢您阅读 @chaimyu 的帖子,期待您能留言交流!

Sort:  

你好!cn区点赞机器人 @cnbuddy 这厢有礼了。倘若你不喜欢我的留言,请回复“取消”。

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.032
BTC 61660.23
ETH 3056.45
USDT 1.00
SBD 3.82