multi: add rpcpolling config options
This commit is contained in:
1 parent
0459ccf542
commit
7509af1a70
3 files changed
+52
-23
No files matched your search
+22
-12
@@ -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.
|
ChainParams: cfg.ActiveNetParams.Params,
|
||||||
bitcoindConn, err := chain.NewBitcoindConn(&chain.BitcoindConfig{
|
Host: bitcoindHost,
|
||||||
ChainParams: cfg.ActiveNetParams.Params,
|
User: bitcoindMode.RPCUser,
|
||||||
Host: bitcoindHost,
|
Pass: bitcoindMode.RPCPass,
|
||||||
User: bitcoindMode.RPCUser,
|
Dialer: cfg.Dialer,
|
||||||
Pass: bitcoindMode.RPCPass,
|
PrunedModeMaxPeers: bitcoindMode.PrunedNodeMaxPeers,
|
||||||
ZMQConfig: &chain.ZMQConfig{
|
}
|
||||||
|
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-11
@@ -5,15 +5,18 @@ import "time"
|
|||||||
// Bitcoind holds the configuration options for the daemon's connection to
|
// Bitcoind holds the configuration options for the daemon's connection to
|
||||||
// bitcoind.
|
// bitcoind.
|
||||||
type Bitcoind struct {
|
type Bitcoind struct {
|
||||||
Dir string `long:"dir" description:"The base directory that contains the node's data, logs, configuration file, etc."`
|
Dir string `long:"dir" description:"The base directory that contains the node's data, logs, configuration file, etc."`
|
||||||
ConfigPath string `long:"config" description:"Configuration filepath. If not set, will default to the default filename under 'dir'."`
|
ConfigPath string `long:"config" description:"Configuration filepath. If not set, will default to the default filename under 'dir'."`
|
||||||
RPCCookie string `long:"rpccookie" description:"Authentication cookie file for RPC connections. If not set, will default to .cookie under 'dir'."`
|
RPCCookie string `long:"rpccookie" description:"Authentication cookie file for RPC connections. If not set, will default to .cookie under 'dir'."`
|
||||||
RPCHost string `long:"rpchost" description:"The daemon's rpc listening address. If a port is omitted, then the default port for the selected chain parameters will be used."`
|
RPCHost string `long:"rpchost" description:"The daemon's rpc listening address. If a port is omitted, then the default port for the selected chain parameters will be used."`
|
||||||
RPCUser string `long:"rpcuser" description:"Username for RPC connections"`
|
RPCUser string `long:"rpcuser" description:"Username for RPC connections"`
|
||||||
RPCPass string `long:"rpcpass" default-mask:"-" description:"Password for RPC connections"`
|
RPCPass string `long:"rpcpass" default-mask:"-" description:"Password for RPC connections"`
|
||||||
ZMQPubRawBlock string `long:"zmqpubrawblock" description:"The address listening for ZMQ connections to deliver raw block notifications"`
|
ZMQPubRawBlock string `long:"zmqpubrawblock" description:"The address listening for ZMQ connections to deliver raw block notifications"`
|
||||||
ZMQPubRawTx string `long:"zmqpubrawtx" description:"The address listening for ZMQ connections to deliver raw transaction notifications"`
|
ZMQPubRawTx string `long:"zmqpubrawtx" description:"The address listening for ZMQ connections to deliver raw transaction notifications"`
|
||||||
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."`
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in new issue
Block a user