mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-08 14:57:38 +02:00
lntest/unittest: update config for miner and bitcoind
The config used for the miner is updated to skip banning and debug. For bitcoind, the config is updated to use a unique port for P2P conn.
This commit is contained in:
@@ -37,9 +37,15 @@ func NewMiner(t *testing.T, netParams *chaincfg.Params, extraArgs []string,
|
|||||||
|
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
// Add the trickle interval argument to the extra args.
|
args := []string{
|
||||||
trickle := fmt.Sprintf("--trickleinterval=%v", TrickleInterval)
|
"--nobanning",
|
||||||
extraArgs = append(extraArgs, trickle)
|
"--debuglevel=debug",
|
||||||
|
fmt.Sprintf("--trickleinterval=%v", TrickleInterval),
|
||||||
|
|
||||||
|
// Don't disconnect if a reply takes too long.
|
||||||
|
"--nostalldetect",
|
||||||
|
}
|
||||||
|
extraArgs = append(extraArgs, args...)
|
||||||
|
|
||||||
node, err := rpctest.New(netParams, nil, extraArgs, "")
|
node, err := rpctest.New(netParams, nil, extraArgs, "")
|
||||||
require.NoError(t, err, "unable to create backend node")
|
require.NoError(t, err, "unable to create backend node")
|
||||||
@@ -88,6 +94,11 @@ func NewBitcoindBackend(t *testing.T, netParams *chaincfg.Params,
|
|||||||
zmqBlockHost := fmt.Sprintf("tcp://127.0.0.1:%d", zmqBlockPort)
|
zmqBlockHost := fmt.Sprintf("tcp://127.0.0.1:%d", zmqBlockPort)
|
||||||
zmqTxHost := fmt.Sprintf("tcp://127.0.0.1:%d", zmqTxPort)
|
zmqTxHost := fmt.Sprintf("tcp://127.0.0.1:%d", zmqTxPort)
|
||||||
|
|
||||||
|
// TODO(yy): Make this configurable via `chain.BitcoindConfig` and
|
||||||
|
// replace the default P2P port when set.
|
||||||
|
p2pPort := port.NextAvailablePort()
|
||||||
|
netParams.DefaultPort = fmt.Sprintf("%d", p2pPort)
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
"-connect=" + minerAddr,
|
"-connect=" + minerAddr,
|
||||||
"-datadir=" + tempBitcoindDir,
|
"-datadir=" + tempBitcoindDir,
|
||||||
@@ -96,6 +107,7 @@ func NewBitcoindBackend(t *testing.T, netParams *chaincfg.Params,
|
|||||||
"284294edb5773b05544b220110063096c221be9933c82d38e1",
|
"284294edb5773b05544b220110063096c221be9933c82d38e1",
|
||||||
fmt.Sprintf("-rpcport=%d", rpcPort),
|
fmt.Sprintf("-rpcport=%d", rpcPort),
|
||||||
fmt.Sprintf("-bind=127.0.0.1:%d=onion", torBindPort),
|
fmt.Sprintf("-bind=127.0.0.1:%d=onion", torBindPort),
|
||||||
|
fmt.Sprintf("-port=%d", p2pPort),
|
||||||
"-disablewallet",
|
"-disablewallet",
|
||||||
"-zmqpubrawblock=" + zmqBlockHost,
|
"-zmqpubrawblock=" + zmqBlockHost,
|
||||||
"-zmqpubrawtx=" + zmqTxHost,
|
"-zmqpubrawtx=" + zmqTxHost,
|
||||||
|
Reference in New Issue
Block a user