Skip to content

Add universal configuration for a custom private testnet #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/universal/conf/mantis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ include "misc.conf"
include "consensus.conf"

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

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

# Uncomment the following include to connect to the testnet Ropsten.
# Note that any settings in this file will override the ones defined in the files above
# Note that any settings in this file will override the ones defined in the files above.
# include "ropsten.conf"

# Uncomment the following include to connect to your custom private testnet.
# Note that any settings in this file will override the ones defined in the files above.
# include "private-testnet.conf"
15 changes: 15 additions & 0 deletions src/universal/conf/private-genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extraData": "0x00",
"nonce": "0x0000000000000042",
"gasLimit": "0x2fefd8",
"difficulty": "0x400",
"ommersHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"timestamp": "0x00",
"coinbase": "0x0000000000000000000000000000000000000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"alloc": {
"d7a681378321f472adffb9fdded2712f677e0ba9": {
"balance": "1606938044258990275541962092341162602522202993782792835301376"
}
}
}
88 changes: 88 additions & 0 deletions src/universal/conf/private-testnet.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Sample configuration for a custom private testnet.
mantis {
sync {
# Whether to enable fast-sync
do-fast-sync = false

# Duration for blacklisting a peer. Blacklisting reason include: invalid response from peer, response time-out, etc.
# 0 value is a valid duration and it will disable blacklisting completely (which can be useful when all nodes are
# are controlled by a single party, eg. private networks)
blacklist-duration = 0

# Set to false to disable broadcasting the NewBlockHashes message, as its usefulness is debatable,
# especially in the context of private networks
broadcast-new-block-hashes = false
}

blockchain {
# DAO fork configuration (Ethereum HF/Classic split)
# https://blog.ethereum.org/2016/07/20/hard-fork-completed/
dao = null

# Custom genesis JSON file
# null value indicates using default genesis definition that matches the main network
custom-genesis-file = "conf/private-genesis.json"
}

network {
discovery {
# We assume a fixed cluster, so `bootstrap-nodes` must not be empty
discovery-enabled = false

# Listening interface for discovery protocol
interface = ${mantis.network.server-address.interface}

# Listening port for discovery protocol
# port = 30303

# Set of initial nodes
bootstrap-nodes = [
"enode://18a551bee469c2e02de660ab01dede06503c986f6b8520cb5a65ad122df88b17b285e3fef09a40a0d44f99e014f8616cf1ebc2e094f96c6e09e2f390f5d34857@127.0.0.1:30303",
]
Copy link
Contributor

@rtkaczyk rtkaczyk Apr 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, as it will have to be modified anyway, but wouldn't we prefer empty list or even:

bootstrap-nodes = [
  # fill in with node URIs for the private network, e.g.:
  # "enode://18a551bee469c2e02de660ab01dede06503c986f6b8520cb5a65ad122df88b17b285e3fef09a40a0d44f99e014f8616cf1ebc2e094f96c6e09e2f390f5d34857@127.0.0.1:30303"
]

}

peer {
# Ethereum network identifier:
# 1 - mainnet, 2 - morden
network-id = 2139
}

rpc {
# JSON-RPC mode
# Available modes are: http, https
# Choosing https requires creating a certificate and setting up 'certificate-keystore-path' and
# 'certificate-password-file'
# See: https://github.com/input-output-hk/mantis/wiki/Creating-self-signed-certificate-for-using-JSON-RPC-with-HTTPS
mode = "http"

# Listening address of JSON-RPC HTTP/HTTPS endpoint
interface = ${mantis.network.server-address.interface}

# Listening port of JSON-RPC HTTP/HTTPS endpoint
# port = 8546

# Domains allowed to query RPC endpoint. Use "*" to enable requests from any domain.
cors-allowed-origins = "*"
}
}

# This is the section dedicated to `atomix-raft` consensus.
# This consensus protocol is selected by setting `mantis.consensus.protocol = atomix-raft`.
atomix-raft {
election-timeout = 30.seconds

# Determines how often new blocks will be forged
block-forging-delay = 15.seconds

# Represents this node.
#
# ID and PORT are not mandatory.
# If PORT is not given, then is assumes the value of
# io.atomix.messaging.impl.NettyMessagingService.DEFAULT_PORT, which currently is 5679.
# If ID is not given, then its value becomes IP_PORT.
local-node = ${mantis.network.server-address.interface}

# All the other nodes in the cluster, in the same format as with `local-node`.
bootstrap-nodes = []
}
}