Config¶
This is example node configuration file.
first-node.yml¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | address: no0sas privatekey: EYc4WdFjP9qkgfwJZfnsVXeh827rsNppm5HUSjSDeMFFmpr network_id: mitum; Sat 26 Dec 2020 05:29:13 AM KST network: bind: 0.0.0.0:4320 tls_insecure: true storage: base: /mitum-data database: leveldb:// sync_sources: - type: sync-source-node address: no1sas publickey: 25AZEiKTPhNkpcj6B1mofXHFyJRR8DaEMcNjc2WSvvW8Jmpu publish: localhost:4321 tls_insecure: true |
address
:Local node mitum address. You can make new address by these rules;
- Must ends with hint type,
sas
- Length should be
6 <= length <=100
including hint type,sas
- Empty characters(space, tab, etc) should not be included
- Regexp,
^[a-zA-Z0-9][\w\-\.\!\$\*\@]*[a-zA-Z0-9]$
should be passed
- Must ends with hint type,
privatekey
:privatekey for local node. It will be used to sign the messages from local node.
New privatekey and it’s publickey can be easily made:
$ ./mitum-example key new { "privatekey": "685WQHnt51eaETuQ1WUYEVEdMsBS5XD5SCaU6NuiqHV4mpr", "publickey": "gGvk6uzEDWbu7DXTNuiQGRGfUThEbst3EHL79YF3cCKkmpu", "hint": "mpr-v0.0.1", "seed": "", "type": "privatekey" }
For more details about
key new
, see “Command Usage”network_id
:network id indicates which mitum network local node are in. netword id should not be empty and not be greater than
300 bytes
.network.bind
:bind address. port should be set. For example,
0.0.0.0:4320
: Listen from anywhere:4320
: same with0.0.0.0:4320
127.0.0.1:4320
: Listen only from localhost
network.tls_insecure
:If local node uses self-signed TLS certificate, it should be
true
.storage.base
:base indicates the directory for produced data. If not set, current directory will be used.
storage.database
:database indicates the database uri. By default,
leveldb://
. If not set, default database will be used,leveldb://<storage.base>/db
.sync_sources
:Trust nodes. You can set multiple trust nodes.
sync_sources.type
:type indicates how to fetch the source_source.
sync-source-node
: nodesync-source-suffrage-nodes
: get it’s suffrage nodes from other nodesync-source-sync-sources
: get it’s sync source nodes from other nodesync-source-url
: get sync source nodes thru url
sync_sources.type=sync-source-node
:1 2 3 4 5
- type: sync-source-node address: no1sas publickey: 25AZEiKTPhNkpcj6B1mofXHFyJRR8DaEMcNjc2WSvvW8Jmpu publish: localhost:4321 tls_insecure: true
sync_sources.type=sync-suffrage-nodes
:1 2 3
- type: sync-source-suffrage-nodes publish: 1.2.3.4:4321 tls_insecure: true
sync_sources.type=sync-source-sync-sources
:1 2 3
- type: sync-source-sync-nodes publish: 1.2.3.4:4321 tls_insecure: true
sync_sources.type=sync-source-url
: Set url; remote url should return the json list of NodeConnInfo.1
- https://a.b.c.d/sync-sources.json
[ { "conn_info": "1.2.3.4:4321#tls_insecure", "address": "node0sas", "publickey": "yjXAD7m9knauk7qgo44S2BVpKRc8QXcgDQrAqwwxKtbhmpu", "_hint": "node-conninfo-v0.0.1" }, { "conn_info": "4.3.2.1:1234#tls_insecure", "address": "node1sas", "publickey": "tZSrHbkNtDzHvjfbKocgaPwNjx99buMBFdhKTUPxXCafmpu", "_hint": "node-conninfo-v0.0.1" } ]