eosio-server is a standalone server that provides information about a number of testnets and that can be configured remotely by calling its API methods.
It maintains a list of networks with their respective genesis configuration, version and a list of peers to be used for sharing blockchain data. Over time, eosio-server will also be expanded to operate a faucet and automatically send tokens to connecting nodes, as well as indexed information on the blockchain, automated registration as apointed block producers candidates, etc.
It is meant to interface with eosio-script in facilitating easy deployment of eos networks.
eosio-server provides a number of public and private functions. Public functions do not require any signature and are thus available to everyone. Private function calls are however used to configure the server, and require a signature by the private key associated to the public key held by the server to affect configuration.
git clone https://github.com/CryptoMechanics/eosio-server
cd eosio-server
node server.js
var eos = require("eosjs-ecc");
var cjson = require("canonicaljson");
var request = require("request");
let addPeerData = {
"network_name": "my_testnet",
"peer": "node1.eostitan.com:8888"
}
var signature = eos.sign(cjson.stringify(addPeerData), "5HtJigwy65vb2kAMrjGFt8zG3PNrfKEHmVXr9HbatJyfabAkPKv");
addPeerData.signature = signature;
request({url: 'http://discovery.eostitan.com/addpeer', method: 'POST', json:addPeerData}, function(err, res, body){
//callback
});
Remove a network for which you own the initial key
Remove a peer from the discovery file of a network for which you own the initial key
Add a peer to a network for which you own the initial key
Get information on a single network
Get a summary of all public networks
Add a new network to the discovery server
Verify authenticity of a message based on public key and signature
Register for account creation
Register yourself as a peer to be listed in the discovery file of a network
As part of a network description file, the boot object defines the eosio boot sequence to be executed in order to launch the network. All actions are sorted by ascending index first, and then the eosconfig script will execute all commands sequentially.
commands:
Runs nodeos with specified arguments.
arguments List of arguments to pass to nodeos
Example:
{
"index": 0,
"command": "nodeos",
"account": "eosio",
"arguments": "-e -p"
}
Equivalent to :
nodeos -e -p eosio
Create keys, import them and create accounts for initial smart contracts.
account Creator account (ie: eosio)
keys Array of contracts to be created
Example:
{
"index": 1,
"command": "generate_contract_keys",
"account": "eosio",
"keys": [
{"name":"eosio.token"},
{"name":"eosio.msig"}
]
}
Equivalent to :
cleos create key
cleos wallet import 5AAAAAA...
cleos create account eosio eosio.token EOSAAAAAA... EOSAAAAAA...
cleos create key
cleos wallet import 5BBBBBBB...
cleos create account eosio eosio.msig EOSBBBBBB... EOSBBBBBB...
Pushes a smart contract on the blockchain
name Name of the contract (should match account created previously)
path Name of the folder containing the .ABI and .WAST contract, assuming contracts are in ~/releases/eos/build/contracts
Example:
{
"index": 2,
"command": "set_contract",
"name": "eosio.token",
"path": "eosio.token"
}
Equivalent to :
cleos set contract eosio.token ~/releases/eos/build/contracts/eosio.token
Pushes a single action on the blockchain
signature Signature that should be used with the permission -p flag
contract Contract to interact with
action Method to call on the contract
params Array of parameters that should be passed to the contract function
Example:
{
"index": 5,
"command": "push_action",
"signature": "eosio",
"contract": "eosio.token",
"action": "issue",
"params": [
"eosio",
"1000000000.0000 SYS",
"memo"
]
}
Equivalent to :
cleos push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "memo" ]' -p eosio