-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/cli: use config file for flags in new-cli, builder/files: up…
…date defaults (#457) * updated simple.json and simple.hcl * added annotations for developer and grpc block * added toml tags and simple.toml file * added support for toml config files * updated simple files toml, hcl, json * added config.toml in builder/files and updated bor.service * add dumpconfig command in cli for exporting configs * update docs * updated .goreleaser.yml (POS-651) * changed --config to -config * added test config for tests and fixed lint errors * made fields of type big.int and time.Duration private, removed merge from dumpconfig, setting up default values to the Raw fields in dumpconfig, and fixed one lint error * fixed lint errors (strange) * lint fix * private no-more, using '-' in name tags to ignore * updated name tags, made c.configFile as a stringFlag (only one config file supported) and updated the merge logic in command.go -> Run() * fix: set method for big.Int flags, added a TODO * handeled bigInt and timeDuration type, bug fix in config_legacy, lint fix * updated flags, consistent across flags.go and config.go * fixed config test and updated test hcl, json config files * updated config legacy test * added test to check values of cmd flags, restructured Run in command.go, linter fix * fix linters * lint again * changed 2 flags and assert -> require * changed the 2 flags back * updated correct congig.toml path and made mainnet default * updated config.toml with new flags * added sample config (toml) file * removed sample-config.toml and added it in docs/config.md Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
- Loading branch information
Showing
25 changed files
with
625 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# chain = "mumbai" | ||
chain = "mainnet" | ||
datadir = "/var/lib/bor/data" | ||
syncmode = "full" | ||
|
||
[telemetry] | ||
metrics = true | ||
prometheus-addr = "127.0.0.1:7071" | ||
|
||
[miner] | ||
# *** Validator params | ||
# *** Uncomment and configure the following lines in case you run a validator. | ||
# mine = true | ||
# etherbase = "VALIDATOR ADDRESS" | ||
gasprice = "30000000000" | ||
gasceil = 20000000 | ||
|
||
|
||
[txpool] | ||
accountqueue = 16 | ||
accountslots = 16 | ||
globalqueue = 32768 | ||
globalslots = 32768 | ||
lifetime = "1h30m0s" | ||
nolocals = true | ||
pricelimit = 30000000000 | ||
|
||
[p2p] | ||
# *** Validator params | ||
# *** Uncomment and configure the following lines in case you run a validator. | ||
# nodiscover = true | ||
# maxpeers = 1 | ||
[p2p.discovery] | ||
bootnodes = ["enode://0cb82b395094ee4a2915e9714894627de9ed8498fb881cec6db7c65e8b9a5bd7f2f25cc84e71e89d0947e51c76e85d0847de848c7782b13c0255247a6758178c@44.232.55.71:30303", "enode://88116f4295f5a31538ae409e4d44ad40d22e44ee9342869e7d68bdec55b0f83c1530355ce8b41fbec0928a7d75a5745d528450d30aec92066ab6ba1ee351d710@159.203.9.164:30303"] | ||
|
||
# *** Validator params | ||
# *** Uncomment and configure the following lines in case you run a validator. | ||
|
||
# keystore = "/var/lib/bor/keystore" | ||
|
||
# [accounts] | ||
# allow-insecure-unlock = true | ||
# password = "/var/lib/bor/password.txt" | ||
# unlock = ["VALIDATOR ADDRESS"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Dumpconfig | ||
|
||
The ```bor dumpconfig <your-favourite-flags>``` command will export the user provided flags into a configuration file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,133 +1,144 @@ | ||
|
||
# Config | ||
|
||
Toml files format used in geth are being deprecated. | ||
|
||
Bor uses uses JSON and [HCL](https://github.com/hashicorp/hcl) formats to create configuration files. This is the format in HCL alongside the default values: | ||
|
||
- The `bor dumpconfig` command prints the default configurations, in the TOML format, on the terminal. | ||
- One can `pipe (>)` this to a file (say `config.toml`) and use it to start bor. | ||
- Command to provide a config file: `bor server -config config.toml` | ||
- Bor uses TOML, HCL, and JSON format config files. | ||
- This is the format of the config file in TOML: | ||
- **NOTE: The values of these following flags are just for reference** | ||
- `config.toml` file: | ||
``` | ||
chain = "mainnet" | ||
log-level = "info" | ||
data-dir = "" | ||
sync-mode = "fast" | ||
gc-mode = "full" | ||
identity = "myIdentity" | ||
log-level = "INFO" | ||
datadir = "/var/lib/bor/data" | ||
keystore = "path/to/keystore" | ||
syncmode = "full" | ||
gcmode = "full" | ||
snapshot = true | ||
ethstats = "" | ||
whitelist = {} | ||
p2p { | ||
max-peers = 30 | ||
max-pend-peers = 50 | ||
bind = "0.0.0.0" | ||
port = 30303 | ||
no-discover = false | ||
nat = "any" | ||
discovery { | ||
v5-enabled = false | ||
bootnodes = [] | ||
bootnodesv4 = [] | ||
bootnodesv5 = [] | ||
staticNodes = [] | ||
trustedNodes = [] | ||
dns = [] | ||
} | ||
} | ||
heimdall { | ||
url = "http://localhost:1317" | ||
without = false | ||
} | ||
txpool { | ||
locals = [] | ||
no-locals = false | ||
journal = "" | ||
rejournal = "1h" | ||
price-limit = 1 | ||
price-bump = 10 | ||
account-slots = 16 | ||
global-slots = 4096 | ||
account-queue = 64 | ||
global-queue = 1024 | ||
lifetime = "3h" | ||
} | ||
sealer { | ||
enabled = false | ||
etherbase = "" | ||
gas-ceil = 8000000 | ||
extra-data = "" | ||
} | ||
gpo { | ||
blocks = 20 | ||
percentile = 60 | ||
} | ||
jsonrpc { | ||
ipc-disable = false | ||
ipc-path = "" | ||
modules = ["web3", "net"] | ||
cors = ["*"] | ||
vhost = ["*"] | ||
http { | ||
enabled = false | ||
port = 8545 | ||
prefix = "" | ||
host = "localhost" | ||
} | ||
ws { | ||
enabled = false | ||
port = 8546 | ||
prefix = "" | ||
host = "localhost" | ||
} | ||
graphqh { | ||
enabled = false | ||
} | ||
} | ||
telemetry { | ||
enabled = false | ||
expensive = false | ||
influxdb { | ||
v1-enabled = false | ||
endpoint = "" | ||
database = "" | ||
username = "" | ||
password = "" | ||
v2-enabled = false | ||
token = "" | ||
bucket = "" | ||
organization = "" | ||
} | ||
} | ||
cache { | ||
cache = 1024 | ||
perc-database = 50 | ||
perc-trie = 15 | ||
perc-gc = 25 | ||
perc-snapshot = 10 | ||
journal = "triecache" | ||
rejournal = "60m" | ||
no-prefetch = false | ||
preimages = false | ||
tx-lookup-limit = 2350000 | ||
} | ||
accounts { | ||
unlock = [] | ||
password-file = "" | ||
allow-insecure-unlock = false | ||
use-lightweight-kdf = false | ||
} | ||
grpc { | ||
addr = ":3131" | ||
} | ||
[p2p] | ||
maxpeers = 30 | ||
maxpendpeers = 50 | ||
bind = "0.0.0.0" | ||
port = 30303 | ||
nodiscover = false | ||
nat = "any" | ||
[p2p.discovery] | ||
v5disc = false | ||
bootnodes = ["enode://d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666@18.138.108.67:30303", "enode://22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de@3.209.45.79:30303"] | ||
bootnodesv4 = [] | ||
bootnodesv5 = ["enr:-KG4QOtcP9X1FbIMOe17QNMKqDxCpm14jcX5tiOE4_TyMrFqbmhPZHK_ZPG2Gxb1GE2xdtodOfx9-cgvNtxnRyHEmC0ghGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQDE8KdiXNlY3AyNTZrMaEDhpehBDbZjM_L9ek699Y7vhUJ-eAdMyQW_Fil522Y0fODdGNwgiMog3VkcIIjKA", "enr:-KG4QDyytgmE4f7AnvW-ZaUOIi9i79qX4JwjRAiXBZCU65wOfBu-3Nb5I7b_Rmg3KCOcZM_C3y5pg7EBU5XGrcLTduQEhGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQ2_DUbiXNlY3AyNTZrMaEDKnz_-ps3UUOfHWVYaskI5kWYO_vtYMGYCQRAR3gHDouDdGNwgiMog3VkcIIjKA"] | ||
static-nodes = ["enode://8499da03c47d637b20eee24eec3c356c9a2e6148d6fe25ca195c7949ab8ec2c03e3556126b0d7ed644675e78c4318b08691b7b57de10e5f0d40d05b09238fa0a@52.187.207.27:30303"] | ||
trusted-nodes = ["enode://2b252ab6a1d0f971d9722cb839a42cb81db019ba44c08754628ab4a823487071b5695317c8ccd085219c3a03af063495b2f1da8d18218da2d6a82981b45e6ffc@65.108.70.101:30303"] | ||
dns = [] | ||
[heimdall] | ||
url = "http://localhost:1317" | ||
"bor.without" = false | ||
[txpool] | ||
locals = ["$ADDRESS1", "$ADDRESS2"] | ||
nolocals = false | ||
journal = "" | ||
rejournal = "1h0m0s" | ||
pricelimit = 30000000000 | ||
pricebump = 10 | ||
accountslots = 16 | ||
globalslots = 32768 | ||
accountqueue = 16 | ||
globalqueue = 32768 | ||
lifetime = "3h0m0s" | ||
[miner] | ||
mine = false | ||
etherbase = "" | ||
extradata = "" | ||
gaslimit = 20000000 | ||
gasprice = "30000000000" | ||
[jsonrpc] | ||
ipcdisable = false | ||
ipcpath = "/var/lib/bor/bor.ipc" | ||
gascap = 50000000 | ||
txfeecap = 5e+00 | ||
[jsonrpc.http] | ||
enabled = false | ||
port = 8545 | ||
prefix = "" | ||
host = "localhost" | ||
api = ["eth", "net", "web3", "txpool", "bor"] | ||
vhosts = ["*"] | ||
corsdomain = ["*"] | ||
[jsonrpc.ws] | ||
enabled = false | ||
port = 8546 | ||
prefix = "" | ||
host = "localhost" | ||
api = ["web3", "net"] | ||
vhosts = ["*"] | ||
corsdomain = ["*"] | ||
[jsonrpc.graphql] | ||
enabled = false | ||
port = 0 | ||
prefix = "" | ||
host = "" | ||
api = [] | ||
vhosts = ["*"] | ||
corsdomain = ["*"] | ||
[gpo] | ||
blocks = 20 | ||
percentile = 60 | ||
maxprice = "5000000000000" | ||
ignoreprice = "2" | ||
[telemetry] | ||
metrics = false | ||
expensive = false | ||
prometheus-addr = "" | ||
opencollector-endpoint = "" | ||
[telemetry.influx] | ||
influxdb = false | ||
endpoint = "" | ||
database = "" | ||
username = "" | ||
password = "" | ||
influxdbv2 = false | ||
token = "" | ||
bucket = "" | ||
organization = "" | ||
[cache] | ||
cache = 1024 | ||
gc = 25 | ||
snapshot = 10 | ||
database = 50 | ||
trie = 15 | ||
journal = "triecache" | ||
rejournal = "1h0m0s" | ||
noprefetch = false | ||
preimages = false | ||
txlookuplimit = 2350000 | ||
[accounts] | ||
unlock = ["$ADDRESS1", "$ADDRESS2"] | ||
password = "path/to/password.txt" | ||
allow-insecure-unlock = false | ||
lightkdf = false | ||
disable-bor-wallet = false | ||
[grpc] | ||
addr = ":3131" | ||
[developer] | ||
dev = false | ||
period = 0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.