Forge Configuration Guide

When Forge starts, it also starts some other applications, such as tendermint and ipfs. Each appliation has its own configuration file, so does Forge.

We use toml file for Forge's configuration. If you don't know what toml is, please refer to toml-lang/toml.

One thing we like about toml file is we can have configurations seperate by sections. Forge only use one config file, with different sections for different part of system. Right now we have the following sections:

[app]
[forge]
[tendermint]
[ipfs]
[cache]
[geolix]
1
2
3
4
5
6

Normally the developer doesn't need to provide configuration for everything, she can just provide the things she needs to modify. Then Forge will merge the provided config with default config to produce a final config for Forge to use.

FORGE_CONFIG + forge_default.toml = forge.toml
1

The developer will pass her custom config to Forge via system env FORGE_CONFIG.

If you install Forge with forge-cli, a default configuration is generated for you in ~/.forge_cli/forge_release.toml.

The generated configuration looks like this:

[app]
name = ""
version = ""
path = ""
executable = ""
sock_tcp = ""

[forge]
proto_version = 1
path = "~/.forge_release/core"
logpath = "logs"
sock_grpc = "tcp://127.0.0.1:28210"
pub_sub_key = "ABTTOTHEMOON"

  [forge.stake.timeout]
  # for general stake, we do 10s
  general = 10
  # for node stake, we do 60s
  stake_for_node = 60

  [forge.web]
  enabled = true

[tendermint]
moniker = "forge"
path = "~/.forge_release/tendermint"
keypath = "~/.forge_cli/keys"
logpath = "logs"
# socket to proxy app
sock_proxy_app = "tcp://127.0.0.1:28220"

# socket for tendermint json rpc
sock_rpc = "tcp://127.0.0.1:28221"

# socket for tendermint grpc (right now just use it for send tx and commit immediately)
sock_grpc = "tcp://127.0.0.1:28222"

# socket for tendermint p2p. Normally this shall be opened to the public network
sock_p2p = "tcp://0.0.0.0:26656"

# socket for performance metrics
sock_prof = ""

# persistent peers
persistent_peers = ""

# seed peers
seed_peers = ""

# timeout for commiting a new block
timeout_commit = "5s"

# create empty blocks in 5s interval
create_empty_blocks = true

# set if this node runs in a seed mode
seed_mode = false

recheck = false

  [tendermint.genesis]
  genesis_time = "2018-11-05T19:22:08.938749Z"
  chain_id = "forge"
  max_bytes = 150000
  max_gas = -1
  app_hash = ""

  ### begin validators
  [[tendermint.genesis.validators]]
  ### end validators

[ipfs]
path = "~/.forge_release/ipfs"
logpath = "logs"

[cache]
path = "~/.forge_release/cache/mnesia_data_dir"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

It only contains part of full configuration, upon forge start, it will merge with forge default configuration to generate a full configuration. If you'd like to know all the parameters in a forge configuration, you can grab a forge_default.toml, either from our github repo, or from a release (e.g. cat ~/.forge_cli/release/forge/0.18.2/lib/forge_sdk-0.18.2/priv/forge_default.toml):

# ------------------------------------------------------------------
# forge app configuration
# ------------------------------------------------------------------

[app]

# name of your application
name = ""

# version of your application
version = ""

# home path of your application
path = ""

# the path of your application's executable file
executable = ""

# the log file path
logpath = "logs"

# the ABI connection between app and forge under TCP mode
sock_tcp = ""

# the ABI connection between app and forge under gRPC mode
sock_grpc = ""

# the backoff time (in milliseconds) if the ABI connection is cutoff
sock_backoff = 500

# ------------------------------------------------------------------
# forge configuration
# ------------------------------------------------------------------

[forge]

# protobuf version
proto_version = 1

# home path of forge
path = "~/.forge/core"

# the state db path
db = "data"

# the index db path
# sqlite://index/index.sqlite3 or postgres://postgres:postgres@localhost:5432/index
index_db = "sqlite://index/index.sqlite3"

# bitmap path
bitmap = "bitmap"

# the keystore path
keystore = "keystore"

# the log path
logpath = "logs"

# index db is nondeterministic, it won't affect statesdb
enable_index = true

# the gRPC connection between forge and client sdk
sock_grpc = "tcp://127.0.0.1:27210"

# consensus engine name
consensus_engine = "tendermint"

# storage engine name
storage_engine = "ipfs"

# max number of validator nodes for forge
max_validators = 64

# max number of candidate nodes for forge
max_candidates = 256

# pub sub key
pub_sub_key = "ABTTOTHEMOON"

# compression algorithm
compression = "zstd"

  [forge.transaction]

  # max asset size
  max_asset_size = 65536

  # max list size
  max_list_size = 8

  # max number of multi signature
  max_multisig = 4

  # minimum stake value
  minimum_stake = 10000000000000000

  [forge.web]

  # wether to enable forge web interface
  enabled = false

  # the port for forge web
  port = 8210

  [forge.stake.timeout]

  # for general stake, we do T+1
  general = 86400

  # for node stake, we do T+7
  stake_for_node = 604800

  [forge.rpc]

  # white list of forge rpc call
  whitelist = "*"

  [forge.release]

  # url for forge release
  url = "http://releases.arcblock.io/forge"

  [forge.token]

  # token name
  name = "ArcBlock"

  # token symbol
  symbol = "ABT"

  # smallest token unit
  unit = "arc"

  # token description
  description = "Forge token ABT"

  # token icon
  icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABoCAYAAABxGuekAAAAAXNSR0IArs4c6QAAD5RJREFUeAHtnAnUHeMZx6VJLCG2ELElIkLtxFK7xu4QyqFqS6ylSovWcqhaU0GprWgQcmiKWms5xFLEvm+xbxHEFstHLAna3893H2dy8917595v7tyb5HvO+X3zzMw77/u8/5l5n2duzskss0w/1p1Qh8FY2Hr6CXv6ibQToQ6BCfC/BKPxl4MOy0CBdejjMQiBJxb8zwvbKWzPhvmgw2pQYDGuuRxC4PH4u8J/Csd2YXsefFvY9wYcAJ2hw1IoMAdtjoFJoMhfwonQDbQQelDr7iwrsL0D4oY8i79x4VzHpoQCO3J8HIRoV+H3LmpbLHSc3g7nVYhrr8XvFyc7tq0KrMrmXgiRnsBfv/XUNH9LCW3D2eBIaAH7+hpOBquVmdp6Mvvh8B0ozPuwL/wESlk5oeOaXjiXwvdgv1YrQ8DqZaayrsz2UPgMFGIynA5zQyVLI3T0sTrO/eAY8ihYxcwUthWzfBli8jfh969i5tUIHd1arYyHGNNqxqpmhrRlmdWtEJN9Hn/zGmZai9AOY9Vi9WIVYwxWNVY3VjkzhPkhcSb4YeEEP4aDoQvUYrUKHWP1wbGaiRv+Jr7VznRrnYl8f/gInJQfFudDD2iPtVfoGHsDHKubEPwefKuf6coGEu0zEJO4C3/FjGaQldCGY3WzL1jtGKvVj1WQ1VBTW1+iuwZC4Nfxt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Y326e1WoTuRecjIH5GmIC/J/gBNkPbAGY3BuLJehx/vZQzrkZo36TDoQXiTToFvzvMVGZ2N8uH4GZ/q4ByllbobenkVYi+r8fvV67jGf2cWf5YMOsrilXAcWBV0JZVEnp5LrodQmD/lXyTtjqaWY8tzsTN/iHQW/hWB8VWSuj5aXgufAv2MREOhM7QYW0osC7HHoMQ/D781RLtioX2Q0hBFdZr/FA6BxS+wyooYDWwF7wHime1cDH4r95JoTdl36UhbspofJeODqtSAasDqwTrbsVsgbEF/6HC1uOvwDbQYe1UYCmuvwHiyY2twlu+WcZ1WIYKWD28CC4lI8GlpMPqpIDJb+k69d3R7YygwP8BZjx0IBJLJOUAAAAASUVORK5CYII="

  # token decimal
  decimal = 16

  # token initial supply
  initial_supply = 93000000

  # token total supply
  total_supply = 186000000

  # inflation rate
  inflation_rate = 0

  [forge.poke]

  # the address for poke tx
  address = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"

  # the balance of account
  balance = 3750000000

  # daily limit for poke
  daily_limit = 2500000

  # the amount account get with poke tx
  amount = 25

# ------------------------------------------------------------------
# tendermint configuration
# ------------------------------------------------------------------

[tendermint]

# a custom human readable name for this node
moniker = "forge"

# path of tendermint
path = "~/.forge/tendermint"

# path of tendermint configuration
keypath = "config"

# log path
logpath = "logs"

# socket to proxy app
sock_proxy_app = "tcp://127.0.0.1:27220"

# socket for tendermint json rpc
sock_rpc = "tcp://127.0.0.1:27221"

# socket for tendermint grpc (right now just use it for send tx and commit immediately)
sock_grpc = "tcp://127.0.0.1:27222"

# socket for tendermint p2p, normally this shall be opened to the public network
sock_p2p = "tcp://0.0.0.0:26656"

# socket for performance metrics
sock_prof = ""

# persistent peers
persistent_peers = ""

# seed peers
seed_peers = ""

# timeout for commiting a new block
timeout_commit = "5s"

# create empty blocks in 5s interval
create_empty_blocks = true
create_empty_blocks_interval = "0s"

# set if this node runs in a seed mode
seed_mode = false

# output level for logging, including package level options
log_level = "consensus:info,main:info,state:info,*:error"

# maximum number of inbound peers
max_num_inbound_peers = 40

# maximum number of outbound peers to connect to, excluding persistent peers
max_num_outbound_peers = 10

# UPNP port forwarding
upnp = false

# wether to recheck unconfirmed transactions in mempool
recheck = false

  [tendermint.genesis]

  # genesis time
  genesis_time = "2018-11-05T19:22:08.938749Z"

  # blockchain id
  chain_id = "forge"

  # max bytes
  max_bytes = 1200000

  # max gas
  max_gas = -1

  # application hash
  app_hash = ""

  # note that if you don't give this information we will use self as validator
  [[tendermint.genesis.validators]]

# ------------------------------------------------------------------
# ipfs configuration
# ------------------------------------------------------------------

[ipfs]

# path of ipfs
path = "~/.forge/ipfs"

# log path
logpath = "logs"

# max amount for storage
storage_max = "10GB"

# bootstrap ipfs node list
bootstrap = []

# ipfs swarm port
swarm_port = 24001

# ipfs api port
api_port = 25001

# ipfs gateway port
gateway_port = 28080

# max file size for admin/account
max_file_size.admin = "100M"
max_file_size.account = "1M"

# ------------------------------------------------------------------
# cache configuration
# ------------------------------------------------------------------

[cache]

# path for mnesia
path = "~/.forge/cache/mnesia_data_dir"

# cache dump limit
dc_dump_limit = 50

# cache dump log write threshold
dump_log_write_threshold = 50_000

# mnesia table timeout
cache_mnesia_table_timeout = 15_000

# ------------------------------------------------------------------
# geolix configuration
# ------------------------------------------------------------------

[geolix]

# mmdb url
mmdb_url = "https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"

# path for mmdb
mmdb_path = "~/.mmdb/GeoLite2-City.tar.gz"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
Last Updated: 3/22/2019, 7:02:58 AM