From 35ee70c55daf33f2c0dfec7338b429347406b848 Mon Sep 17 00:00:00 2001 From: Pratik Patil Date: Wed, 11 Jan 2023 13:15:12 +0530 Subject: [PATCH] updated the config files and docs --- builder/files/config.toml | 2 ++ docs/cli/example_config.toml | 2 ++ docs/cli/server.md | 4 ++++ internal/cli/server/config.go | 8 ++++---- internal/cli/server/flags.go | 8 ++++---- packaging/templates/mainnet-v1/archive/config.toml | 2 ++ .../templates/mainnet-v1/sentry/sentry/bor/config.toml | 2 ++ .../templates/mainnet-v1/sentry/validator/bor/config.toml | 2 ++ .../templates/mainnet-v1/without-sentry/bor/config.toml | 2 ++ packaging/templates/testnet-v4/archive/config.toml | 2 ++ .../templates/testnet-v4/sentry/sentry/bor/config.toml | 2 ++ .../templates/testnet-v4/sentry/validator/bor/config.toml | 2 ++ .../templates/testnet-v4/without-sentry/bor/config.toml | 2 ++ 13 files changed, 32 insertions(+), 8 deletions(-) diff --git a/builder/files/config.toml b/builder/files/config.toml index 0f2919807f..f577706f7b 100644 --- a/builder/files/config.toml +++ b/builder/files/config.toml @@ -8,6 +8,8 @@ chain = "mainnet" datadir = "/var/lib/bor/data" # ancient = "" # keystore = "/var/lib/bor/keystore" +# "rpc.batchlimit" = 100 +# "rpc.returndatalimit" = 100000 syncmode = "full" # gcmode = "full" # snapshot = true diff --git a/docs/cli/example_config.toml b/docs/cli/example_config.toml index 64ef60ae12..6bf58a8361 100644 --- a/docs/cli/example_config.toml +++ b/docs/cli/example_config.toml @@ -8,6 +8,8 @@ log-level = "INFO" # Set log level for the server 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 +"rpc.batchlimit" = 100 # Maximum number of messages in a batch (default=100, use 0 for no limits) +"rpc.returndatalimit" = 100000 # Maximum size (in bytes) a result of an rpc request could have (default=100000, use 0 for no limits) syncmode = "full" # Blockchain sync mode (only "full" sync supported) gcmode = "full" # Blockchain garbage collection mode ("full", "archive") snapshot = true # Enables the snapshot-database mode diff --git a/docs/cli/server.md b/docs/cli/server.md index 5bc0ff1024..caf10070c0 100644 --- a/docs/cli/server.md +++ b/docs/cli/server.md @@ -16,6 +16,10 @@ The ```bor server``` command runs the Bor client. - ```keystore```: Path of the directory where keystores are located +- ```rpc.batchlimit```: Maximum number of messages in a batch (default=100, use 0 for no limits) (default: 100) + +- ```rpc.returndatalimit```: Maximum size (in bytes) a result of an rpc request could have (default=100000, use 0 for no limits) (default: 100000) + - ```config```: File for the config file - ```syncmode```: Blockchain sync mode (only "full" sync supported) (default: full) diff --git a/internal/cli/server/config.go b/internal/cli/server/config.go index 7008dbd99e..e9321bfa01 100644 --- a/internal/cli/server/config.go +++ b/internal/cli/server/config.go @@ -60,11 +60,11 @@ type Config struct { // KeyStoreDir is the directory to store keystores KeyStoreDir string `hcl:"keystore,optional" toml:"keystore,optional"` - // Maximum number of messages in a batch - RPCBatchLimit uint64 `hcl:"rpcbatchlimit,optional" toml:"rpcbatchlimit,optional"` + // Maximum number of messages in a batch (default=100, use 0 for no limits) + RPCBatchLimit uint64 `hcl:"rpc.batchlimit,optional" toml:"rpc.batchlimit,optional"` - // Maximum size (in bytes) a result of an rpc request could have - RPCReturnDataLimit uint64 `hcl:"rpcreturndatalimit,optional" toml:"rpcreturndatalimit,optional"` + // Maximum size (in bytes) a result of an rpc request could have (default=100000, use 0 for no limits) + RPCReturnDataLimit uint64 `hcl:"rpc.returndatalimit,optional" toml:"rpc.returndatalimit,optional"` // SyncMode selects the sync protocol SyncMode string `hcl:"syncmode,optional" toml:"syncmode,optional"` diff --git a/internal/cli/server/flags.go b/internal/cli/server/flags.go index e35d466c34..22d5b73485 100644 --- a/internal/cli/server/flags.go +++ b/internal/cli/server/flags.go @@ -47,14 +47,14 @@ func (c *Command) Flags() *flagset.Flagset { Value: &c.cliConfig.KeyStoreDir, }) f.Uint64Flag(&flagset.Uint64Flag{ - Name: "rpcbatchlimit", - Usage: "Maximum number of messages in a batch", + Name: "rpc.batchlimit", + Usage: "Maximum number of messages in a batch (default=100, use 0 for no limits)", Value: &c.cliConfig.RPCBatchLimit, Default: c.cliConfig.RPCBatchLimit, }) f.Uint64Flag(&flagset.Uint64Flag{ - Name: "rpcreturndatalimit", - Usage: "Maximum number of messages in a batch", + Name: "rpc.returndatalimit", + Usage: "Maximum size (in bytes) a result of an rpc request could have (default=100000, use 0 for no limits)", Value: &c.cliConfig.RPCReturnDataLimit, Default: c.cliConfig.RPCReturnDataLimit, }) diff --git a/packaging/templates/mainnet-v1/archive/config.toml b/packaging/templates/mainnet-v1/archive/config.toml index 9eaafd3bee..8e98736196 100644 --- a/packaging/templates/mainnet-v1/archive/config.toml +++ b/packaging/templates/mainnet-v1/archive/config.toml @@ -4,6 +4,8 @@ chain = "mainnet" datadir = "/var/lib/bor/data" # ancient = "" # keystore = "" +# "rpc.batchlimit" = 100 +# "rpc.returndatalimit" = 100000 syncmode = "full" gcmode = "archive" # snapshot = true diff --git a/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml b/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml index 94dd6634f0..853b2ed313 100644 --- a/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml +++ b/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml @@ -4,6 +4,8 @@ chain = "mainnet" datadir = "/var/lib/bor/data" # ancient = "" # keystore = "" +# "rpc.batchlimit" = 100 +# "rpc.returndatalimit" = 100000 syncmode = "full" # gcmode = "full" # snapshot = true diff --git a/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml b/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml index 9c55683c96..284445113c 100644 --- a/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml +++ b/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml @@ -6,6 +6,8 @@ chain = "mainnet" datadir = "/var/lib/bor/data" # ancient = "" # keystore = "$BOR_DIR/keystore" +# "rpc.batchlimit" = 100 +# "rpc.returndatalimit" = 100000 syncmode = "full" # gcmode = "full" # snapshot = true diff --git a/packaging/templates/mainnet-v1/without-sentry/bor/config.toml b/packaging/templates/mainnet-v1/without-sentry/bor/config.toml index 573f1f3be8..22361b64bc 100644 --- a/packaging/templates/mainnet-v1/without-sentry/bor/config.toml +++ b/packaging/templates/mainnet-v1/without-sentry/bor/config.toml @@ -6,6 +6,8 @@ chain = "mainnet" datadir = "/var/lib/bor/data" # ancient = "" # keystore = "$BOR_DIR/keystore" +# "rpc.batchlimit" = 100 +# "rpc.returndatalimit" = 100000 syncmode = "full" # gcmode = "full" # snapshot = true diff --git a/packaging/templates/testnet-v4/archive/config.toml b/packaging/templates/testnet-v4/archive/config.toml index 1762fdf117..992aff0c68 100644 --- a/packaging/templates/testnet-v4/archive/config.toml +++ b/packaging/templates/testnet-v4/archive/config.toml @@ -4,6 +4,8 @@ chain = "mumbai" datadir = "/var/lib/bor/data" # ancient = "" # keystore = "" +# "rpc.batchlimit" = 100 +# "rpc.returndatalimit" = 100000 syncmode = "full" gcmode = "archive" # snapshot = true diff --git a/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml b/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml index ae191cec2c..1a335a42a3 100644 --- a/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml +++ b/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml @@ -4,6 +4,8 @@ chain = "mumbai" datadir = "/var/lib/bor/data" # ancient = "" # keystore = "" +# "rpc.batchlimit" = 100 +# "rpc.returndatalimit" = 100000 syncmode = "full" # gcmode = "full" # snapshot = true diff --git a/packaging/templates/testnet-v4/sentry/validator/bor/config.toml b/packaging/templates/testnet-v4/sentry/validator/bor/config.toml index b441cc137d..798375364e 100644 --- a/packaging/templates/testnet-v4/sentry/validator/bor/config.toml +++ b/packaging/templates/testnet-v4/sentry/validator/bor/config.toml @@ -6,6 +6,8 @@ chain = "mumbai" datadir = "/var/lib/bor/data" # ancient = "" # keystore = "$BOR_DIR/keystore" +# "rpc.batchlimit" = 100 +# "rpc.returndatalimit" = 100000 syncmode = "full" # gcmode = "full" # snapshot = true diff --git a/packaging/templates/testnet-v4/without-sentry/bor/config.toml b/packaging/templates/testnet-v4/without-sentry/bor/config.toml index 05a254e184..47a3053b58 100644 --- a/packaging/templates/testnet-v4/without-sentry/bor/config.toml +++ b/packaging/templates/testnet-v4/without-sentry/bor/config.toml @@ -6,6 +6,8 @@ chain = "mumbai" datadir = "/var/lib/bor/data" # ancient = "" # keystore = "$BOR_DIR/keystore" +# "rpc.batchlimit" = 100 +# "rpc.returndatalimit" = 100000 syncmode = "full" # gcmode = "full" # snapshot = true