Search…
Transaction

Introduction

This document specifies the genesis file format.

Value Types

Value type
Description
Example
T_ADDR_EOA
"hx" + 40-digit HEX string
"hxbe258ceb872e08851f1f59694dac2558708ece11"
T_ADDR_SCORE
"cx" + 40-digit HEX string
"cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32"
T_HASH
"0x" + 64-digit HEX string
"0xc71303ef8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"
T_INT
"0x" + lowercase HEX string
"0xa"
T_ARRAY
json arrays
[ “0x1234567890”, “0x2345678990” ]
T_BOOLEAN
"0x1" or "0x0"
"0x1"
T_STRING
json string
"test string"
T_BYTES
"0x" + lowercase HEX string
"0x112233445566..."
T_DICT
json dictionary
{ "supply": "0x1" }

Parameters

  • accounts (required, T_ARRAY) It contains EOA (Externally Owned Account) or CA (Contract Account) information. Determines who starts out with how much balance or which application is pre-installed when the blockchain starts.
    • account (T_DICT)
      • name (T_STRING, default=null) It is a name of the account. It is required to define a special account such as god, treasury or governance, otherwise it is optional only for account aliases.
      • address (T_ADDR_EOA or T_ADDR_SCORE) The address of the account.
      • balance (T_INT, default="0x0") Initial balance of the account.
      • score (T_DICT, default=null) Required if the account (CA) has code to be pre-installed.
        • owner (T_ADDR_EOA) The owner address of the contract.
        • contentType (T_STRING) MIME type of the content. application/zip is for user Python SCORE and application/java is for user Java SCORE, while application/x.score.system is used for system SCORE.
        • contentId (T_STRING, replace content) The content URI.
          Prefix
          Description
          Sample
          hash:
          Used for hashable SCORE
          "hash:0x1234567890abcdef...e"
          cid:
          Used for system SCORE
          "cid:multisig/r1"
        • content (T_BYTES, replace contentId) Hex string contains bytes of compressed codes.
        • params (T_DICT, default=null) Parameters that will be passed to the SCORE initialization method (on_install() in Python, <init>() in Java).
  • chain (T_DICT, default=null)
    • revision (T_INT, default="0x8") Initial revision.
    • auditEnabled (T_BOOLEAN, default="0x0") Determines whether audit is required. Default is false.
    • deployerWhiteListEnabled (T_BOOLEAN, default="0x0") Determines whether only white-listed deployers can deploy SCOREs. Default is false.
    • fee (T_DICT,default=null)
      • stepPrice (T_INT, default="0x0") The price of one step. Fee is the product of stepPrice and steps used.
      • stepLimit (T_DICT, default=null) Maximum step allowance for the request type. If it's not specified, both values are set as zero ("0x0")
        • invoke (T_INT)
        • query (T_INT)
      • stepCosts (T_DICT, default=null) The cost of each step type. If it's not specified, all values are set as zero ("0x0").
        • default (T_INT)
        • contractCall (T_INT)
        • contractCreate (T_INT)
        • contractUpdatee (T_INT)
        • contractDestruct (T_INT)
        • contractSet (T_INT)
        • get (T_INT)
        • set (T_INT)
        • replace (T_INT)
        • delete (T_INT)
        • input (T_INT)
        • eventLog (T_INT)
        • apiCall (T_INT)
        • defaultGet (T_INT)
        • defaultSet (T_INT)
        • replaceBase (T_INT)
        • defaultDelete (T_INT)
        • eventLogBase (T_INT)
    • validatorList (T_ARRAY, default=[]) The list of addresses participating in the consensus. It will not work if it is empty.
      • validator (T_ADDR_EOA)
    • memberList (T_ARRAY, default=[]) The list of addresses participating in the network. If it is empty, the server accepts all network connections.
      • member (T_ADDR_EOA)
    • blockInterval (T_INT) Block generation interval in msec.
    • commitTimeout (T_INT) Commit timeout (timeout before propose after commit) in msec.
      If blockInterval is specified, then it assumes commitTimeout as minimum commit timeout value. If minimum commit timeout value is bigger than blockInterval, then it uses value of blockInterval. Default value of minimum commit timeout is 200ms.
      Otherwise, it uses commitTimeout as block interval and minimum commit timeout. If both of them are not specified, then it uses system default values (1000ms for block interval, 200ms for minimum commit timeout).
    • timestampThreshold (T_INT) Allowed timestamp threshold in msec between the block and the transaction. If it's not specified, it uses system default value. System default value can be updated when the node is updated.
    • minimizeBlockGen (T_BOOL, default="0x0") If it's set as true ("0x1"), the generation of empty block will be minimized.
    • roundLimitFactor (T_INT, default="0x0") If it's set as non-zero value, it tries to skip execution of transactions of previous block when consensus round of the height exceeds round limit. Round limit is (roundLimitFactor * validators + 2 ) / 3.
  • message (T_STRING, default=null) A message to be recorded in the genesis. It's used to prevent having same network ID from similar configuration.
  • nid (T_INT, default=null) Network ID for the network. Normally, it shouldn't be set. In that case, it uses calculated network ID from genesis.

Example

1
{
2
"accounts": [
3
{
4
"name": "god",
5
"address": "hxff9221db215ce1a511cbe0a12ff9eb70be4e5764",
6
"balance": "0x2961fff8ca4a62327800000"
7
},
8
{
9
"name": "treasury",
10
"address": "hx1000000000000000000000000000000000000000",
11
"balance": "0x0"
12
},
13
{
14
"name:": "governance",
15
"address": "cx0000000000000000000000000000000000000001",
16
"score": {
17
"owner": "hx609c1c454528bae228514ceccec0c0939637a3fb",
18
"contentType": "application/zip",
19
"contentId": "hash:0x23cx01af5570f5a1810b7af78caf4bc70a660f0df51e42baf91d4de5b2328de0",
20
"params": {
21
"governor": "hx11cbe0a213e5a10e7926c4aa5943093f9221db2a"
22
}
23
}
24
},
25
{
26
"name": "multisig",
27
"address": "cx0000000000000000000000000000000000000002",
28
"score": {
29
"owner": "hx609c1c454528bae228514ceccec0c0939637a3fb",
30
"contentType": "application/zip",
31
"contentId": "hash:0x810b7af78caf4bc70a660f0df51e42baf91d4de5b2328de0e83dfc56fd70a6cb",
32
"params": {
33
"maxMember": "0x10"
34
}
35
}
36
}
37
],
38
"chain" : {
39
"revision": "0x8",
40
"auditEnabled": "0x1",
41
"deployerWhiteListEnabled": "0x0",
42
"fee": {
43
"stepPrice": "0x2540be400",
44
"stepLimit": {
45
"invoke": "0x9502f900",
46
"query": "0x2faf080"
47
},
48
"stepCosts": {
49
"default": "0x186a0",
50
"contractCall": "0x61a8",
51
"contractCreate": "0x3b9aca00",
52
"contractUpdate": "0x5f5e1000",
53
"contractDestruct": "-0x11170",
54
"contractSet": "0x7530",
55
"get": "0x0",
56
"set": "0x140",
57
"replace": "0x50",
58
"delete": "-0xf0",
59
"input": "0xc8",
60
"eventLog": "0x64",
61
"apiCall": "0x2710"
62
}
63
},
64
"validatorList": [
65
"hx4805489d4fd3c07fea9b7e1b210e7926c4aa5943",
66
"hx6903484805487fea9b8054c07fea9b7e54c07fef",
67
"hx7fea9b7e54c5487fee54c543902f009aab312300",
68
"hxdef10990388eeefab3827980e083e028f08f8aaa",
69
"hxee01910d0f0a90b00de30999f099db9babd9e255"
70
]
71
}
72
}
Copied!
Last modified 13d ago