Improve configurability
MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -158,7 +158,9 @@ namespace WalletWasabi.Gui
// tryRestart: false,
// tryDeleteDataDir: false,
// EndPointStrategy.Custom(Config.GetBitcoinP2pEndPoint()),
- // EndPointStrategy.Default(Network, EndPointType.Rpc)));
+ // EndPointStrategy.Default(Network, EndPointType.Rpc),
+ // txIndex: null,
+ // prune: null)));
var blocksFolderPath = Path.Combine(DataDir, $"Blocks{Network}");
var connectionParameters = new NodeConnectionParameters { UserAgent = "/Satoshi:0.18.1/" };

MODIFY
WalletWasabi.Tests/Helpers/TestNodeBuilder.cs
WalletWasabi.Tests/Helpers/TestNodeBuilder.cs
@@ -20,6 +20,8 @@ namespace WalletWasabi.Tests.Helpers
tryRestart: true,
tryDeleteDataDir: true,
EndPointStrategy.Random,
- EndPointStrategy.Random));
+ EndPointStrategy.Random,
+ txIndex: 1,
+ prune: 0));
}
}

MODIFY
WalletWasabi/BitcoinCore/CoreNode.cs
WalletWasabi/BitcoinCore/CoreNode.cs
@@ -107,7 +107,6 @@ namespace WalletWasabi.BitcoinCore
var desiredConfigLines = new List<string>()
{
$"{configPrefix}.server = 1",
- $"{configPrefix}.txindex = 1",
$"{configPrefix}.whitebind = {coreNode.P2pEndPoint.ToString(coreNode.Network.DefaultPort)}",
$"{configPrefix}.rpcuser = {coreNode.RpcClient.CredentialString.UserPassword.UserName}",
$"{configPrefix}.rpcpassword = {coreNode.RpcClient.CredentialString.UserPassword.Password}",
@@ -115,6 +114,16 @@ namespace WalletWasabi.BitcoinCore
$"{configPrefix}.rpcport = {coreNode.RpcEndPoint.GetPortOrDefault()}"
};
+ if (coreNodeParams.TxIndex != null)
+ {
+ desiredConfigLines.Add($"{configPrefix}.txindex = {coreNodeParams.TxIndex}");
+ }
+
+ if (coreNodeParams.Prune != null)
+ {
+ desiredConfigLines.Add($"{configPrefix}.prune = {coreNodeParams.Prune}");
+ }
+
var sectionComment = $"# The following configuration options were added or modified by Wasabi Wallet.";
// If the comment is not already present.
// And there would be new config entries added.

MODIFY
WalletWasabi/BitcoinCore/CoreNodeParams.cs
WalletWasabi/BitcoinCore/CoreNodeParams.cs
@@ -15,7 +15,9 @@ namespace WalletWasabi.BitcoinCore
bool tryRestart,
bool tryDeleteDataDir,
EndPointStrategy p2pEndPointStrategy,
- EndPointStrategy rpcEndPointStrategy)
+ EndPointStrategy rpcEndPointStrategy,
+ int? txIndex,
+ int? prune)
{
Network = Guard.NotNull(nameof(network), network);
DataDir = Guard.NotNullOrEmptyOrWhitespace(nameof(dataDir), dataDir);
@@ -23,12 +25,16 @@ namespace WalletWasabi.BitcoinCore
TryDeleteDataDir = tryDeleteDataDir;
P2pEndPointStrategy = Guard.NotNull(nameof(p2pEndPointStrategy), p2pEndPointStrategy);
RpcEndPointStrategy = Guard.NotNull(nameof(rpcEndPointStrategy), rpcEndPointStrategy);
+ TxIndex = txIndex;
+ Prune = prune;
}
public string DataDir { get; }
public Network Network { get; }
public bool TryRestart { get; }
public bool TryDeleteDataDir { get; }
+ public int? TxIndex { get; }
+ public int? Prune { get; }
public EndPointStrategy P2pEndPointStrategy { get; }
public EndPointStrategy RpcEndPointStrategy { get; }
}

Improve configurability