EOS架構(gòu)簡單介紹
比較有價值的網(wǎng)站?
http://www.eosdata.io
https://steemit.com/
nodeos:區(qū)塊服務(wù)端組件
cleos :和區(qū)塊鏈網(wǎng)絡(luò)交互以及錢包管理的命令行接口
keosd :錢包管理組件
EOS的安裝
源碼安裝
clone EOS的git倉庫
git clone https://github.com/EOSIO/eos --recursive
//git clone --branch dawn-v4.0.0 https://github.com/EOSIO/eos --recursive
編譯
cd eos?
./eosio_build.sh
測試安裝
start?mongod
~/opt/mongodb/bin/mongod -f~/opt/mongodb/mongod.conf&
make test
cd build?
make test
安裝
cd build?
sudo make install
啟動EOS節(jié)點(diǎn)
cd build/programs/nodeos
./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin
查看默認(rèn)配置和創(chuàng)世區(qū)塊
cd? ~/.local/share/eosio/nodeos/config
config.ini
# 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 =
# Override default WASM runtime (eosio::chain_plugin)
# wasm-runtime =
# Maximum size MB of database shared memory file (eosio::chain_plugin)
shared-memory-size-mb = 1024
# Track only transactions whose scopes involve the listed accounts. Default is to track all transactions. (eosio::history_plugin)
# filter_on_accounts =
# The local IP and port to listen for incoming http connections; set blank to disable. (eosio::http_plugin)
http-server-address = 127.0.0.1:8888
# The local IP and port to listen for incoming https connections; leave blank to disable. (eosio::http_plugin)
# https-server-address =
# Filename with the certificate chain to present on https connections. PEM format. Required for https. (eosio::http_plugin)
# https-certificate-chain-file =
# Filename with https private key in PEM format. Required for https (eosio::http_plugin)
# https-private-key-file =
# 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 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 =
# 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
# maximum sizes of transaction or block messages that are sent without first sending a notice (eosio::net_plugin)
max-implicit-request = 1500
# Enable block production, even if the chain is stale. (eosio::producer_plugin)
enable-stale-production = false
# Limits the maximum time (in milliseconds) that is allowed a pushed transaction's code to execute before being considered invalid (eosio::producer_plugin)
max-transaction-time = 30
# 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"]
# Lag in number of blocks from the head block when selecting the reference block for transactions (-1 means Last Irreversible Block) (eosio::txn_test_gen_plugin)
txn-reference-block-lag = 0
# 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 (default 900 (15 minutes)). 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 = 900
# 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 =
genesis.json
{
? "initial_timestamp": "2018-03-02T12:00:00.000",
? "initial_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
? "initial_configuration": {
? ? "max_block_net_usage": 1048576,
? ? "target_block_net_usage_pct": 1000,
? ? "max_transaction_net_usage": 524288,
? ? "base_per_transaction_net_usage": 12,
? ? "net_usage_leeway": 500,
? ? "context_free_discount_net_usage_num": 20,
? ? "context_free_discount_net_usage_den": 100,
? ? "max_block_cpu_usage": 100000,
? ? "target_block_cpu_usage_pct": 500,
? ? "max_transaction_cpu_usage": 100000,
? ? "base_per_transaction_cpu_usage": 512,
? ? "base_per_action_cpu_usage": 1024,
? ? "base_setcode_cpu_usage": 2097152,
? ? "per_signature_cpu_usage": 102400,
? ? "cpu_usage_leeway": 2048,
? ? "context_free_discount_cpu_usage_num": 20,
? ? "context_free_discount_cpu_usage_den": 100,
? ? "max_transaction_lifetime": 3600,
? ? "deferred_trx_expiration_window": 600,
? ? "max_transaction_delay": 3888000,
? ? "max_inline_action_size": 4096,
? ? "max_inline_action_depth": 4,
? ? "max_authority_depth": 6,
? ? "max_generated_transaction_count": 16
? },
? "initial_chain_id": "0000000000000000000000000000000000000000000000000000000000000000"
}
Docker 快速安裝
安裝docker鏡像
git clone https://github.com/EOSIO/eos.git --recursive
cd eos/Docker
docker build.-t eosio/eos
啟動
docker run --name nodeos -p 8888:8888 -p 9876:9876 -t eosio/eos nodeosd.sh arg1 arg2
查詢區(qū)塊
curl http://127.0.0.1:8888/v1/chain/get_info
上傳合約
cleos set contract exchange contracts/exchange/exchange.wast contracts/exchange/exchange.abi