multi: add rpcpolling config options

This commit is contained in:
Orbital authored and Elle Mouton committed 2022-05-11 09:02:13 +02:00
1 parent 0459ccf542
commit 7509af1a70
3 files changed
+37 -8

No files matched your search

+18 -8
View File
@@ -399,21 +399,31 @@ func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) {
} }
} }
// Establish the connection to bitcoind and create the clients bitcoindCfg := &chain.BitcoindConfig{
// required for our relevant subsystems.
bitcoindConn, err := chain.NewBitcoindConn(&chain.BitcoindConfig{
ChainParams: cfg.ActiveNetParams.Params, ChainParams: cfg.ActiveNetParams.Params,
Host: bitcoindHost, Host: bitcoindHost,
User: bitcoindMode.RPCUser, User: bitcoindMode.RPCUser,
Pass: bitcoindMode.RPCPass, Pass: bitcoindMode.RPCPass,
ZMQConfig: &chain.ZMQConfig{ Dialer: cfg.Dialer,
PrunedModeMaxPeers: bitcoindMode.PrunedNodeMaxPeers,
}
if bitcoindMode.RPCPolling {
bitcoindCfg.PollingConfig = &chain.PollingConfig{
BlockPollingInterval: bitcoindMode.BlockPollingInterval,
TxPollingInterval: bitcoindMode.TxPollingInterval,
}
} else {
bitcoindCfg.ZMQConfig = &chain.ZMQConfig{
ZMQBlockHost: bitcoindMode.ZMQPubRawBlock, ZMQBlockHost: bitcoindMode.ZMQPubRawBlock,
ZMQTxHost: bitcoindMode.ZMQPubRawTx, ZMQTxHost: bitcoindMode.ZMQPubRawTx,
ZMQReadDeadline: bitcoindMode.ZMQReadDeadline, ZMQReadDeadline: bitcoindMode.ZMQReadDeadline,
}, }
Dialer: cfg.Dialer, }
PrunedModeMaxPeers: bitcoindMode.PrunedNodeMaxPeers,
}) // Establish the connection to bitcoind and create the clients
// required for our relevant subsystems.
bitcoindConn, err := chain.NewBitcoindConn(bitcoindCfg)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
+3
View File
@@ -16,4 +16,7 @@ type Bitcoind struct {
ZMQReadDeadline time.Duration `long:"zmqreaddeadline" description:"The read deadline for reading ZMQ messages from both the block and tx subscriptions"` ZMQReadDeadline time.Duration `long:"zmqreaddeadline" description:"The read deadline for reading ZMQ messages from both the block and tx subscriptions"`
EstimateMode string `long:"estimatemode" description:"The fee estimate mode. Must be either ECONOMICAL or CONSERVATIVE."` EstimateMode string `long:"estimatemode" description:"The fee estimate mode. Must be either ECONOMICAL or CONSERVATIVE."`
PrunedNodeMaxPeers int `long:"pruned-node-max-peers" description:"The maximum number of peers lnd will choose from the backend node to retrieve pruned blocks from. This only applies to pruned nodes."` PrunedNodeMaxPeers int `long:"pruned-node-max-peers" description:"The maximum number of peers lnd will choose from the backend node to retrieve pruned blocks from. This only applies to pruned nodes."`
RPCPolling bool `long:"rpcpolling" description:"Poll the bitcoind RPC interface for block and transaction notifications instead of using the ZMQ interface"`
BlockPollingInterval time.Duration `long:"blockpollinginterval" description:"The interval that will be used to poll bitcoind for new blocks. Only used if rpcpolling is true."`
TxPollingInterval time.Duration `long:"txpollinginterval" description:"The interval that will be used to poll bitcoind for new tx. Only used if rpcpolling is true."`
} }
+16
View File
@@ -606,6 +606,14 @@ bitcoin.node=btcd
; bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333 ; bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
; bitcoind.zmqreaddeadline=10s ; bitcoind.zmqreaddeadline=10s
; Use bitcoind's rpc interface to get block and transaction notifications
; instead of using the zmq interface. Only the rpcpolling option needs to
; be set in order to enable this, the rest of the options can be used to
; change the default values used for this configuration.
; bitcoind.rpcpolling
; bitcoind.blockpollinginterval=1m
; bitcoind.txpollinginterval=30s
; Fee estimate mode for bitcoind. It must be either "ECONOMICAL" or "CONSERVATIVE". ; Fee estimate mode for bitcoind. It must be either "ECONOMICAL" or "CONSERVATIVE".
; If unset, the default value is "CONSERVATIVE". ; If unset, the default value is "CONSERVATIVE".
; bitcoind.estimatemode=CONSERVATIVE ; bitcoind.estimatemode=CONSERVATIVE
@@ -814,6 +822,14 @@ litecoin.node=ltcd
; litecoind.zmqpubrawtx=tcp://127.0.0.1:28333 ; litecoind.zmqpubrawtx=tcp://127.0.0.1:28333
; litecoind.zmqreaddeadline=10s ; litecoind.zmqreaddeadline=10s
; Use litecoind's rpc interface to get block and transaction notifications
; instead of using the zmq interface. Only the rpcpolling option needs to
; be set in order to enable this, the rest of the options can be used to
; change the default values used for this configuration.
; litecoind.rpcpolling
; litecoind.blockpollinginterval=1m
; litecoind.txpollinginterval=30s
; Fee estimate mode for litecoind. It must be either "ECONOMICAL" or "CONSERVATIVE". ; Fee estimate mode for litecoind. It must be either "ECONOMICAL" or "CONSERVATIVE".
; If unset, the default value is "CONSERVATIVE". ; If unset, the default value is "CONSERVATIVE".
; litecoind.estimatemode=CONSERVATIVE ; litecoind.estimatemode=CONSERVATIVE