Config Network

Genesis block configuration

The genesis block is the first block created on a new chain according to a predefined specification. If you want to bootstrap your own Meey blockchain, you will need to configure and create the genesis block. All nodes producing blocks and syncing with the network need to use the same genesis block.

Example genesis

{
    "chain_id":{
        "magic": "[insert an identifier string for your network]",
        "public": false,
        "mainnet": false,
        "coinbasefee": "1000000000",
        "consensus": "dpos"
    },
    "timestamp": 1548918000000000000,
    "balance": {
        "[insert address from genesis]": "470000000000000000000000000",
        "[insert address from bp01]": "10000000000000000000000000",
        "[insert address from bp02]": "10000000000000000000000000",
        "[insert address from bp03]": "10000000000000000000000000"
    },
    "bps": [
        "[insert text from bp01.id]",
        "[insert text from bp02.id]",
        "[insert text from bp03.id]"
    ]
}

Key

Type

Explanation

chain_id

obj

– magic

string

A name identifier used to distinguish different chains. Example: yourchain.network

– public

bool

If this chain is for a public (true) or private network. This may affect certain features.

– mainnet

bool

If this is the main network (true) or a sidechain for another network.

– consensus

string

This blockchain’s consensus type (dpos)

– coinbasefee

string

The default transaction fee amount

timestamp

number

The genesis block’s creation timestamp in nanoseconds

balance

obj

A mapping of addresses and allocated balances

bps

list

A list of fallback block producer peer ids.

Creating peer identification (Optional Step)

Every peer (i.e. instance of meeysvr) is identified by a peer id, derived from its public key. If unspecified, meeysvr creates these automatically, but you may want to do it manually to control the generation of keys and make backups. You can use the CLI to do that:

You then need to specify the path to the generated your-keyname.key file in the Meey configuration:

Internal Zones

There may be several BPs in one private network; these BPs can be connected directly to spread the blocks without having to pass through Agents. And these BPs can be more efficient in resource use by sharing Agents than by each BP having Agents.

For efficient use of network and computing resources, Agent categorizes networks to internal and external, delivering only internal to external, or vise versa.

The Agent node connects the client BPs in the internal network with other BPs or Agents in the external network. The Agent passes blocks generated by a client to the BPs or Agents of the external network as quickly as possible, while the blocks notified by the external BPs or Agents are passed to the client BPs. Config Example

NOTE: Configuring BP and Agent are advanced topic, and wrong configuration can cause performance degradation or abnormal operation. So this configurations are more strictly checked than other settings; read the document carefully and set it up.

Suppose there is a foundation named Wesoha, and the foundation decided to participate in the Meey network. The foundation establishes three BP nodes, one Agent node, and one node for TX registration and monitoring in the private network. The private address and peer ID of each node are as follows.

The foundation registered the mainnet.wesoha.io domain to join the chain network and forwarded the IP address of the domain to the agent machine.

BPs and Watcher allow access only from the Foundation’s internal network and are linked to the public network only through Agent.

The connection between Agent and client BP is built on the secured environment that the network manager cares about; BP and Agent must specify each other correctly in configuration.

Configuration of BP Node

BP disables npexposeself, npdiscoverpeers, and npusewezen settings so that they are not exposed to the outside and do not automatically connect to external nodes. BP node also set agent field to peer id of agent node.

Configuration of Agent Node

Agent activates npexposeself, npdiscoverpeers, npusewezen settings, and also sets addresses that can be accessed from the outside, so that they can connect to other nodes in the public network. Also set producers field to a list of the client BP’s peer ids and internal zones.

NTP

Timing is critical in a blockchain, so it’s better to configure the machines’ time setup manually:

Create genesis block

Last updated