Skip to content

Commit 35e0661

Browse files
authored
Merge pull request #441 from input-output-hk/feature/cgkiele-155
Add universal configuration for a custom private testnet
2 parents b5e053d + cfd8a6f commit 35e0661

File tree

3 files changed

+110
-3
lines changed

3 files changed

+110
-3
lines changed

src/universal/conf/mantis.conf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ include "misc.conf"
1616
include "consensus.conf"
1717

1818
# Uncomment the following include to connect to the Ethereum Hard-Fork network.
19-
# Note that any settings in this file will override the ones defined in the files above
19+
# Note that any settings in this file will override the ones defined in the files above.
2020
# include "ethereumHF.conf"
2121

2222
# Uncomment the following include to connect to the testnet Morden.
23-
# Note that any settings in this file will override the ones defined in the files above
23+
# Note that any settings in this file will override the ones defined in the files above.
2424
# include "morden.conf"
2525

2626
# Uncomment the following include to connect to the testnet Ropsten.
27-
# Note that any settings in this file will override the ones defined in the files above
27+
# Note that any settings in this file will override the ones defined in the files above.
2828
# include "ropsten.conf"
29+
30+
# Uncomment the following include to connect to your custom private testnet.
31+
# Note that any settings in this file will override the ones defined in the files above.
32+
# include "private-testnet.conf"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extraData": "0x00",
3+
"nonce": "0x0000000000000042",
4+
"gasLimit": "0x2fefd8",
5+
"difficulty": "0x400",
6+
"ommersHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
7+
"timestamp": "0x00",
8+
"coinbase": "0x0000000000000000000000000000000000000000",
9+
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
10+
"alloc": {
11+
"d7a681378321f472adffb9fdded2712f677e0ba9": {
12+
"balance": "1606938044258990275541962092341162602522202993782792835301376"
13+
}
14+
}
15+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Sample configuration for a custom private testnet.
2+
mantis {
3+
sync {
4+
# Whether to enable fast-sync
5+
do-fast-sync = false
6+
7+
# Duration for blacklisting a peer. Blacklisting reason include: invalid response from peer, response time-out, etc.
8+
# 0 value is a valid duration and it will disable blacklisting completely (which can be useful when all nodes are
9+
# are controlled by a single party, eg. private networks)
10+
blacklist-duration = 0
11+
12+
# Set to false to disable broadcasting the NewBlockHashes message, as its usefulness is debatable,
13+
# especially in the context of private networks
14+
broadcast-new-block-hashes = false
15+
}
16+
17+
blockchain {
18+
# DAO fork configuration (Ethereum HF/Classic split)
19+
# https://blog.ethereum.org/2016/07/20/hard-fork-completed/
20+
dao = null
21+
22+
# Custom genesis JSON file
23+
# null value indicates using default genesis definition that matches the main network
24+
custom-genesis-file = "conf/private-genesis.json"
25+
}
26+
27+
network {
28+
discovery {
29+
# We assume a fixed cluster, so `bootstrap-nodes` must not be empty
30+
discovery-enabled = false
31+
32+
# Listening interface for discovery protocol
33+
interface = ${mantis.network.server-address.interface}
34+
35+
# Listening port for discovery protocol
36+
# port = 30303
37+
38+
# Set of initial nodes
39+
bootstrap-nodes = [
40+
"enode://18a551bee469c2e02de660ab01dede06503c986f6b8520cb5a65ad122df88b17b285e3fef09a40a0d44f99e014f8616cf1ebc2e094f96c6e09e2f390f5d34857@127.0.0.1:30303",
41+
]
42+
}
43+
44+
peer {
45+
# Ethereum network identifier:
46+
# 1 - mainnet, 2 - morden
47+
network-id = 2139
48+
}
49+
50+
rpc {
51+
# JSON-RPC mode
52+
# Available modes are: http, https
53+
# Choosing https requires creating a certificate and setting up 'certificate-keystore-path' and
54+
# 'certificate-password-file'
55+
# See: https://github.com/input-output-hk/mantis/wiki/Creating-self-signed-certificate-for-using-JSON-RPC-with-HTTPS
56+
mode = "http"
57+
58+
# Listening address of JSON-RPC HTTP/HTTPS endpoint
59+
interface = ${mantis.network.server-address.interface}
60+
61+
# Listening port of JSON-RPC HTTP/HTTPS endpoint
62+
# port = 8546
63+
64+
# Domains allowed to query RPC endpoint. Use "*" to enable requests from any domain.
65+
cors-allowed-origins = "*"
66+
}
67+
}
68+
69+
# This is the section dedicated to `atomix-raft` consensus.
70+
# This consensus protocol is selected by setting `mantis.consensus.protocol = atomix-raft`.
71+
atomix-raft {
72+
election-timeout = 30.seconds
73+
74+
# Determines how often new blocks will be forged
75+
block-forging-delay = 15.seconds
76+
77+
# Represents this node.
78+
#
79+
# ID and PORT are not mandatory.
80+
# If PORT is not given, then is assumes the value of
81+
# io.atomix.messaging.impl.NettyMessagingService.DEFAULT_PORT, which currently is 5679.
82+
# If ID is not given, then its value becomes IP_PORT.
83+
local-node = ${mantis.network.server-address.interface}
84+
85+
# All the other nodes in the cluster, in the same format as with `local-node`.
86+
bootstrap-nodes = []
87+
}
88+
}

0 commit comments

Comments
 (0)