Skip to content
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

internal/cli: added missing flags #744

Merged
merged 24 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
964944a
minor comment update
pratikspatil024 Feb 14, 2023
ba0cca0
added support for rpc.evmtimeout flag
pratikspatil024 Feb 14, 2023
dd474af
added support for vmdebug (EnablePreimageRecording) flag
pratikspatil024 Feb 14, 2023
2c9373f
added support for jsonrpc.auth.(jwtsecret, addr, port, vhosts) flags
pratikspatil024 Feb 14, 2023
fcb722e
added support for miner.recommit flag
pratikspatil024 Feb 14, 2023
b59d794
added support for gpo.maxheaderhistory and gpo.maxblockhistory flag
pratikspatil024 Feb 15, 2023
ee79398
Revert "added support for miner.recommit flag"
pratikspatil024 Feb 15, 2023
85e21cc
added pprof related flags (expect --pprof.cpuprofile - Write CPU prof…
pratikspatil024 Feb 16, 2023
aeaac2e
added support for --dev.gaslimit flag
pratikspatil024 Feb 16, 2023
9649fe1
added support for --fdlimit flag
pratikspatil024 Feb 17, 2023
fd822ed
added support for --netrestrict flag
pratikspatil024 Feb 22, 2023
f1439ce
added support for --nodekey and --nodekeyhex flag
pratikspatil024 Feb 22, 2023
44c3e7e
added support for --vmodule, --log.json, --log.backtrace, and --log.d…
pratikspatil024 Feb 23, 2023
441efb0
Merge branch 'develop' into pos-1144
pratikspatil024 Feb 24, 2023
2d93fb6
fixed related lint errors
pratikspatil024 Feb 28, 2023
7047437
fix lints from develop (few lints decided to appear from code that wa…
pratikspatil024 Mar 6, 2023
2476c08
more weird lints from develop
pratikspatil024 Mar 9, 2023
f858c86
small precautionary fix
pratikspatil024 Mar 9, 2023
141b8c6
small bug ;) fix in NetRestrict
pratikspatil024 Mar 16, 2023
06ccf84
Merge branch 'develop' of https://github.com/maticnetwork/bor into po…
pratikspatil024 Mar 16, 2023
3fc3be3
weird lints
pratikspatil024 Mar 16, 2023
e7a408b
Merge branch 'develop' of https://github.com/maticnetwork/bor into po…
pratikspatil024 Mar 20, 2023
741e75c
change vmdebug = true to vmdebug = false
pratikspatil024 Mar 20, 2023
c72d42f
Merge branch 'develop' of https://github.com/maticnetwork/bor into po…
pratikspatil024 Mar 20, 2023
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
18 changes: 18 additions & 0 deletions builder/files/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ chain = "mainnet"
# chain = "mumbai"
# identity = "Annon-Identity"
# verbosity = 3
# vmdebug = true
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = "/var/lib/bor/keystore"
Expand Down Expand Up @@ -64,6 +65,7 @@ syncmode = "full"
# ipcdisable = false
# ipcpath = ""
# gascap = 50000000
# evmtimeout = "5s"
# txfeecap = 5.0
# [jsonrpc.http]
# enabled = false
Expand All @@ -87,6 +89,11 @@ syncmode = "full"
# host = ""
# vhosts = ["*"]
# corsdomain = ["*"]
# [jsonrpc.auth]
# jwtsecret = ""
# addr = "localhost"
# port = 8551
# vhosts = ["localhost"]
# [jsonrpc.timeouts]
# read = "30s"
# write = "30s"
Expand All @@ -95,6 +102,8 @@ syncmode = "full"
[gpo]
# blocks = 20
# percentile = 60
# maxheaderhistory = 1024
# maxblockhistory = 1024
# maxprice = "5000000000000"
ignoreprice = "30000000000"

Expand Down Expand Up @@ -128,6 +137,7 @@ syncmode = "full"
# txlookuplimit = 2350000
# triesinmemory = 128
# timeout = "1h0m0s"
# fdlimit = 0

[accounts]
# allow-insecure-unlock = true
Expand All @@ -142,3 +152,11 @@ syncmode = "full"
# [developer]
# dev = false
# period = 0
# gaslimit = 11500000

# [pprof]
# pprof = false
# port = 6060
# addr = "127.0.0.1"
# memprofilerate = 524288
# blockprofilerate = 0
24 changes: 21 additions & 3 deletions docs/cli/example_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

chain = "mainnet" # Name of the chain to sync ("mumbai", "mainnet") or path to a genesis file
identity = "Annon-Identity" # Name/Identity of the node (default = OS hostname)
verbosity = 3 # Logging verbosity for the server (5=trace|4=debug|3=info|2=warn|1=error|0=crit) (`log-level` was replaced by `verbosity`, and thus will be deprecated soon)
verbosity = 3 # Logging verbosity for the server (5=trace|4=debug|3=info|2=warn|1=error|0=crit) (`log-level` was replaced by `verbosity`, and thus will be deprecated soon)
vmdebug = true # Record information useful for VM and contract debugging
datadir = "var/lib/bor" # Path of the data directory to store information
ancient = "" # Data directory for ancient chain segments (default = inside chaindata)
keystore = "" # Path of the directory where keystores are located
Expand Down Expand Up @@ -63,6 +64,7 @@ ethstats = "" # Reporting URL of a ethstats service (nodename:sec
ipcdisable = false # Disable the IPC-RPC server
ipcpath = "" # Filename for IPC socket/pipe within the datadir (explicit paths escape it)
gascap = 50000000 # Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite)
evmtimeout = "5s" # Sets a timeout used for eth_call (0=infinite)
txfeecap = 5.0 # Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap)
[jsonrpc.http]
enabled = false # Enable the HTTP-RPC server
Expand All @@ -86,6 +88,11 @@ ethstats = "" # Reporting URL of a ethstats service (nodename:sec
host = "" #
vhosts = ["localhost"] # Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.
corsdomain = ["localhost"] # Comma separated list of domains from which to accept cross origin requests (browser enforced)
[jsonrpc.auth]
jwtsecret = "" # Path to a JWT secret to use for authenticated RPC endpoints
addr = "localhost" # Listening address for authenticated APIs
port = 8551 # Listening port for authenticated APIs
vhosts = ["localhost"] # Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.
[jsonrpc.timeouts]
read = "30s"
write = "30s"
Expand All @@ -94,6 +101,8 @@ ethstats = "" # Reporting URL of a ethstats service (nodename:sec
[gpo]
blocks = 20 # Number of recent blocks to check for gas prices
percentile = 60 # Suggested gas price is the given percentile of a set of recent transaction gas prices
maxheaderhistory = 1024 # Maximum header history of gasprice oracle
maxblockhistory = 1024 # Maximum block history of gasprice oracle
maxprice = "5000000000000" # Maximum gas price will be recommended by gpo
ignoreprice = "2" # Gas price below which gpo will ignore transactions (recommended for mainnet = 30000000000, default suitable for mumbai/devnet)

Expand Down Expand Up @@ -131,6 +140,7 @@ ethstats = "" # Reporting URL of a ethstats service (nodename:sec
txlookuplimit = 2350000 # Number of recent blocks to maintain transactions index for (default = about 56 days, 0 = entire chain)
triesinmemory = 128 # Number of block states (tries) to keep in memory
timeout = "1h0m0s" # Time after which the Merkle Patricia Trie is stored to disc from memory
fdlimit = 0 # Raise the open file descriptor resource limit (default = system fd limit)

[accounts]
unlock = [] # Comma separated list of accounts to unlock
Expand All @@ -143,5 +153,13 @@ ethstats = "" # Reporting URL of a ethstats service (nodename:sec
addr = ":3131" # Address and port to bind the GRPC server

[developer]
dev = false # Enable developer mode with ephemeral proof-of-authority network and a pre-funded developer account, mining enabled
period = 0 # Block period to use in developer mode (0 = mine only if transaction pending)
dev = false # Enable developer mode with ephemeral proof-of-authority network and a pre-funded developer account, mining enabled
period = 0 # Block period to use in developer mode (0 = mine only if transaction pending)
gaslimit = 11500000 # Initial block gas limit

[pprof]
pprof = false # Enable the pprof HTTP server
port = 6060 # pprof HTTP server listening port
addr = "127.0.0.1" # pprof HTTP server listening interface
memprofilerate = 524288 # Turn on memory profiling with the given rate
blockprofilerate = 0 # Turn on block profiling with the given rate
34 changes: 33 additions & 1 deletion docs/cli/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ The ```bor server``` command runs the Bor client.

- ```datadir```: Path of the data directory to store information

- ```vmdebug```: Record information useful for VM and contract debugging (default: false)

- ```datadir.ancient```: Data directory for ancient chain segments (default = inside chaindata)

- ```keystore```: Path of the directory where keystores are located

- ```config```: File for the config file
- ```config```: Path to the TOML configuration file

- ```syncmode```: Blockchain sync mode (only "full" sync supported) (default: full)

Expand All @@ -34,6 +36,8 @@ The ```bor server``` command runs the Bor client.

- ```bor.withoutheimdall```: Run without Heimdall service (for testing purpose) (default: false)

- ```bor.devfakeauthor```: Run miner without validator set authorization [dev mode] : Use with '--bor.withoutheimdall' (default: false)

- ```bor.heimdallgRPC```: Address of Heimdall gRPC service

- ```bor.runheimdall```: Run Heimdall service as a child process (default: false)
Expand All @@ -46,6 +50,10 @@ The ```bor server``` command runs the Bor client.

- ```gpo.percentile```: Suggested gas price is the given percentile of a set of recent transaction gas prices (default: 60)

- ```gpo.maxheaderhistory```: Maximum header history of gasprice oracle (default: 1024)

- ```gpo.maxblockhistory```: Maximum block history of gasprice oracle (default: 1024)

- ```gpo.maxprice```: Maximum gas price will be recommended by gpo (default: 5000000000000)

- ```gpo.ignoreprice```: Gas price below which gpo will ignore transactions (default: 2)
Expand All @@ -58,6 +66,18 @@ The ```bor server``` command runs the Bor client.

- ```dev.period```: Block period to use in developer mode (0 = mine only if transaction pending) (default: 0)

- ```dev.gaslimit```: Initial block gas limit (default: 11500000)

- ```pprof```: Enable the pprof HTTP server (default: false)

- ```pprof.port```: pprof HTTP server listening port (default: 6060)

- ```pprof.addr```: pprof HTTP server listening interface (default: 127.0.0.1)

- ```pprof.memprofilerate```: Turn on memory profiling with the given rate (default: 524288)

- ```pprof.blockprofilerate```: Turn on block profiling with the given rate (default: 0)

### Account Management Options

- ```unlock```: Comma separated list of accounts to unlock
Expand Down Expand Up @@ -92,16 +112,28 @@ The ```bor server``` command runs the Bor client.

- ```txlookuplimit```: Number of recent blocks to maintain transactions index for (default: 2350000)

- ```fdlimit```: Raise the open file descriptor resource limit (default = system fd limit) (default: 0)

### JsonRPC Options

- ```rpc.gascap```: Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite) (default: 50000000)

- ```rpc.evmtimeout```: Sets a timeout used for eth_call (0=infinite) (default: 5s)

- ```rpc.txfeecap```: Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default: 5)

- ```ipcdisable```: Disable the IPC-RPC server (default: false)

- ```ipcpath```: Filename for IPC socket/pipe within the datadir (explicit paths escape it)

- ```authrpc.jwtsecret```: Path to a JWT secret to use for authenticated RPC endpoints

- ```authrpc.addr```: Listening address for authenticated APIs (default: localhost)

- ```authrpc.port```: Listening port for authenticated APIs (default: 8551)

- ```authrpc.vhosts```: Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: localhost)

- ```http.corsdomain```: Comma separated list of domains from which to accept cross origin requests (browser enforced) (default: localhost)

- ```http.vhosts```: Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: localhost)
Expand Down
3 changes: 2 additions & 1 deletion internal/cli/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ func TestCommand_DebugBlock(t *testing.T) {

// enable developer mode
config.Developer.Enabled = true
config.Developer.Period = 2 // block time
config.Developer.Period = 2 // block time
config.Developer.GasLimit = 11500000 // initial block gaslimit

// enable archive mode for getting traces of ancient blocks
config.GcMode = "archive"
Expand Down
1 change: 1 addition & 0 deletions internal/cli/dumpconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (c *DumpconfigCommand) Run(args []string) int {
userConfig := command.GetConfig()

// convert the big.Int and time.Duration fields to their corresponding Raw fields
userConfig.JsonRPC.RPCEVMTimeoutRaw = userConfig.JsonRPC.RPCEVMTimeout.String()
userConfig.JsonRPC.HttpTimeout.ReadTimeoutRaw = userConfig.JsonRPC.HttpTimeout.ReadTimeout.String()
userConfig.JsonRPC.HttpTimeout.WriteTimeoutRaw = userConfig.JsonRPC.HttpTimeout.WriteTimeout.String()
userConfig.JsonRPC.HttpTimeout.IdleTimeoutRaw = userConfig.JsonRPC.HttpTimeout.IdleTimeout.String()
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/server/chains/developer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// GetDeveloperChain returns the developer mode configs.
func GetDeveloperChain(period uint64, faucet common.Address) *Chain {
func GetDeveloperChain(period uint64, gasLimitt uint64, faucet common.Address) *Chain {
// Override the default period to the user requested one
config := *params.AllCliqueProtocolChanges
config.Clique = &params.CliqueConfig{
Expand All @@ -26,7 +26,7 @@ func GetDeveloperChain(period uint64, faucet common.Address) *Chain {
Genesis: &core.Genesis{
Config: &config,
ExtraData: append(append(make([]byte, 32), faucet[:]...), make([]byte, crypto.SignatureLength)...),
GasLimit: 11500000,
GasLimit: gasLimitt,
BaseFee: big.NewInt(params.InitialBaseFee),
Difficulty: big.NewInt(1),
Alloc: map[common.Address]core.GenesisAccount{
Expand Down
Loading