lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.64k stars 2.07k forks source link

[bug]: expected network TestNet, got TestNet3 #7198

Closed benthecarman closed 1 year ago

benthecarman commented 1 year ago

Background

Cannot create an lnd regtest wallet. I get the error unable to create partial chain control: expected network TestNet, got TestNet3

Your environment

Steps to reproduce

Every start up I get this error, I also have a lnd testnet node running as well.

guggero commented 1 year ago

Could you please be a bit more specific on what flags/configs you're using? Creating regtest wallets work very well for me.

benthecarman commented 1 year ago

my config:

[Application Options]
debuglevel=debug
maxpendingchannels=10
alias=benthecarman-testnet
color=#f2a900

noseedbackup=true

listen=0.0.0.0:9735

# allow requests from docker
tlsextradomain=host.docker.internal
tlsextradomain=host-gateway

# RPC open to all connections on Port 10009
#rpclisten=0.0.0.0:10009

norest=true

accept-amp=true
accept-keysend=true
protocol.wumbo-channels=true
#protocol.option-scid-alias=true
minchansize=10000

coin-selection-strategy=random

#########################
# Improve startup speed # 
#########################
# If true, we'll attempt to garbage collect canceled invoices upon start.
gc-canceled-invoices-on-startup=true
# If true, we'll delete newly canceled invoices on the fly.
gc-canceled-invoices-on-the-fly=true
# Avoid historical graph data sync
ignore-historical-gossip-filters=1

# This will help our node start up faster by applying randomized
# staggering when reconnecting to persistent peers.
# This minimizes the chance of connecting to all non-responsive peers at once.
sync-freelist=1
stagger-initial-reconnect=1

# Our routing node will not need historical gossip data, so we can ignore it.
ignore-historical-gossip-filters=1

max-channel-fee-allocation=1.0

# 5000/144 = 34.7 days
max-cltv-expiry=5000

[bolt]
# Enable database compaction when restarting
db.bolt.auto-compact=true

[Bitcoin]
bitcoin.active=1
bitcoin.node=bitcoind
#bitcoin.mainnet=true
#bitcoin.testnet=true
bitcoin.regtest=true
bitcoin.defaultchanconfs=1

[Bitcoind]
bitcoind.rpcuser=xx
bitcoind.rpcpass=xx
bitcoind.rpchost=127.0.0.1
bitcoind.rpcpolling=1

[autopilot]
autopilot.active=0
autopilot.maxchannels=0
autopilot.allocation=0.6

[Watchtower]
watchtower.active=1

[Wtclient]
wtclient.active=1

[db]
db.prune-revocation=true

[tor]
#tor.active=true
tor.socks=9050
tor.skip-proxy-for-clearnet-targets=1
guggero commented 1 year ago

Even though the error is a bit misleading, it sounds to me like you're connecting to the testnet bitcoind instead of the regtest one. Or some port got mixed up.

benthecarman commented 1 year ago

Yeah, changing to bitcoind.rpchost=127.0.0.1:18443 seemed to fix, weird that it was trying to connect to testnet. Maybe there is a bug around that?

guggero commented 1 year ago

Yeah, I think that's a long-standing (and IMO incorrect) config in the btcd chain parameters library that regtest and testnet use the same default port. Not sure if it can easily be fixed without breaking backward compatibility though.