mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Add handling so test lnd clients can be reached by docker (#4729)
* Add handling to test lnd clients can be reached by docker * Subsitute during config construction instead in call credentials
This commit is contained in:
parent
26595ab3ac
commit
8bbfbc89d7
@ -101,11 +101,20 @@ case class LndConfig(private[bitcoins] val lines: Seq[String], datadir: File)
|
||||
else "http://" + baseUrl
|
||||
})
|
||||
|
||||
lazy val rpcBinding: URI = new URI({
|
||||
val baseUrl = getValue("rpclisten").getOrElse("127.0.0.1:10009")
|
||||
if (baseUrl.startsWith("http")) baseUrl
|
||||
else "http://" + baseUrl
|
||||
})
|
||||
lazy val rpcBinding: URI = {
|
||||
val uri = new URI({
|
||||
val baseUrl = getValue("rpclisten").getOrElse("127.0.0.1:10009")
|
||||
if (baseUrl.startsWith("http")) baseUrl
|
||||
else "http://" + baseUrl
|
||||
})
|
||||
|
||||
// if our local lnd is bound to 0.0.0.0
|
||||
// then we can just make requests to localhost
|
||||
if (uri.getHost == "0.0.0.0") {
|
||||
logger.warn("lnd rpc is bound to 0.0.0.0, using localhost instead")
|
||||
new URI(s"http://127.0.0.1:${uri.getPort}")
|
||||
} else uri
|
||||
}
|
||||
|
||||
lazy val restBinding: URI = new URI({
|
||||
val baseUrl = getValue("restlisten").getOrElse("127.0.0.1:8080")
|
||||
|
@ -79,7 +79,12 @@ trait LndRpcTestUtil extends Logging {
|
||||
|historicalsyncinterval=1s
|
||||
|trickledelay=1000
|
||||
|listen=127.0.0.1:$port
|
||||
|rpclisten=127.0.0.1:$rpcPort
|
||||
|
|
||||
|# allow requests from docker containers
|
||||
|tlsextradomain=host.docker.internal
|
||||
|tlsextradomain=host-gateway
|
||||
|rpclisten=0.0.0.0:$rpcPort
|
||||
|
|
||||
|externalip=127.0.0.1
|
||||
|maxpendingchannels=10
|
||||
|bitcoind.rpcuser = ${bitcoindInstance.authCredentials
|
||||
|
Loading…
Reference in New Issue
Block a user