support local, stagenet, and mainnet xmr network configuration (#335)

remove btc wallet
disable local zmq
This commit is contained in:
woodser 2022-07-07 09:10:59 -04:00 committed by GitHub
parent b4112e50e9
commit e2208355b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 595 additions and 899 deletions

View file

@ -106,7 +106,7 @@ public class Version {
return p2pMessageVersion;
}
// The version for the crypto network (XMR_Mainnet = 0, XMR_Testnet = 1, XMR_Regtest = 2, ...)
// The version for the crypto network (XMR_Mainnet = 0, XMR_LOCAL = 1, XMR_Regtest = 2, ...)
private static int BASE_CURRENCY_NETWORK;
public static void setBaseCryptoNetworkId(int baseCryptoNetworkId) {

View file

@ -20,15 +20,14 @@ package bisq.common.config;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.params.MainNetParams;
import org.bitcoinj.params.RegTestParams;
import org.bitcoinj.params.TestNet3Params;
import org.bitcoinj.utils.MonetaryFormat;
import lombok.Getter;
public enum BaseCurrencyNetwork {
XMR_MAINNET(new XmrMainNetParams(), "XMR", "MAINNET", "Monero"), // TODO (woodser): network params are part of bitcoinj and shouldn't be needed. only used to get MonetaryFormat? replace with MonetaryFormat if so
XMR_TESTNET(new XmrTestNet3Params(), "XMR", "TESTNET", "Monero"),
XMR_STAGENET(new XmrRegTestParams(), "XMR", "STAGENET", "Monero");
XMR_STAGENET(new XmrStageNetParams(), "XMR", "STAGENET", "Monero"),
XMR_LOCAL(new XmrTestNetParams(), "XMR", "TESTNET", "Monero");
@Getter
private final NetworkParameters parameters;
@ -51,7 +50,7 @@ public enum BaseCurrencyNetwork {
}
public boolean isTestnet() {
return "XMR_TESTNET".equals(name());
return "XMR_LOCAL".equals(name());
}
public boolean isStagenet() {
@ -71,14 +70,14 @@ public enum BaseCurrencyNetwork {
}
}
private static class XmrTestNet3Params extends TestNet3Params {
private static class XmrTestNetParams extends RegTestParams {
@Override
public MonetaryFormat getMonetaryFormat() {
return XMR_MONETARY_FORMAT;
}
}
private static class XmrRegTestParams extends RegTestParams {
private static class XmrStageNetParams extends RegTestParams {
@Override
public MonetaryFormat getMonetaryFormat() {
return XMR_MONETARY_FORMAT;

View file

@ -76,7 +76,7 @@ public class FileUtil {
public static void deleteRollingBackup(File dir, String fileName) {
File backupDir = new File(Paths.get(dir.getAbsolutePath(), "backup").toString());
if (!backupDir.exists()) throw new RuntimeException("backup directory does not exist: " + backupDir);
if (!backupDir.exists()) return;
String dirName = "backups_" + fileName;
if (dirName.contains(".")) dirName = dirName.replace(".", "_");
File backupFileDir = new File(Paths.get(backupDir.getAbsolutePath(), dirName).toString());