Skip to content

Commit

Permalink
Remove Electrum support (#1750)
Browse files Browse the repository at this point in the history
Electrum support was provided for mobile wallets, server nodes should always
run a bitcoind node as this provides more control (especially for utxo
management for anchor outputs channels).

Since wallets will use /~https://github.com/acinq/eclair-kmp instead of eclair,
we can now remove Electrum and API fee providers from eclair.

We also removed 3rd-party fee API providers that were only used on wallets.
  • Loading branch information
t-bast authored Apr 2, 2021
1 parent 5729b28 commit 89d2489
Show file tree
Hide file tree
Showing 41 changed files with 121 additions and 10,105 deletions.
1,230 changes: 0 additions & 1,230 deletions eclair-core/src/main/resources/electrum/checkpoints_mainnet.json

This file was deleted.

3,306 changes: 0 additions & 3,306 deletions eclair-core/src/main/resources/electrum/checkpoints_testnet.json

This file was deleted.

108 changes: 0 additions & 108 deletions eclair-core/src/main/resources/electrum/servers_mainnet.json

This file was deleted.

10 changes: 0 additions & 10 deletions eclair-core/src/main/resources/electrum/servers_regtest.json

This file was deleted.

38 changes: 0 additions & 38 deletions eclair-core/src/main/resources/electrum/servers_testnet.json

This file was deleted.

2 changes: 0 additions & 2 deletions eclair-core/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ eclair {
// override this with a script/exe that will be called everytime a new database backup has been created
# backup-notify-script = "/absolute/path/to/script.sh"

watcher-type = "bitcoind" // other *experimental* values include "electrum"
watch-spent-window = 1 minute // at startup watches will be put back within that window to reduce herd effect; must be > 0s

bitcoind {
Expand Down Expand Up @@ -91,7 +90,6 @@ eclair {
on-chain-fees {
min-feerate = 1 // minimum feerate in satoshis per byte
smoothing-window = 6 // 1 = no smoothing
provider-timeout = 5 seconds // max time we'll wait for answers from a fee provider before we fallback to the next one

default-feerates { // those are per target block, in satoshis per kilobyte
1 = 210000
Expand Down
15 changes: 3 additions & 12 deletions eclair-core/src/main/scala/fr/acinq/eclair/NodeParams.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package fr.acinq.eclair
import com.typesafe.config.{Config, ConfigFactory, ConfigValueType}
import fr.acinq.bitcoin.Crypto.PublicKey
import fr.acinq.bitcoin.{Block, ByteVector32, Crypto, Satoshi}
import fr.acinq.eclair.NodeParams.WatcherType
import fr.acinq.eclair.Setup.Seeds
import fr.acinq.eclair.blockchain.fee._
import fr.acinq.eclair.channel.Channel
Expand Down Expand Up @@ -79,7 +78,6 @@ case class NodeParams(nodeKeyManager: NodeKeyManager,
maxReconnectInterval: FiniteDuration,
chainHash: ByteVector32,
channelFlags: Byte,
watcherType: WatcherType,
watchSpentWindow: FiniteDuration,
paymentRequestExpiry: FiniteDuration,
multiPartPaymentExpiry: FiniteDuration,
Expand Down Expand Up @@ -110,11 +108,10 @@ case class NodeParams(nodeKeyManager: NodeKeyManager,

object NodeParams extends Logging {

// @formatter:off
sealed trait WatcherType

object BITCOIND extends WatcherType

object ELECTRUM extends WatcherType
// @formatter:on

/**
* Order of precedence for the configuration parameters:
Expand All @@ -123,7 +120,7 @@ object NodeParams extends Logging {
* 3) Optionally provided config
* 4) Default values in reference.conf
*/
def loadConfiguration(datadir: File) =
def loadConfiguration(datadir: File): Config =
ConfigFactory.parseProperties(System.getProperties)
.withFallback(ConfigFactory.parseFile(new File(datadir, "eclair.conf")))
.withFallback(ConfigFactory.load())
Expand Down Expand Up @@ -214,11 +211,6 @@ object NodeParams extends Logging {
val color = ByteVector.fromValidHex(config.getString("node-color"))
require(color.size == 3, "color should be a 3-bytes hex buffer")

val watcherType = config.getString("watcher-type") match {
case "electrum" => ELECTRUM
case _ => BITCOIND
}

val watchSpentWindow = FiniteDuration(config.getDuration("watch-spent-window").getSeconds, TimeUnit.SECONDS)
require(watchSpentWindow > 0.seconds, "watch-spent-window must be strictly greater than 0")

Expand Down Expand Up @@ -364,7 +356,6 @@ object NodeParams extends Logging {
maxReconnectInterval = FiniteDuration(config.getDuration("max-reconnect-interval").getSeconds, TimeUnit.SECONDS),
chainHash = chainHash,
channelFlags = config.getInt("channel-flags").toByte,
watcherType = watcherType,
watchSpentWindow = watchSpentWindow,
paymentRequestExpiry = FiniteDuration(config.getDuration("payment-request-expiry").getSeconds, TimeUnit.SECONDS),
multiPartPaymentExpiry = FiniteDuration(config.getDuration("multi-part-payment-expiry").getSeconds, TimeUnit.SECONDS),
Expand Down
Loading

0 comments on commit 89d2489

Please sign in to comment.