Modify genesis
If you want to create private network with custom fee or echorand parameters, with different initial accounts or balances, then you need to to modify genesis.

Create genesis file

As starting point you can create an example genesis or network genesis.
    --example-genesis-json [path] - creates example genesis at path or in current directory.
    --create-genesis-json - creates networks genesis at corresponding or selected datadir. By specifying network with --testnet or --devnet flags you can select mainnet, testnet or devnet to take genesis from.

Parts of the genesis

    initial_parameters
      current_fees.parameters - fees prices of operations;
      echorand_config - echorand consensus parameters;
      sidechain_config - sidechain parameters;
      erc20_config - erc20 sidechain parameters;
      stake_sidechain_config - stake sidechain parameters;
      economy_config - rewards calculation parameters;
    initial_accounts - list of initial accounts. Can be imported to the wallet with import_key command;
    initial_assets - list of additional assets;
    initial_balances - list of balances that can be redeemed by account with import_balance command;
    initial_vesting_balances - list of vesting balances;
    initial_committee_candidates - list of initial committee accounts.
    initial_sidechain_asset_config - list of initial contracts for asset transferring to Ethereum;

Add initial account example

To add new init accounts you need to add account name in name field and know 2 public keys. echorand_key need to take part in echorand consensus and active_key used for signing transaction Using this information, you can add new entries to the list as follows:
1
"initial_accounts": [
2
{
3
"name": "init0",
4
"active_key": "ECHO5PNcN4VanyKHaAEtRx1UfwgJGMVJbCmeiD6toKD1WGeU",
5
"echorand_key": "ECHO5PNcN4VanyKHaAEtRx1UfwgJGMVJbCmeiD6toKD1WGeU"
6
},{
7
"name": "init1",
8
"active_key": "ECHODP2d2c4VjsxVduMYRg4MNCCt5Cwph8H1y2nXZqbKVZRQ",
9
"echorand_key": "ECHODP2d2c4VjsxVduMYRg4MNCCt5Cwph8H1y2nXZqbKVZRQ"
10
}
11
],
Copied!

Add initial assets example

    symbol - ticker symbol for this asset, i.e. "USD".
    issuer_name - name of the account which issued this asset.
    description - data that describes the meaning/purpose of this asset.
    precision - maximum number of digits after the decimal point (must be <= 12).
    max_supply - The maximum supply of this asset which may exist at any given time. This can be as large as ECHO_MAX_SHARE_SUPPLY.
    accumulated_fees - fees accumulate to be paid out over time.
    is_bitasset - bitasset flag.
    flags - the currently active flags on this permission.
    core_exchange_rate - rate for convertation to core asset.
Using this information, you can add new entries to the list as follows:
1
"initial_assets": [
2
{
3
"symbol": "EETH",
4
"issuer_name": "committee-account",
5
"description": "sidechained ethereum asset",
6
"precision": 8,
7
"max_supply": "10000000000000000",
8
"accumulated_fees": 0,
9
"is_bitasset": true,
10
"collateral_records": [],
11
"flags": 8,
12
"core_exchange_rate": {
13
"base": {
14
"amount": 1,
15
"asset_id": "1.3.1"
16
},
17
"quote": {
18
"amount": 1,
19
"asset_id": "1.3.0"
20
}
21
}
22
}
23
],
Copied!

Add initial balances example

To add new init balance you need to know public key of the balance owner and the asset amount. Using this information, you can add new entries to the list as follows:
1
"initial_balances": [
2
{
3
"owner": "ECHO5NaRTkq4uBAVGrZkD3jcTEdUxhxxJLU7hvt3p1zJyytc",
4
"asset_symbol": "ECHO",
5
"amount": "1000000000000000"
6
},
7
{
8
"owner": "ECHO5NaRTkq4uBAVGrZkD3jcTEdUxhxxJLU7hvt3p1zJyytc",
9
"asset_symbol": "EETH",
10
"amount": "1000"
11
}
12
],
Copied!

Add initial vesting balances example

To add new init balance you need to know public key of the balance owner and the asset amount. begin_timestamp - this is the time at which funds begin vesting. vesting_duration_seconds - duration of the vesting period, in seconds. begin_balance - the total amount of asset to vest. Using this information, you can add new entries to the list as follows:
1
"initial_vesting_balances": [
2
{
3
"owner": "ECHO5NaRTkq4uBAVGrZkD3jcTEdUxhxxJLU7hvt3p1zJyytc",
4
"asset_symbol": "ECHO",
5
"amount": "10000",
6
"begin_timestamp": "2019-08-05T00:00:00",
7
"vesting_duration_seconds": 20000,
8
"begin_balance": "20000"
9
},
10
{
11
"owner": "ECHO5NaRTkq4uBAVGrZkD3jcTEdUxhxxJLU7hvt3p1zJyytc",
12
"asset_symbol": "EETH",
13
"amount": "1000",
14
"begin_timestamp": "2019-08-05T00:00:00",
15
"vesting_duration_seconds": 25000,
16
"begin_balance": "200"
17
}
18
],
Copied!

Add initial committee candidates example

To add new init committee member you need to add account name who ows committee in owner_name field. eth_address - Ethereum address which committee member owned. btc_public_key - public key of Bitcoin address which committee member owned. Using this information, you can add new entries to the list as follows:
1
"initial_committee_candidates": [
2
{
3
"owner_name": "my_own_acc1",
4
"eth_address": "f372c3b578534Ac5C1Cf0Cca7049A279d1ca3e79",
5
"btc_public_key": "02c16e97132e72738c9c0163656348cd1be03521de17efeb07e496e742ac84512e"
6
},
7
{
8
"owner_name": "my_own_acc2",
9
"eth_address": "Fba802D86f8d9b080eD247e712751DDBF86086A9",
10
"btc_public_key": "02c16e97132e72738c9c0163656348cd1be03521de17efeb07e496e742ac84512f"
11
}
12
],
Copied!

Add initial committee candidates example

To add new asset sidechain contract you need fill this field:
    code - code of sidechain contract. We advice on to use the same contract code as for ECHO token. Find in genesis-devnet.json file.
    address - address of Ethereum ERC20 contract. All token balance should be at sidechain address.
    name - the name of ERC20 token.
    symbol - should be the same as asset and unique in Echo network.
    decimals - accuracy of token.
    supported_asset - asset which you want to bond with contract.
Using this information, you can add new entries to the list as follows:
1
"initial_sidechain_asset_config": [
2
{
3
"code" : "6080604052348...72657373",
4
"address" : "bC384aBfDd339BCf2f9e68Ea3858C04563ef012C",
5
"name" : "EchoToken",
6
"symbol" : "ECHO",
7
"decimals" : 8,
8
"supported_asset" : "1.3.0"
9
},
10
{
11
"code" : "6080604052348...72657373",
12
"address" : "2A365517AB5f70b4079Cd2dC2C3Bc9d111AaE951",
13
"name" : "EbtcToken",
14
"symbol" : "EBTC",
15
"decimals" : 8,
16
"supported_asset" : "1.3.2"
17
}
18
],
Copied!
After editing genesis file restart your network.

Starting network with custom genesis

To start custom network with custom genesis you need specify genesis.json either by
    Using CLI argument --genesis-json <path>.
    Using config parameter genesis-json = <path>.
    Placing genesis.json file at your datadir.
There should be no other blockchain in datadir otherwise its genesis will be used.
Last modified 8mo ago