Configuration
address
address: n0sas
genesis-operations
genesis-operation
is a setting for the genesis operation that is executed when the network is initialized.genesis-operation
contains the contents of the block that is initially created.Keys of the genesis account (key, weight, threshold)
Initial balance
Currency ID
Fee policy of the currency to be created
genesis-operations:
- account-keys:
keys:
- publickey: rcrd3KA2wWNhKdAP8rHRzfRmgp91oR9mqopckyXRmCvGmpu
weight: 100
threshold: 100
currencies:
- balance: "99999999999999999999"
currency: MCC
new-account-min-balance: "33"
type: genesis-currencies
network
$ openssl genrsa -out mitum.key 4096
$ openssl req -x509 -new -nodes -key mitum.key -sha256 -days 1024 -out mitum.crt
network:
bind: https://0.0.0.0:54321
url: https://127.0.0.1:54321
cert-key: mitum.key
cert: mitum.crt
rate-limit
rate limit
can be applied to the API service.rate-limit
applied to these API services.network:
bind: https://0.0.0.0:54321
url: https://127.0.0.1:54321
rate-limit:
cache: "memory:?prefix=showme"
preset:
bad-nodes:
new-seal: 3/2m
blockdata: 4/m
3.3.3.3:
preset: bad-nodes
4.4.4.4/24:
preset: bad-nodes
blockdata: 5/m
127.0.0.1/24:
preset: suffrage
cache
: cache for requests. At this time, supports “memory:” and “redis://<redis server>”memory: memory cache
redis://<redis server>: cached in redis server
preset
: predefined rate limit settings.For Mitum,
suffrage
andworld
presets are already defined. See launch/config/ratelimit.go in the source code.You can make your own rate limit setting like bad-nodes.
Rules:
Rate-limit Settings for a specific IP
Rules consist of IP address (or IP address range),
preset
and detailedrate-limit
settings.The IP address can be a single value or a range of IP addresses expressed in CIDR notation. * example : 3.3.3.3, 4.4.4.4/24, 127.0.0.1/24
Rate limit can be set through
preset
and additionallimits
.preset
can be pre-defined preset likesuffrage
,world
or user-defined preset likebad-nodes
.Additional limit such as
blockdata: 5/m
can be added to thepreset
.Rules will be checked by the defined order from upper to lower.
Detailed limit:
The API interface name for Mitum, such as new-seal, used to set the limit can be found in RateLimitHandleMap (launch/config/ratelimit.go).
The API interface name for each model can be found in the RateLimitHandlerMap (digest/handler.go).
new-seal: 3/2m means new-seal interface allows 3 requests per 2 minutes to the specified IP or IP range.
See the manner of time duration.
Without any rules, by default no rate limit.
4.4.4.4/24:
preset: bad-nodes
blockdata: -1/m
4.4.4.4/24:
preset: bad-nodes
blockdata: 0/m
network-id
network id
acts like an identifier that identifies a network.network id
value.network-id: mitum
keypair
privatekey: Kxt22aSeFzJiDQagrvfXPWbEbrTSPsRxbYm9BhNbNJTsrbPbFnPAmpr
storage
storage:
blockdata:
path: mitum-blockfs
database:
uri: mongodb://127.0.0.1:27017/mc
port number
should be the same as that of when running docker.suffrage
nodes
n0sas
.n0
, n1
, n2
, n3
nodes are included in the suffrage nodes, it can be set as follows.suffrage:
nodes:
- n0sas
- n1sas
- n2sas
- n3sas
n0
node, which is a local node, is not included in the suffrage nodes, the local node becomes a None-suffrage node and serves only as a syncing node.The Syncing node does not participate in consensus and only syncs the generated block data.
The None-suffrage node handles only the seal containing the operation.
The None-suffrage node does not process ballots and proposals related to voting between nodes.
When the None-suffrage node stores the operation seal, it broadcasts the seal to the suffrage nodes.
suffrage:
nodes:
- n1sas
- n2sas
- n3sas
sync-interval
sync-interval
setting.sync-interval: 3s
nodes
address
(alias for the address), public key
, and url
(ip address) of known nodes in the blockchain network.If not written, it operates as a standalone node.
If the node is a suffrage node and the node discovery function is used, the
url
of the node is not required.However, if the node is not a suffrage node, the ``url``s of the suffrage nodes must be included.
If certificate related settings are not made in Network config, the node uses self-signed certificate.
If other Mitum nodes use self-signed certificate,
tls-insecure: true
should be set to all the nodes which use self-signed certificate.
(In case of suffrage node)
nodes:
- address: n1sas
publickey: ktJ4Lb6VcmjrbexhDdJBMnXPXfpGWnNijacdxD2SbvRMmpu
tls-insecure: true
- address: n2sas
publickey: wfVsNvKaGbzB18hwix9L3CEyk5VM8GaogdRT4fD3Z6Zdmpu
tls-insecure: true
- address: n3sas
publickey: vAydAnFCHoYV6VDUhgToWaiVEtn5V4SXEFpSJVcTtRxbmpu
tls-insecure: true
(If it is not a suffrage node)
nodes:
- address: n1sas
publickey: ktJ4Lb6VcmjrbexhDdJBMnXPXfpGWnNijacdxD2SbvRMmpu
url: https://127.0.0.1:54331
tls-insecure: true
- address: n2sas
publickey: wfVsNvKaGbzB18hwix9L3CEyk5VM8GaogdRT4fD3Z6Zdmpu
url: https://127.0.0.1:54341
tls-insecure: true
- address: n3sas
publickey: vAydAnFCHoYV6VDUhgToWaiVEtn5V4SXEFpSJVcTtRxbmpu
url: https://127.0.0.1:54351
tls-insecure: true
digest
digest:
network:
bind: https://localhost:54320
url: https://localhost:54320
cert-key: mitum.key
cert: mitum.crt
tutorial.yml
address: mc-nodesas
privatekey: Kxt22aSeFzJiDQagrvfXPWbEbrTSPsRxbYm9BhNbNJTsrbPbFnPAmpr
storage:
database:
uri: mongodb://127.0.0.1:27017/mc
blockdata:
path: mitum-blockfs
network-id: mitum
network:
bind: https://0.0.0.0:54321
url: https://127.0.0.1:54321
cert-key: mitum.key
cert: mitum.crt
genesis-operations:
- type: genesis-currencies
account-keys:
keys:
- publickey: rcrd3KA2wWNhKdAP8rHRzfRmgp91oR9mqopckyXRmCvGmpu
weight: 100
threshold: 100
currencies:
- balance: "99999999999999999999"
currency: MCC
new-account-min-balance: "33"
feeer:
type: fixed
amount: 1
policy:
threshold: 100
suffrage:
nodes:
- mc-nodesas
digest:
network:
bind: https://0.0.0.0:54320
url: https://127.0.0.1:54320
cert-key: mitum.key
cert: mitum.crt