参考:
https://github.com/cryptonomex/graphenehttp://docs.bitshares.eu/installation/Build.html#building-bitshares-grapheneBuilding BTS 2.0 in Ubuntu from scratch
https://bitsharestalk.org/index.php/topic,19612.0.htmlHOWTO RUN A BLOCK-PRODUCING WITNESS
http://docs.bitshares.eu/bitshares/tutorials/witness-howto.html第一步:内存12G以上。
准备环境,保证网络畅通,能翻墙就翻墙。
(1)因为14.04 LTS不提供g++-4.9,所以要:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo: add-apt-repository: command not found
sudo apt-get install python-software-properties
安装后还是报command not found,所以依赖包还没有安装完全,少了什么呢?
执行命令:
add-apt-repository
,发现还需要software-properties-common
ok,执行安装命令:
apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
If you get build failures due to abi incompatibilities, just use gcc 4.9:
CC=gcc-4.9 CXX=g++-4.9 cmake .
参考资料:http://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-on-ubuntu-14-04
(2)安装依赖的工具
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9The --slave, with g++, will cause g++ to be switched along with gcc, to the same version. But, at this point gcc-4.9 will be your only version configured in update-alternatives
sudo apt-get install cmake make libbz2-dev libdb++-dev libdb-dev libssl-dev openssl libreadline-dev autoconf libtool git libcurl4-openssl-dev
如果gcc-4.9还出错,那就重复上一环节,可能网络问题导致安装失败,多来几次就好了
(3)Build Boost 1.57.0 ,可能要翻墙,有时候连不上。也可以浏览器下载。
BOOST_ROOT=$HOME/opt/boost_1_57_0
sudo apt-get update
sudo apt-get install autotools-dev build-essential g++ libbz2-dev libicu-dev python-dev
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.bz2/download' -O boost_1_57_0.tar.bz2
[ $( sha256sum boost_1_57_0.tar.bz2 | cut -d ' ' -f 1 ) == "910c8c022a33ccec7f088bd65d4f14b466588dda94ba2124e78b8c57db264967" ] || ( echo 'Corrupt download' ; exit 1 )
tar xjf boost_1_57_0.tar.bz2
cd boost_1_57_0/
./bootstrap.sh "--prefix=$BOOST_ROOT"
./b2 install
第二步:Build Graphene
cd ..
git clone
https://github.com/bitshares/bitshares-core.gitcd bitshares-core
git submodule update --init --recursive
BOOST_ROOT=$HOME/opt/boost_1_57_0
CC=gcc-4.9 CXX=g++-4.9 cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Debug .
make
如果出了错误,重来时要 rm CMakeCache.txt
提示错误:编译时找不到Makefile,大多数原因是boost没安装好。
第三步:运行节点
apt-get install screen
screen -S n
./programs/witness_node/witness_node -s 104.200.28.117:61705 --rpc-endpoint=127.0.0.1:8090
如果同步出错,那么添加--replay-blockchain试试
(要在bitshares-2目录下执行,否则,容易出现路径识别错误)
第四步:
区块同步完成后,另来一个窗口 运行命令行钱包
screen -S w
cd bitshares-core/programs/cli_wallet
./cli_wallet -s ws://127.0.0.1:8090
new>>>set_password bts2000
locked >>> unlock bts2000
使用教程
https://github.com/cryptonomex/graphene/wiki/CLI-Wallet-Cookbook命令列表
https://github.com/cryptonomex/graphene/blob/master/libraries/wallet/include/graphene/wallet/wallet.hpp(help)
(gethelp)
(info)
(about)
(begin_builder_transaction)
(add_operation_to_builder_transaction)
(replace_operation_in_builder_transaction)
(set_fees_on_builder_transaction)
(preview_builder_transaction)
(sign_builder_transaction)
(propose_builder_transaction)
(propose_builder_transaction2)
(remove_builder_transaction)
(is_new)
(is_locked)
(lock)(unlock)(set_password)
(dump_private_keys)
(list_my_accounts)
(list_accounts)
(list_account_balances)
(list_assets)
(import_key)
(import_accounts)
(import_account_keys)
(import_balance)
(suggest_brain_key)
(register_account)
(upgrade_account)
(create_account_with_brain_key)
(sell_asset)
(sell)
(buy)
(borrow_asset)
(cancel_order)
(transfer)
(transfer2)
(get_transaction_id)
(create_asset)
(update_asset)
(update_bitasset)
(update_asset_feed_producers)
(publish_asset_feed)
(issue_asset)
(get_asset)
(get_bitasset_data)
(fund_asset_fee_pool)
(reserve_asset)
(global_settle_asset)
(settle_asset)
(whitelist_account)
(create_committee_member)
(get_witness)
(get_committee_member)
(list_witnesses)
(list_committee_members)
(create_witness)
(update_witness)
(create_worker)
(update_worker_votes)
(get_vesting_balances)
(withdraw_vesting)
(vote_for_committee_member)
(vote_for_witness)
(set_voting_proxy)
(set_desired_witness_and_committee_member_count)
(get_account)
(get_account_id)
(get_block)
(get_account_count)
(get_account_history)
(get_market_history)
(get_global_properties)
(get_dynamic_global_properties)
(get_object)
(get_private_key)
(load_wallet_file)
(normalize_brain_key)
(get_limit_orders)
(get_call_orders)
(get_settle_orders)
(save_wallet_file)
(serialize_transaction)
(sign_transaction)
(get_prototype_operation)
(propose_parameter_change)
(propose_fee_change)
(approve_proposal)
(dbg_make_uia)
(dbg_make_mia)
(dbg_push_blocks)
(dbg_generate_blocks)
(dbg_stream_json_objects)
(dbg_update_object)
(flood_network)
(network_add_nodes)
(network_get_connected_peers)
(set_key_label)
(get_key_label)
(get_public_key)
(get_blind_accounts)
(get_my_blind_accounts)
(get_blind_balances)
(create_blind_account)
(transfer_to_blind)
(transfer_from_blind)
(blind_transfer)
(blind_history)
(receive_blind_transfer)
(get_order_book)
如果同步未完成,cli_wallet运行会出错:
root@iZ11zwnk21tZ:~/bitshares-2/programs/cli_wallet# ./cli_wallet -s ws://127.0.0.1:8090 -H 127.0.0.1:8091
Logging RPC to file: logs/rpc/rpc.log
1808214ms th_a main.cpp:120 main ] key_to_wif( committee_private_key ): 5KCBDTcyDqzsqehcb52tW5nU6pXife6V2rX9Yf7c3saYSzbDZ5W
1808214ms th_a main.cpp:124 main ] nathan_pub_key: BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
1808214ms th_a main.cpp:125 main ] key_to_wif( nathan_private_key ): 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
11 eof_exception: End Of File
unexpected end of file
th_a json.cpp:430 variant_from_stream