程序:
工具:
OSIO核心守护进程,可以配置插件来运行一个EOS节点。包含以下可配置项:
1. 插件eosio::chain_api_plugin
支持chain的RPC API
2. 插件eosio::wallet_api_plugin
开启wallet功能,支持wallet的RPC API
3. http-server-address
指定RPC API查询ip,默认启动则开启8888端口
4. p2p-listen-endpoint
指定等待其他节点连接自己的监听ip,默认则开启9876端口
5. p2p-peer-address
指定本节点接入到EOS网络中其他节点的ip
6. data-dir
节点运行时数据目录,默认情况下:
Mac OS: ~/Library/Application Support/eosio/nodeos/config
Linux: ~/.local/share/eosio/nodeos/config
7. config-dir
节点启动时配置目录,默认情况下:
Mac OS: ~/Library/Application Support/eosio/nodeos/data
Linux: ~/.local/share/eosio/nodeos/data
cleos是一个和nodeos的REST API接口交互的命令行,运行时需要指定nodeos运行实例的ip地址和端口,并且nodeos需要配置成加载‘eosio::chain_api_plugin’插件。
Cleos包含了它所有命令的使用文档,使用以下命令可以查看cleos支持的所有命令列表:
[kingnet@bctestnode3 cleos]$ ./cleos
ERROR: RequiredError: Subcommand required
Command Line Interface to EOSIO Client
Usage: ./cleos [OPTIONS] SUBCOMMAND
Options:
-h,--help Print this help message and exit
-H,--host TEXT=localhost the host where nodeos is running
-p,--port UINT=8888 the port where nodeos is running
--wallet-host TEXT=localhost
the host where keosd is running
--wallet-port UINT=8888 the port where keosd is running
-v,--verbose output verbose actions on error
Subcommands:
version Retrieve version information
create Create various items, on and off the blockchain
get Retrieve various items and information from the blockchain
set Set or update blockchain state
transfer Transfer EOS from account to account
net Interact with local p2p network connections
wallet Interact with local wallet
sign Sign a transaction
push Push arbitrary transactions to the blockchain
如果想获得特定子命令的帮助,只需要使用无参数运行它:
[kingnet@bctestnode3 cleos]$ ./cleos create
ERROR: RequiredError: Subcommand required
Create various items, on and off the blockchain
Usage: ./cleos create SUBCOMMAND
Subcommands:
key Create a new keypair and print the public and private keys
account Create a new account on the blockchain
[kingnet@bctestnode3 cleos]$ ./cleos create account
ERROR: RequiredError: creator
Create a new account on the blockchain
Usage: ./cleos create account [OPTIONS] creator name OwnerKey ActiveKey
Positionals:
creator TEXT The name of the account creating the new account
name TEXT The name of the new account
OwnerKey TEXT The owner public key for the new account
ActiveKey TEXT The active public key for the new account
Options:
-x,--expiration set the time in seconds before a transaction expires, defaults to 30s
-f,--force-unique force the transaction to be unique. this will consume extra bandwidth and remove any protections against accidently issuing the same transaction multiple times
-s,--skip-sign Specify if unlocked wallet keys should be used to sign transaction
-j,--json print result as json
-d,--dont-broadcast don't broadcast transaction to the network (just print to stdout)
-p,--permission TEXT ... An account and permission level to authorize, as in 'account@permission' (defaults to 'creator@active')
--max-cpu-usage UINT set an upper limit on the cpu usage budget, in instructions-retired, for the execution of the transaction (defaults to 0 which means no limit)
--max-net-usage UINT set an upper limit on the net usage budget, in bytes, for the transaction (defaults to 0 which means no limit)
一个EOSIO钱包守护进程,加载钱包相关的插件,如HTTP interface,RPC API。包含以下配置项:
1. http-server-address
钱包RPC API查询ip,默认情况下为8888端口
五、launcher
该程序简单的部署多个nodeos节点到网络上,它可以通过CLI进行配置以组成每个节点的配置文件,然后安全的分发这些文件,启动多个nodeos实例。
六、snapshot
引用EOSIO/genesis存储库的子模块,其中包含用于从众包协议生成快照的nodejs应用程序,用于配置生成块和其他生成相关工具的Web GUI
Eosiocpp用于生成ABI规范文件,通过检查智能合约源代码中声明的类型来生成ABI规范文件。
如果需要指定一个类型必须被导出到ABI,在类型声明时需要声明为@abi,语法如下:
l @abi action [name name2 .... nameN]
l @abi table [index_type name]
同时要生成ABI文件,还必须使用-g参数执行eosiocpp。
eosiocpp -g abi.json types.hpp
Generated abi.json ...
eosiocpp也可以用于生成序列化和反序列化ABI中定义的类型的帮助函数
Eosiocpp -g abi.json -gs types.hpp
Generated abi.json ...
Generated types.gen.hpp ...