mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-18 21:35:24 +01:00
etcd: make max message size configurable
This commit is contained in:
parent
8d3fec35fe
commit
1ccc5e8014
2
go.mod
2
go.mod
@ -46,7 +46,7 @@ require (
|
||||
github.com/lightningnetwork/lnd/cert v1.1.0
|
||||
github.com/lightningnetwork/lnd/clock v1.1.0
|
||||
github.com/lightningnetwork/lnd/healthcheck v1.2.0
|
||||
github.com/lightningnetwork/lnd/kvdb v1.2.1
|
||||
github.com/lightningnetwork/lnd/kvdb v1.2.3
|
||||
github.com/lightningnetwork/lnd/queue v1.1.0
|
||||
github.com/lightningnetwork/lnd/ticker v1.1.0
|
||||
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796
|
||||
|
@ -30,6 +30,8 @@ type Config struct {
|
||||
|
||||
CollectStats bool `long:"collect_stats" description:"Whether to collect etcd commit stats."`
|
||||
|
||||
MaxMsgSize int `long:"max_msg_size" description:"The maximum message size in bytes that we may send to etcd."`
|
||||
|
||||
// SingleWriter should be set to true if we intend to only allow a
|
||||
// single writer to the database at a time.
|
||||
SingleWriter bool
|
||||
|
@ -141,7 +141,7 @@ func newEtcdBackend(ctx context.Context, cfg Config) (*db, error) {
|
||||
DialTimeout: etcdConnectionTimeout,
|
||||
Username: cfg.User,
|
||||
Password: cfg.Pass,
|
||||
MaxCallSendMsgSize: 16384*1024 - 1,
|
||||
MaxCallSendMsgSize: cfg.MaxMsgSize,
|
||||
}
|
||||
|
||||
if !cfg.DisableTLS {
|
||||
|
@ -73,6 +73,10 @@ func DefaultDB() *DB {
|
||||
AutoCompactMinAge: kvdb.DefaultBoltAutoCompactMinAge,
|
||||
DBTimeout: kvdb.DefaultDBTimeout,
|
||||
},
|
||||
Etcd: &etcd.Config{
|
||||
// Allow at most 32 MiB messages by default.
|
||||
MaxMsgSize: 32768 * 1024,
|
||||
},
|
||||
Postgres: &postgres.Config{
|
||||
MaxConnections: defaultPostgresMaxConnections,
|
||||
},
|
||||
|
@ -1169,6 +1169,9 @@ litecoin.node=ltcd
|
||||
; testing with embedded etcd.
|
||||
; db.etcd.embedded_log_file=/path/etcd.log
|
||||
|
||||
; The maximum message size in bytes that we may send to etcd. Defaults to 32 MiB.
|
||||
; db.etcd.max_msg_size=33554432
|
||||
|
||||
[postgres]
|
||||
; Postgres connection string.
|
||||
; db.postgres.dsn=postgres://lnd:lnd@localhost:45432/lnd?sslmode=disable
|
||||
|
Loading…
Reference in New Issue
Block a user