搭建EOS本地测试环境

本文主要参照EOS的官方文档 https://developers.eos.io/eosio-nodeos/docs

Getting the Code

获取EOS源码:

git clone https://github.com/EOSIO/eos --recursive

大概需要等几分钟,等代码clone完成。

Build Options

编译选项
EOS可以用多种途径编译:

  • Autobuild Script
  • Docker
  • Manual Build

编译过程会把生成的内容放在 eos/build 目录,生成的可执行文件放在 eos/build/programs 目录。

系统配置要求
所有系统上,都需要满足:
7GB RAM free required
20GB Disk free required

否则执行编译脚本时报错:

$ ./eosio_build.sh

    Beginning build version: 1.2
    Sat Jul 14 03:04:30 UTC 2018
    User: yzp
    git head id: 3c6134c68fa4d52df58955bc1a1475f7adbf3cfa
    Current branch: master

    ARCHITECTURE: Linux

    OS name: Ubuntu
    OS Version: 17.10
    CPU speed: 2712.000Mhz
    CPU cores: 1
    Physical Memory: 3922 Mgb
    Disk install: /dev/sda1
    Disk space total: 589G
    Disk space available: 478G
    Your system must have 7 or more Gigabytes of physical memory installed.
    Exiting now.

调整虚拟机内存到8GB,继续下面的编译过程

开始编译

这里采用 Autobuild Script 方式进行编译(执行自动脚本 eosio_build.sh 会自动检查需要的依赖并下载依赖,然后自动执行编译脚本完成编译,否则采用手动编译的话需要手动下载所有的依赖,然后手动执行编译脚本):

cd eos
./eosio_build.sh

执行命令后会检查缺少的依赖,并询问是否安装依赖,选择yes后会下载安装依赖,并继续进行编译。

—————————————————- 分割线 —————————————————-

执行完上述命令后等待自动编译就行了,这里接下去是看下自动编译过程中输出的log,在这里只展示关键的部分,来大概了解下整体的过程:

yzp@ubuntu:~/blockchain/EOS/eos$ ./eosio_build.sh

    Beginning build version: 1.2
    Sat Jul 14 05:31:13 UTC 2018
    User: yzp
    git head id: 3c6134c68fa4d52df58955bc1a1475f7adbf3cfa
    Current branch: master

    ARCHITECTURE: Linux

    OS name: Ubuntu
    OS Version: 17.10
    CPU speed: 2712.000Mhz
    CPU cores: 1
    Physical Memory: 7954 Mgb
    Disk install: /dev/sda1
    Disk space total: 589G
    Disk space available: 477G

    Checking for installed dependencies.

    Package clang-4.0 found.
    Package lldb-4.0 found.
    Package libclang-4.0-dev found.
    Package cmake found.
    Package make found.
    Package automake found.
    Package libbz2-dev found.
    Package libssl-dev found.
    Package libgmp3-dev found.
    Package autotools-dev found.
    Package build-essential found.
    Package libicu-dev found.
    Package python2.7-dev found.
    Package python3-dev found.
    Package autoconf found.
    Package libtool found.
    Package curl found.
    Package zlib1g-dev found.
    Package doxygen found.
    Package graphviz found.

    No required dpkg dependencies to install.

    Checking boost library installation.
    Boost found at /home/yzp/opt/boost.

    Checking MongoDB installation.
    MongoDB configuration found at /home/yzp/opt/mongodb/mongod.conf.

    Checking MongoDB C++ driver installation.

    Installing MongoDB C & C++ drivers.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   616    0   616    0     0    308      0 --:--:--  0:00:02 --:--:--   232
100 7535k  100 7535k    0     0   396k      0  0:00:19  0:00:19 --:--:--  858k
configure: Current version (from VERSION_CURRENT file): 1.9.3
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no

..........

Mongo C++ driver安装完成后,开始检查和安装secp256k1-zkp

-- Installing: /usr/local/include/mongocxx/v_noabi/mongocxx/config/config.hpp
-- Installing: /usr/local/include/mongocxx/v_noabi/mongocxx/config/version.hpp
-- Installing: /usr/local/lib/pkgconfig/libmongocxx-static.pc

    Mongo C++ driver successfully installed @ /usr/local/lib/libmongocxx-static.a.


    Checking secp256k1-zkp installation.
    Installing secp256k1-zkp (Cryptonomex branch).
Cloning into 'secp256k1-zkp'...
remote: Counting objects: 2615, done.
remote: Total 2615 (delta 0), reused 0 (delta 0), pack-reused 2615
Receiving objects: 100% (2615/2615), 1.10 MiB | 685.00 KiB/s, done.
Resolving deltas: 100% (1865/1865), done.
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
libtoolize: copying file 'build-aux/m4/libtool.m4'
libtoolize: copying file 'build-aux/m4/ltoptions.m4'

.........

secp256k1-zkp安装完成后,开始检查和安装LLVM with WASM support

 /bin/mkdir -p '/usr/local/include'
 /usr/bin/install -c -m 644 include/secp256k1.h '/usr/local/include'
 /bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 libsecp256k1.pc '/usr/local/lib/pkgconfig'
make[1]: Leaving directory '/tmp/secp256k1-zkp'

    secp256k1 successfully installed @ /usr/local/lib.


    Checking for LLVM with WASM support.
    Installing LLVM with WASM
Cloning into 'llvm'...
remote: Counting objects: 24803, done.
remote: Compressing objects: 100% (23959/23959), done.
remote: Total 24803 (delta 1319), reused 15737 (delta 562), pack-reused 0
Receiving objects: 100% (24803/24803), 34.45 MiB | 5.92 MiB/s, done.
Resolving deltas: 100% (1319/1319), done.
Checking out files: 100% (24000/24000), done.
Cloning into 'clang'...
remote: Counting objects: 13323, done.
remote: Compressing objects: 100% (11695/11695), done.
Receiving objects:   1% (146/13323), 628.00 KiB | 0 bytes/s 

........

WASM安装完成后,就开始安装EOS了

..........


-- Installing: /home/yzp/opt/wasm/lib/cmake/llvm/./LLVMExternalProjectUtils.cmake
-- Installing: /home/yzp/opt/wasm/lib/cmake/llvm/./AddLLVM.cmake
-- Installing: /home/yzp/opt/wasm/lib/cmake/llvm/./CheckAtomic.cmake

    WASM successffully installed @ /home/yzp/opt/wasm/bin.



>>>>>>>> ALL dependencies sucessfully found or installed . Installing EOSIO

>>>>>>>> CMAKE_BUILD_TYPE=Release
>>>>>>>> ENABLE_COVERAGE_TESTING=false
>>>>>>>> DOXYGEN=false

-- The C compiler identification is Clang 4.0.1
-- The CXX compiler identification is Clang 4.0.1
-- Check for working C compiler: /usr/bin/clang-4.0
-- Check for working C compiler: /usr/bin/clang-4.0 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++-4.0
-- Check for working CXX compiler: /usr/bin/clang++-4.0 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using custom FindBoost.cmake
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   filesystem
--   system
--   program_options
--   signals
--   serialization
--   chrono
--   unit_test_framework
--   context
--   locale
--   iostreams
-- Configuring EOSIO on Linux
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- binaryen building with -std=c++11
-- binaryen building for platform x86-64
-- binaryen building with -Wall
-- binaryen building with -Werror
-- binaryen building with -Wextra
-- binaryen building with -Wno-unused-parameter
-- binaryen building with -fno-omit-frame-pointer
-- binaryen building with -fPIC
-- binaryen building with -O2
-- binaryen building with -UNDEBUG
-- Using 'SYS' as CORE symbol name
-- Using 'EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV' as public key for 'eosio' account
-- Found WASM: /home/yzp/opt/wasm/bin/clang  
-- Using WASM clang => /home/yzp/opt/wasm/bin/clang
-- Using WASM llc => /home/yzp/opt/wasm/bin/llc
-- Using WASM llvm-link => /home/yzp/opt/wasm/bin/llvm-link
-- Found Secp256k1: /usr/local/lib/libsecp256k1.a
-- Found GMP: /usr/lib/x86_64-linux-gnu/libgmp.a  
-- Configuring fc to build on Unix/Apple
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.a (found version "1.0.2g") 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- zlib found
-- Configuring Builtins
-- Configuring SoftFloat
-- Using custom FindBoost.cmake
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   filesystem
--   system
--   chrono
--   unit_test_framework
--   locale
-- Configuring ChainBase on Linux
-- Using custom FindBoost.cmake
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   filesystem
--   system
--   chrono
--   program_options
--   unit_test_framework
--   locale
-- Configuring AppBase on Linux
-- Found Git: /usr/bin/git (found version "2.14.1") 
-- Git commit revision: 3c6134c6
-- Git commit revision: 3c6134c6
-- Found Intl: /usr/include  
-- Git commit revision: 3c6134c6
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.13") found components:  doxygen dot 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yzp/blockchain/EOS/eos/build
Scanning dependencies of target wasm
[  0%] Building CXX object externals/binaryen/src/wasm/CMakeFiles/wasm.dir/literal.cpp.o
[  0%] Building CXX object externals/binaryen/src/wasm/CMakeFiles/wasm.dir/wasm.cpp.o
[  0%] Building CXX object externals/binaryen/src/wasm/CMakeFiles/wasm.dir/wasm-binary.cpp.o
[  0%] Building CXX object externals/binaryen/src/wasm/CMakeFiles/wasm.dir/wasm-io.cpp.o
[  0%] Building CXX object externals/binaryen/src/wasm/CMakeFiles/wasm.dir/wasm-s-parser.cpp.o
[  0%] Building CXX object externals/binaryen/src/wasm/CMakeFiles/wasm.dir/wasm-type.cpp.o
[  0%] Linking CXX static library ../../lib/libwasm.a


.......

EOS安装完成后可以看到:

........

[ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/resource_limits_test.cpp.o
[ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/special_accounts_tests.cpp.o
[ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/tic_tac_toe_tests.cpp.o
[ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/wasm_tests.cpp.o
[ 98%] Building CXX object unittests/CMakeFiles/unit_test.dir/whitelist_blacklist_tests.cpp.o
[ 98%] Linking CXX executable unit_test
[ 98%] Built target unit_test
Scanning dependencies of target plugin_test
[ 98%] Building CXX object tests/CMakeFiles/plugin_test.dir/wallet_tests.cpp.o
[ 98%] Building CXX object tests/CMakeFiles/plugin_test.dir/main.cpp.o
[ 98%] Linking CXX executable plugin_test
[ 98%] Built target plugin_test
Scanning dependencies of target print_floats
[100%] Building CXX object tools/CMakeFiles/print_floats.dir/print_floats.cpp.o
[100%] Linking CXX executable print_floats
[100%] Built target print_floats


     _______  _______  _______ _________ _______
    (  ____ \(  ___  )(  ____ \\__   __/(  ___  )
    | (    \/| (   ) || (    \/   ) (   | (   ) |
    | (__    | |   | || (_____    | |   | |   | |
    |  __)   | |   | |(_____  )   | |   | |   | |
    | (      | |   | |      ) |   | |   | |   | |
    | (____/\| (___) |/\____) |___) (___| (___) |
    (_______/(_______)\_______)\_______/(_______)

    EOSIO has been successfully built. 12:35:31

    To verify your installation run the following commands:

    export PATH=${HOME}/opt/mongodb/bin:$PATH
    /home/yzp/opt/mongodb/bin/mongod -f /home/yzp/opt/mongodb/mongod.conf &
    cd /home/yzp/blockchain/EOS/eos/build; make test

    For more information:
    EOSIO website: https://eos.io
    EOSIO Telegram channel @ https://t.me/EOSProject
    EOSIO resources: https://eos.io/resources/
    EOSIO Stack Exchange: https://eosio.stackexchange.com
    EOSIO wiki: https://github.com/EOSIO/eos/wiki

根据上面自动编译时输出的log可以看到自动编译也和手动编译时需要先安装依赖一样(详见:https://developers.eos.io/eosio-nodeos/docs/clean-install-ubuntu-1604-and-higher ),先安装一些必须的依赖的dpkg,再安装Boost , mongo-cxx-driver ,secp256k1-zkp ,以及重新编译安装llvm和clang以包含进WASM(因为默认安装的llvm和clang没有WASM)。 依赖安装完成后再编译EOS。

整个过程大概需要几个小时。

Build Validation(Optionally, 可选的,不做这一步也可以)

编译完成之后,可以运行一些测试用例,来验证编译是否成功。
按照下列步骤进行:
start mongod

On Linux platforms:

~/opt/mongodb/bin/mongod -f ~/opt/mongodb/mongod.conf &

On MacOS:

/usr/local/bin/mongod -f /usr/local/etc/mongod.conf &

run make test
all platforms:

cd build
make test

验证成功后会看到如下输出:

yzp@ubuntu:~/blockchain/EOS/eos/build$ make test
Running tests...
Test project /home/yzp/blockchain/EOS/eos/build
      Start  1: test_cypher_suites
 1/37 Test  #1: test_cypher_suites ...................   Passed    0.17 sec
      Start  2: validate_simple.token_abi
 2/37 Test  #2: validate_simple.token_abi ............   Passed    0.21 sec
      Start  3: validate_eosio.token_abi
 3/37 Test  #3: validate_eosio.token_abi .............   Passed    0.04 sec
      Start  4: validate_eosio.msig_abi


...........


      Start 35: restart-scenarios-test-hard_replay
35/37 Test #35: restart-scenarios-test-hard_replay ...   Passed  228.30 sec
      Start 36: restart-scenarios-test-none
36/37 Test #36: restart-scenarios-test-none ..........   Passed  131.73 sec
      Start 37: validate_dirty_db_test
37/37 Test #37: validate_dirty_db_test ...............   Passed    2.38 sec

100% tests passed, 0 tests failed out of 37

Total Test time (real) = 1618.49 sec

说明全部测试用例通过。

Install Executables

上面编译完成后,在 eos/build/programs/nodeos 路径下已经有nodeos可执行程序了,进入该目录直接执行

./nodeos

即可启动程序,但是为了便于开发者使用,可以把 build 下的内容安装到 /usr/local 路径下(系统预设的可执行文件路径),类似于windows系统下把可执行程序添加到path环境变量中,这样就可以随处运行 nodeos 命令即可启动程序了。

cd build
sudo make install
yzp@ubuntu:~/blockchain/EOS/eos/build$ sudo make install
[sudo] password for yzp: 
[  0%] Built target wasm
[  0%] Built target ast
[  0%] Built target asmjs
[  1%] Built target cfg
[  4%] Built target passes
[  5%] Built target support
[  5%] Built target eosio-s2wasm
[  6%] Built target binaryen
[  6%] Built target emscripten-optimizer
[ 10%] Built target fc
[ 10%] Built target test_cypher_suites
[ 10%] Built target builtins
[ 34%] Built target softfloat
[ 34%] Built target chainbase
[ 34%] Built target chainbase_test
[ 34%] Built target Platform
[ 34%] Built target Logging
[ 34%] Built target IR
[ 35%] Built target Runtime
[ 35%] Built target Emscripten
[ 36%] Built target WASM
[ 36%] Built target WAST
[ 36%] Built target Disassemble
[ 36%] Built target Test
[ 36%] Built target eosio-wast2wasm
[ 37%] Built target wavm
[ 38%] Built target eos_utilities
[ 39%] Built target appbase
[ 39%] Built target appbase_example
[ 41%] Built target eosio_chain
[ 43%] Built target libc++
[ 43%] Built target eosiolib
[ 82%] Built target libc
[ 84%] Built target eosio.bios
[ 85%] Built target eosio_testing
[ 85%] Built target abi_generator
[ 86%] contract...
[ 86%] Built target copy_skeleton_contract
[ 86%] Built target simple.token
[ 86%] Built target eosio.token
[ 86%] Built target eosio.msig
[ 86%] Built target eosio.sudo
[ 87%] Built target multi_index_test
[ 88%] Built target eosio.system
[ 89%] Built target identity_common
[ 89%] Built target identity
[ 89%] Built target identity_interface
[ 89%] Built target identity_test
[ 89%] Built target stltest
[ 89%] Built target exchange
[ 89%] Built target test_exchange
[ 89%] Built target test.inline
[ 90%] Built target hello
[ 90%] Built target asserter
[ 91%] Built target infinite
[ 91%] Built target proxy
[ 92%] Built target test_api
[ 92%] Built target test_api_mem
[ 92%] Built target test_api_db
[ 92%] Built target test_api_multi_index
[ 92%] Built target test_ram_limit
[ 93%] Built target noop
[ 94%] Built target dice
[ 94%] Built target tic_tac_toe
[ 94%] Built target payloadless
[ 94%] Built target chain_plugin
[ 94%] Built target bnet_plugin
[ 94%] Built target http_client_plugin
[ 94%] Built target producer_plugin
[ 94%] Built target net_plugin
[ 95%] Built target http_plugin
[ 95%] Built target net_api_plugin
[ 95%] Built target chain_api_plugin
[ 95%] Built target producer_api_plugin
[ 95%] Built target history_plugin
[ 95%] Built target history_api_plugin
[ 95%] Built target wallet_plugin
[ 96%] Built target wallet_api_plugin
[ 96%] Built target txn_test_gen_plugin
[ 96%] Built target db_size_api_plugin
[ 96%] Built target nodeos
[ 96%] Built target cleos
[ 96%] Built target keosd
[ 96%] Built target eosio-launcher
[ 96%] Built target eosio-abigen
[ 96%] Built target deferred_test
[ 98%] Built target unit_test
[ 98%] Built target plugin_test
[100%] Built target print_floats
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/etc/eosio
-- Installing: /usr/local/etc/eosio/launcher/testnet.template
-- Up-to-date: /usr/local/etc/eosio
-- Up-to-date: /usr/local/etc/eosio/launcher
-- Installing: /usr/local/include/boost
-- Installing: /usr/local/include/boost/pfr
-- Installing: /usr/local/include/boost/pfr/precise.hpp



........



-- Installing: /usr/local/bin/eosio-launcher
-- Installing: /usr/local/bin/eosio-abigen
-- Installing: /usr/local/bin/eosiocpp

安装完成。现在,随便在哪个位置,比如是在桌面,打开命令行,输入nodeos也能启动程序了!

Configuration

nodeos有两种方式可以进行配置运行参数,命令行 和 配置文件config.ini。每一个命令行中的参数都对应配置文件中的一个设置,如:–plugin eosio::chain_api_plugin 对应config.ini配置文件中的 plugin = eosio::chain_api_plugin 。 如果运行时想采用自定义的配置文件,可以执行:

$ nodeos --config path/to/config.ini

1. 命令行( command line interface (CLI) options )

所有的命令行选项可以执行

$ nodeos --help

进行查看

2. 配置文件( configuration file )

config.ini 的位置在:
Mac OS:

~/Library/Application Support/eosio/nodeos/config

Linux:

~/.local/share/eosio/nodeos/config

默认的config.ini配置文件:

# Track only transactions whose scopes involve the listed accounts. Default is to track all transactions. (eosio::account_history_plugin)
# filter_on_accounts = 

# Limits the maximum time (in milliseconds) processing a single get_transactions call. (eosio::account_history_plugin)
get-transactions-time-limit = 3

# File to read Genesis State from (eosio::chain_plugin)
genesis-json = "genesis.json"

# override the initial timestamp in the Genesis State file (eosio::chain_plugin)
# genesis-timestamp = 

# the location of the block log (absolute path or relative to application data dir) (eosio::chain_plugin)
block-log-dir = "blocks"

# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints. (eosio::chain_plugin)
# checkpoint = 

# Limits the maximum time (in milliseconds) that a reversible block is allowed to run before being considered invalid (eosio::chain_plugin)
max-reversible-block-time = -1

# Limits the maximum time (in milliseconds) that is allowed a pushed transaction's code to execute before being considered invalid (eosio::chain_plugin)
max-pending-transaction-time = -1

# Limits the maximum time (in milliseconds) that is allowed a to push deferred transactions at the start of a block (eosio::chain_plugin)
max-deferred-transaction-time = 20

# Override default WASM runtime (eosio::chain_plugin)
# wasm-runtime = 

# Time to wait, in milliseconds, between creating next faucet created account. (eosio::faucet_testnet_plugin)
faucet-create-interval-ms = 1000

# Name to use as creator for faucet created accounts. (eosio::faucet_testnet_plugin)
faucet-name = faucet

# [public key, WIF private key] for signing for faucet creator account (eosio::faucet_testnet_plugin)
faucet-private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]

# The local IP and port to listen for incoming http connections. (eosio::http_plugin)
http-server-address = 127.0.0.1:8888

# Specify the Access-Control-Allow-Origin to be returned on each request. (eosio::http_plugin)
# access-control-allow-origin = 

# Specify the Access-Control-Allow-Headers to be returned on each request. (eosio::http_plugin)
# access-control-allow-headers = 

# Specify if Access-Control-Allow-Credentials: true should be returned on each request. (eosio::http_plugin)
access-control-allow-credentials = false

# The queue size between nodeos and MongoDB plugin thread. (eosio::mongo_db_plugin)
mongodb-queue-size = 256

# MongoDB URI connection string, see: https://docs.mongodb.com/master/reference/connection-string/. If not specified then plugin is disabled. Default database 'EOS' is used if not specified in URI. (eosio::mongo_db_plugin)
# mongodb-uri = 

# The actual host:port used to listen for incoming p2p connections. (eosio::net_plugin)
p2p-listen-endpoint = 0.0.0.0:9876

# An externally accessible host:port for identifying this node. Defaults to p2p-listen-endpoint. (eosio::net_plugin)
# p2p-server-address = 

# The public endpoint of a peer node to connect to. Use multiple p2p-peer-address options as needed to compose a network. (eosio::net_plugin)
# p2p-peer-address = 

# The name supplied to identify this node amongst the peers. (eosio::net_plugin)
agent-name = "EOS Test Agent"

# Can be 'any' or 'producers' or 'specified' or 'none'. If 'specified', peer-key must be specified at least once. If only 'producers', peer-key is not required. 'producers' and 'specified' may be combined. (eosio::net_plugin)
allowed-connection = any

# Optional public key of peer allowed to connect.  May be used multiple times. (eosio::net_plugin)
# peer-key = 

# Tuple of [PublicKey, WIF private key] (may specify multiple times) (eosio::net_plugin)
# peer-private-key = 

# Log level: one of 'all', 'debug', 'info', 'warn', 'error', or 'off' (eosio::net_plugin)
log-level-net-plugin = info

# Maximum number of clients from which connections are accepted, use 0 for no limit (eosio::net_plugin)
max-clients = 25

# number of seconds to wait before cleaning up dead connections (eosio::net_plugin)
connection-cleanup-period = 30

# True to require exact match of peer network version. (eosio::net_plugin)
network-version-match = 0

# number of blocks to retrieve in a chunk from any individual peer during synchronization (eosio::net_plugin)
sync-fetch-span = 100

# Enable block production, even if the chain is stale. (eosio::producer_plugin)
enable-stale-production = false

# Percent of producers (0-100) that must be participating in order to produce blocks (eosio::producer_plugin)
required-participation = 33

# ID of producer controlled by this node (e.g. inita; may specify multiple times) (eosio::producer_plugin)
# producer-name = 

# Tuple of [public key, WIF private key] (may specify multiple times) (eosio::producer_plugin)
private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]

# The path of the wallet files (absolute path or relative to application data dir) (eosio::wallet_plugin)
wallet-dir = "."

# Timeout for unlocked wallet in seconds. Wallets will automatically lock after specified number of seconds of inactivity. Activity is defined as any wallet command e.g. list-wallets. (eosio::wallet_plugin)
# unlock-timeout = 

# eosio key that will be imported automatically when a wallet is created. (eosio::wallet_plugin)
# eosio-key = 

# Plugin(s) to enable, may be specified multiple times
# plugin = 

Development Environment

Local Single-Node Testnet
启动单一节点的区块链:

cd build/programs/nodeos
./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin

Local Multi-Node Testnet

参考:
https://developers.eos.io/eosio-nodeos/docs

EOSIO本地环境搭建

猜你喜欢

转载自blog.csdn.net/yzpbright/article/details/81033148