刚接触steem的时候设想在树莓派上运行full node,因为白皮书上说比特币的挖矿方式太浪费电,环境不友好,想当然的以为此法可行。经过一周在一台4核,4G内存,60GSSD虚拟机上尝试运行steemd,同步到区块5,200,000后基本停滞下来。 @oflyhigh说树莓派上同步完需要1亿年。
Building on Ubuntu 16.04
虚拟机本地测试没有考虑太多安全性相关的问题,直接用root进行以以下脚本的操作。 编译的脚本来自steemit官方github仓库,一开始按照steem.center上的How to obtain the STEEM client 编译Boost浪费了不少时间。如果你的虚拟机内存较小,编译会出错,需要增加swap。
free
dd if=/dev/zero of=/var/swap.img bs=1024k count=4096
mkswap /var/swap.img
swapon /var/swap.img
free
# Required packages
apt-get install -y \
autoconf \
automake \
cmake \
g++ \
git \
libssl-dev \
libtool \
make \
pkg-config \
python3 \
python3-jinja2
# Boost packages (also required)
apt-get install -y \
libboost-chrono-dev \
libboost-context-dev \
libboost-coroutine-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-locale-dev \
libboost-program-options-dev \
libboost-serialization-dev \
libboost-signals-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev
# Optional packages (not required, but will make a nicer experience)
apt-get install -y \
doxygen \
libncurses5-dev \
libreadline-dev \
perl
git clone https://github.com/steemit/steem
cd steem
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc) steemd
make -j$(nproc) cli_wallet
# optional
make install # defaults to /usr/local
swapoff /var/swap.img
rm -rf /var/swap.img
以上脚本一次性编译生成steemd和cli_wallet。
运行cli_wallet
@abit说运行full node需要80G内存,low memory node需要8G内存,暂时放弃了自己运行full node,因为现在的目标是理解Steem的经济系统以及如何操作blockchain api。steem是个有爱的社区,好多witness都开放了full node,经过多次连接后,我觉得gtg的那个节点稳定性最好,运行以下这行命令就可以开始steem的blockchain api之旅了:cli_wallet -s wss://gtg.steem.house:8090
root@vvltr:~/steemd/logs/p2p# cli_wallet -s wss://gtg.steem.house:8090
Logging RPC to file: logs/rpc/rpc.log
Starting a new wallet
2162583ms th_a main.cpp:154 main ] wdata.ws_server: wss://gtg.steem.house:8090
2163045ms th_a main.cpp:159 main ] wdata.ws_user: wdata.ws_password:
2163332ms th_a websocket_api.cpp:88 on_message ] message: {"id":1,"result":true}
2163576ms th_a websocket_api.cpp:88 on_message ] message: {"id":2,"result":0}
2163894ms th_a websocket_api.cpp:88 on_message ] message: {"id":3,"result":3}
Please use the set_password method to initialize a new wallet before continuing
new >>>
输入about后回车:
bout
2251545ms th_a websocket_api.cpp:88 on_message ] message: {"id":10,"result":{"blockchain_version":"0.19.0","steem_revision":"1ad862ef3132b9cfcba63ca823f7c3391c0f8580","fc_revision":"5cfcb5c0d6ee6ba1acbb40d9de49effc25daf74f"}}
{
"blockchain_version": "0.19.0",
"client_version": "v0.16.1rc1-527-gfcb23b6",
"steem_revision": "fcb23b663e017f8a016f5bed6b80aef3bafbc645",
"steem_revision_age": "6 days ago",
"fc_revision": "5cfcb5c0d6ee6ba1acbb40d9de49effc25daf74f",
"fc_revision_age": "22 weeks ago",
"compile_date": "compiled on Jun 29 2017 at 00:45:40",
"boost_version": "1.58",
"openssl_version": "OpenSSL 1.0.2g 1 Mar 2016",
"build": "linux 64-bit",
"server_blockchain_version": "0.19.0",
"server_steem_revision": "1ad862ef3132b9cfcba63ca823f7c3391c0f8580",
"server_fc_revision": "5cfcb5c0d6ee6ba1acbb40d9de49effc25daf74f"
}
new >>>
可以再试试 info help这两个命令