mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-22 14:33:06 +01:00
Remove bitcoind as a dep for lnd (#4703)
This commit is contained in:
parent
38725f0155
commit
1758197d58
3 changed files with 2 additions and 34 deletions
|
@ -136,7 +136,7 @@ lazy val eclairRpc = project
|
||||||
lazy val lndRpc = project
|
lazy val lndRpc = project
|
||||||
.in(file("lnd-rpc"))
|
.in(file("lnd-rpc"))
|
||||||
.settings(CommonSettings.prodSettings: _*)
|
.settings(CommonSettings.prodSettings: _*)
|
||||||
.dependsOn(asyncUtilsJVM, bitcoindRpc)
|
.dependsOn(asyncUtilsJVM, appCommons)
|
||||||
|
|
||||||
lazy val clightningRpc = project
|
lazy val clightningRpc = project
|
||||||
.in(file("clightning-rpc"))
|
.in(file("clightning-rpc"))
|
||||||
|
|
|
@ -3,12 +3,10 @@ package org.bitcoins.lnd.rpc.config
|
||||||
import grizzled.slf4j.Logging
|
import grizzled.slf4j.Logging
|
||||||
import org.bitcoins.core.api.commons.ConfigFactory
|
import org.bitcoins.core.api.commons.ConfigFactory
|
||||||
import org.bitcoins.core.config._
|
import org.bitcoins.core.config._
|
||||||
import org.bitcoins.rpc.config.BitcoindAuthCredentials.PasswordBased
|
|
||||||
import org.bitcoins.rpc.config.ZmqConfig
|
|
||||||
import scodec.bits.ByteVector
|
import scodec.bits.ByteVector
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.net.{InetSocketAddress, URI}
|
import java.net.URI
|
||||||
import java.nio.file.{Files, Path, Paths}
|
import java.nio.file.{Files, Path, Paths}
|
||||||
import scala.util.Properties
|
import scala.util.Properties
|
||||||
|
|
||||||
|
@ -97,15 +95,6 @@ case class LndConfig(private[bitcoins] val lines: Seq[String], datadir: File)
|
||||||
}.headOption
|
}.headOption
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Converts a string to an InetSocketAddress */
|
|
||||||
private def toInetSocketAddress(string: String): InetSocketAddress = {
|
|
||||||
val uri = new URI(string)
|
|
||||||
new InetSocketAddress(uri.getHost, uri.getPort)
|
|
||||||
}
|
|
||||||
|
|
||||||
lazy val bitcoindUser: String = getValue("bitcoind.rpcuser").get
|
|
||||||
lazy val bitcoindPass: String = getValue("bitcoind.rpcpass").get
|
|
||||||
|
|
||||||
lazy val listenBinding: URI = new URI({
|
lazy val listenBinding: URI = new URI({
|
||||||
val baseUrl = getValue("listen").getOrElse("127.0.0.1:9735")
|
val baseUrl = getValue("listen").getOrElse("127.0.0.1:9735")
|
||||||
if (baseUrl.startsWith("http")) baseUrl
|
if (baseUrl.startsWith("http")) baseUrl
|
||||||
|
@ -124,19 +113,6 @@ case class LndConfig(private[bitcoins] val lines: Seq[String], datadir: File)
|
||||||
else "http://" + baseUrl
|
else "http://" + baseUrl
|
||||||
})
|
})
|
||||||
|
|
||||||
lazy val bitcoindBinding: URI = new URI({
|
|
||||||
val baseUrl =
|
|
||||||
getValue("bitcoind.rpchost").getOrElse(s"127.0.0.1:${network.rpcPort}")
|
|
||||||
if (baseUrl.startsWith("http")) baseUrl
|
|
||||||
else "http://" + baseUrl
|
|
||||||
})
|
|
||||||
|
|
||||||
lazy val zmqpubrawblock: Option[InetSocketAddress] =
|
|
||||||
getValue("bitcoind.zmqpubrawblock").map(toInetSocketAddress)
|
|
||||||
|
|
||||||
lazy val zmqpubrawtx: Option[InetSocketAddress] =
|
|
||||||
getValue("bitcoind.zmqpubrawtx").map(toInetSocketAddress)
|
|
||||||
|
|
||||||
lazy val debuglevel: LogLevel = getValue("debuglevel")
|
lazy val debuglevel: LogLevel = getValue("debuglevel")
|
||||||
.flatMap(LogLevel.fromStringOpt)
|
.flatMap(LogLevel.fromStringOpt)
|
||||||
.getOrElse(LogLevel.Debug)
|
.getOrElse(LogLevel.Debug)
|
||||||
|
@ -164,9 +140,6 @@ case class LndConfig(private[bitcoins] val lines: Seq[String], datadir: File)
|
||||||
listenBinding,
|
listenBinding,
|
||||||
restBinding,
|
restBinding,
|
||||||
rpcBinding,
|
rpcBinding,
|
||||||
PasswordBased(bitcoindUser, bitcoindPass),
|
|
||||||
bitcoindBinding,
|
|
||||||
ZmqConfig(rawBlock = zmqpubrawblock, rawTx = zmqpubrawtx),
|
|
||||||
debuglevel
|
debuglevel
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ package org.bitcoins.lnd.rpc.config
|
||||||
import akka.actor.ActorSystem
|
import akka.actor.ActorSystem
|
||||||
import org.bitcoins.core.api.commons.InstanceFactoryLocal
|
import org.bitcoins.core.api.commons.InstanceFactoryLocal
|
||||||
import org.bitcoins.core.config._
|
import org.bitcoins.core.config._
|
||||||
import org.bitcoins.rpc.config.BitcoindAuthCredentials._
|
|
||||||
import org.bitcoins.rpc.config._
|
|
||||||
import scodec.bits._
|
import scodec.bits._
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
@ -25,9 +23,6 @@ case class LndInstanceLocal(
|
||||||
listenBinding: URI,
|
listenBinding: URI,
|
||||||
restUri: URI,
|
restUri: URI,
|
||||||
rpcUri: URI,
|
rpcUri: URI,
|
||||||
bitcoindAuthCredentials: PasswordBased,
|
|
||||||
bitcoindRpcUri: URI,
|
|
||||||
zmqConfig: ZmqConfig,
|
|
||||||
debugLevel: LogLevel)
|
debugLevel: LogLevel)
|
||||||
extends LndInstance {
|
extends LndInstance {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue