YOYOW节点运行测试

YOYOW一览

YOYOW全名“You own your own words”,也是基于Graphene底层技术开发的,我近期主要研究Bitshares,行业内的同用一个底层技术的产品也应该看一看。

官网:https://yoyow.org/

钱包:https://wallet.yoyow.org/

浏览器:https://yoyow.bts.ai/

Github位置:https://github.com/yoyow-org

里面只有4个项目,为什么源代码里没啥东西呢?

安装运行

直接去https://github.com/yoyow-org/yoyow-core/releases下载二进制版本吧,有支持ubuntu、mac、windows的三个版本可供下载。

最新版是180313,这都3个月了没有更新,更新频率有点慢啊!

我是想编译源代码运行的,但是没有源代码,二进制运行就相当简单了,直接命令行运行yoyow_node即可。

(env3) Chaim:yoyow-v0.2.1 Chaim$ ./yoyow_node

2409811ms th_a      main.cpp:125                  create_new_config_fi ] Writing new config file at /Users/Chaim/Documents/workspace/yoyow-v0.2.1/yoyow_node_data_dir/config.ini

2409818ms th_a      witness.cpp:87                plugin_initialize    ] witness plugin:  plugin_initialize() begin

2409820ms th_a      witness.cpp:98                plugin_initialize    ] Public Key: YYW6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV

2409820ms th_a      witness.cpp:116              plugin_initialize    ] witness plugin:  plugin_initialize() end

2409821ms th_a      db_management.cpp:153        open                ] Wiping object_database due to missing or wrong version

2409821ms th_a      object_database.cpp:93        wipe                ] Wiping object database...

2409821ms th_a      object_database.cpp:95        wipe                ] Done wiping object databse.

2409821ms th_a      object_database.cpp:106      open                ] Opening object database from /Users/Chaim/Documents/workspace/yoyow-v0.2.1/yoyow_node_data_dir/blockchain ...

2409826ms th_a      object_database.cpp:111      open                ] Done opening object database.

2409827ms th_a      application.cpp:353          operator()          ] Initializing database...

2409843ms th_a      db_update.cpp:781            adjust_budgets      ] budgets adjusted on block 0, next scheduled adjust block is 10512000

2409843ms th_a      db_update.cpp:757            update_committee    ] committee updated on block 0, next scheduled update block is 864000

2410291ms th_a      application.cpp:214          reset_p2p_node      ] Adding seed node 47.100.41.10:2018

2410292ms th_a      application.cpp:214          reset_p2p_node      ] Adding seed node 52.90.14.81:2018

2410293ms th_a      application.cpp:214          reset_p2p_node      ] Adding seed node 47.90.2.252:2018

2410294ms th_a      application.cpp:229          reset_p2p_node      ] Configured p2p node to listen on 0.0.0.0:56512

2410298ms th_a      witness.cpp:121              plugin_startup      ] witness plugin:  plugin_startup() begin

2410298ms th_a      witness.cpp:136              plugin_startup      ] No witnesses configured! Please add witness IDs and private keys to configuration.

2410299ms th_a      witness.cpp:137              plugin_startup      ] witness plugin:  plugin_startup() end

2410299ms th_a      main.cpp:249                  main                ] Started yoyow node on a chain with 0 blocks.

2410299ms th_a      main.cpp:250                  main                ] Chain ID is ae4f234c75199f67e526c9478cf499dd6e94c2b66830ee5c58d0868a3179baf6

从日志中看 Adding seed node 了三个节点,是只开放了三个公网的节点吗?

现在yoyow链上数据块并不多,大概几十分钟数据就同步完成了,我们启动节点时带上 --rpc-endpoint=127.0.0.1:8090 参数,再启动 ./yoyow_client 即可连上本地节点了。

localhost:yoyow-v0.2.1 Chaim$ ./yoyow_client

Logging RPC to file: logs/rpc/rpc.log

546635ms th_a      main.cpp:120                  main                ] key_to_wif( committee_private_key ): 5KCBDTcyDqzsqehcb52tW5nU6pXife6V2rX9Yf7c3saYSzbDZ5W

546635ms th_a      main.cpp:124                  main                ] nathan_pub_key: YYW6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV

546635ms th_a      main.cpp:125                  main                ] key_to_wif( nathan_private_key ): 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

Starting a new wallet with chain ID ae4f234c75199f67e526c9478cf499dd6e94c2b66830ee5c58d0868a3179baf6 (from egenesis)

546635ms th_a      main.cpp:172                  main                ] wdata.ws_server: ws://localhost:8090

549071ms th_a      main.cpp:177                  main                ] wdata.ws_user:  wdata.ws_password: 

Please use the set_password method to initialize a new wallet before continuing

这些在bitshares的研究系列中说过不少,而且单独有一遍bitshares研究系列【初识cli_wallet】

专门说明cli_wallet相关操作,这里不再细说了。

看看都有哪些cli接口:

unlocked >>> help

help

                          variant_object about()

                      signed_transaction account_auth_platform(string account, string platform_owner, bool broadcast)

                      signed_transaction account_cancel_auth_platform(string account, string platform_owner, bool broadcast)

                                    void add_operation_to_builder_transaction(transaction_handle_type transaction_handle, const operation & op)

                transaction_handle_type begin_builder_transaction()

                                uint64_t calculate_account_uid(uint64_t n)

                      signed_transaction collect_csaf(string from, string to, string amount, string asset_symbol, bool broadcast)

                      signed_transaction collect_csaf_with_time(string from, string to, string amount, string asset_symbol, fc::time_point_sec time, bool broadcast)

                      signed_transaction collect_witness_pay(string witness_account, string pay_amount, string pay_asset_symbol, bool broadcast)

                      signed_transaction committee_proposal_vote(const string committee_member_account, const uint64_t proposal_number, const voting_opinion_type opinion, bool broadcast)

                      signed_transaction create_committee_member(string owner_account, string pledge_amount, string pledge_asset_symbol, string url, bool broadcast)

                      signed_transaction create_platform(string owner_account, string name, string pledge_amount, string pledge_asset_symbol, string url, string extra_data, bool broadcast)

                      signed_transaction create_witness(string owner_account, public_key_type block_signing_key, string pledge_amount, string pledge_asset_symbol, string url, bool broadcast)

            map dump_private_keys()

                          account_object get_account(string account_name_or_id)

                                uint64_t get_account_count()

                            asset_object get_asset(string asset_name_or_id)

        optional get_block(uint32_t num)

                committee_member_object get_committee_member(string owner_account)

          dynamic_global_property_object get_dynamic_global_properties()

                            full_account get_full_account(string account_name_or_uid)

                  global_property_object get_global_properties()

                                variant get_object(object_id_type id)

                        platform_object get_platform(string owner_account)

                                uint64_t get_platform_count()

                                  string get_private_key(public_key_type pubkey)

                              operation get_prototype_operation(string operation_type)

                vector get_relative_account_history(string account, optional op_type, uint32_t stop, int limit, uint32_t start)

                    transaction_id_type get_transaction_id(const signed_transaction & trx)

                          witness_object get_witness(string owner_account)

                                  string gethelp(const string & method)

                                  string help()

                                    bool import_key(string account_name_or_id, string wif_key)

                                variant info()

                                    bool is_locked()

                                    bool is_new()

                          vector list_account_balances(const string & name)

          map list_accounts_by_name(const string & lowerbound, uint32_t limit)

        vector list_committee_members(const account_uid_type lowerbound, uint32_t limit, data_sorting_type order_by)

      vector list_committee_proposals()

                  vector list_my_accounts_cached()

                vector list_platforms(const account_uid_type lowerbound, uint32_t limit, data_sorting_type order_by)

                  vector list_witnesses(const account_uid_type lowerbound, uint32_t limit, data_sorting_type order_by)

                                    void lock()

                                    void network_add_nodes(const vector & nodes)

                        vector network_get_connected_peers()

                                  string normalize_brain_key(string s)

                            transaction preview_builder_transaction(transaction_handle_type handle)

                                    void remove_builder_transaction(transaction_handle_type handle)

                                    void replace_operation_in_builder_transaction(transaction_handle_type handle, unsigned operation_index, const operation & new_op)

                                    void save_wallet_file(string wallet_filename)

                                  string serialize_transaction(signed_transaction tx)

                                  asset set_fees_on_builder_transaction(transaction_handle_type handle, string fee_asset)

                                    void set_password(string password)

                      signed_transaction set_voting_proxy(string account_to_modify, optional voting_account, bool broadcast)

                      signed_transaction sign_builder_transaction(transaction_handle_type transaction_handle, bool broadcast)

                      signed_transaction sign_transaction(signed_transaction tx, bool broadcast)

                          brain_key_info suggest_brain_key()

                      signed_transaction transfer(string from, string to, string amount, string asset_symbol, string memo, bool broadcast)

                                    void unlock(string password)

                      signed_transaction update_committee_member(string committee_member_account, optional pledge_amount, optional pledge_asset_symbol, optional url, bool broadcast)

                      signed_transaction update_committee_member_votes(string voting_account, flat_set committee_members_to_add, flat_set committee_members_to_remove, bool broadcast)

                      signed_transaction update_platform(string platform_account, optional name, optional pledge_amount, optional pledge_asset_symbol, optional url, optional extra_data, bool broadcast)

                      signed_transaction update_platform_votes(string voting_account, flat_set platforms_to_add, flat_set platforms_to_remove, bool broadcast)

                      signed_transaction update_witness(string witness_account, optional block_signing_key, optional pledge_amount, optional pledge_asset_symbol, optional url, bool broadcast)

                      signed_transaction update_witness_votes(string voting_account, flat_set witnesses_to_add, flat_set witnesses_to_remove, bool broadcast)

从接口数量上来说相对Bitshares要简单多了!

随便测试的几个命令

info

unlocked >>> info

info

{

  "head_block_num": 8024676,

  "head_block_id": "007a72647e00dc7d8a83d00c24a0ac185e102b5c",

  "head_block_time": "2018-06-12T16:25:15",

这个我用来记录下写文章时间吧...

get_full_account

unlocked >>> get_full_account 411041266

get_full_account 411041266

{

  "account": {

    "id": "1.2.7296",

    "uid": 411041266,

    "name": "yoyo411041266",

    ...

    },

  "statistics": {

    "id": "2.6.7296",

    "owner": 411041266,

    "total_ops": 4,

    "removed_ops": 0,

    "prepaid": 0,

    "csaf": 150000,

    "core_balance": 0,

    ...

    }

}

没去全面了解这些字段都是干嘛的

"csaf"是等值yoyo币的积分,150000就是等值1.5yoyo的手续费积分,"core_balance"是yoyo币数量,"uncollected_witness_pay"是未领取的见证人工资,至于资产精度用"get_asset YOYO"取。

get_relative_account_history

unlocked >>> get_relative_account_history 411041266 null 1 10 10

get_relative_account_history 411041266 null 1 10 10

# block_num time              description/fee_payer/fee/operation_result 

4 7867304 2018-06-07T05:14:21 account_update_auth_operation 411041266 fee: 0.10000 YOYO

3 5869270 2018-03-29T15:13:00 account_auth_platform_operation 411041266 fee: 1 YOYO

2 5869223 2018-03-29T15:10:39 csaf_collect_operation 224373708 fee: 0.10000 YOYO

1 5869222 2018-03-29T15:10:36 Create Account 'yoyo411041266'  (Fee: 0 YOYO)

import_key

导入私钥需要在yoyow钱包->设置中查看并拷贝私钥,并用 import_key 导入。

update_committee_member_votes

update_witness_votes

set_voting_proxy

试图给网上一位朋友投票,yoyo币不够出错,至少需要10000个yoyo币才能投票。

unlocked >>> update_committee_member_votes 411041266 [258970833] [] true

2868334ms th_a      wallet.cpp:2353              sign_transaction    ] Caught exception while broadcasting tx f410580c745c4edca19f7d0152e3aa860eca70c6:  0 exception: unspecified

Assert Exception: account_stats->core_balance >= global_params.min_governance_voting_balance: Need more balance to be able to vote: have 0 YOYO, need 10000 YOYO

collect_witness_pay

update_witness

create_witness

unlocked >>> create_witness 411041266 YYW5fSfBbNn8zGHYbvSDk3VfxdEQyXj6ii1reVvBdePopWLLwx4pn 10000 YOYO "" true

嗯,没YOYO,建立失败,等转了YOYO再说,问题是要不要转呢?

参考

https://www.yoyow123.com/thread-355-1-1.html

http://www.tucaod.com/2170.html



https://steemit.com/graphene/@chaimyu/yoyow

你可能感兴趣的:(YOYOW节点运行测试)