EOS官方源码文档
EOS官方构建文档
目前支持的平台以及硬件要求
git clone https://github.com/eosio/eos --recursive
这个会有些耗时,需要等待段时间。
./eosio_build.sh
~/opt/mongodb/bin/mongod -f ~/opt/mongodb/mongod.conf &
cd build
make test
cd build
sudo make install
cd /eos/build/programs/nodeos
./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin
nodeos
这里会报错 我们需要修改config.ini配置文件
cd ~/.local/share/eosio/nodeos/config
# Enable block production with the testnet producers
producer-name = eosio
# Load the block producer plugin, so you can produce blocks
plugin = eosio::producer_plugin
# Wallet plugin
plugin = eosio::wallet_api_plugin
# As well as API and HTTP plugins
plugin = eosio::chain_api_plugin
plugin = eosio::http_plugin
# This will be used by the validation step below, to view account history
plugin = eosio::history_api_plugin
保存运行
nodeos
docker 版本要^17.05
cd eos/Docker
sudo docker build . -t eosio/eos
sudo docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v /tmp/work:/work -v /tmp/eosio/data:/mnt/dev/data -v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console"
默认情况下,所有数据都保存在 docker volume中。如果数据过时或损坏,则可以删除它:
docker inspect --format '{{ range .Mounts }}{{ .Name }} {{ end }}' nodeos
fdc265730a4f697346fa8b078c176e315b959e79365fc9cbd11f090ea0cb5cbc
docker volume rm fdc265730a4f697346fa8b078c176e315b959e79365fc9cbd11f090ea0cb5cbc
或者,可以直接将主机目录安装到容器中。
docker run --name nodeos -v /path-to-data-dir:/opt/eos/bin/data-dir -p 8888:8888 -p 9876:9876 -t eosio/eos nodeosd.sh arg1 arg2
curl http://127.0.0.1:8888/v1/chain/get_info
docker-compose up
After docker-compose up, two services named nodeos and keosd will be started. nodeos service will expose ports 8888 and 9876 to the host. keosd service does not expose any port to the host, it is only accessible to cleos when runing cleos is running inside the keosd container as described in “Execute cleos commands” section.