mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-22 20:19:21 +00:00
Change base networks from btc to xmr, e.g. BTC_REGTEST -> XMR_STAGENET (#55)
change base networks from btc to xmr, e.g. BTC_REGTEST -> XMR_STAGENET add xmr seed node files
This commit is contained in:
parent
de5bbf4a85
commit
9903821b18
62 changed files with 353 additions and 181 deletions
14
Makefile
14
Makefile
|
@ -132,8 +132,8 @@ desktop/build:
|
||||||
unzip docs/dao-setup.zip
|
unzip docs/dao-setup.zip
|
||||||
mv dao-setup .localnet
|
mv dao-setup .localnet
|
||||||
mv .localnet/Bitcoin-regtest .localnet/bitcoind
|
mv .localnet/Bitcoin-regtest .localnet/bitcoind
|
||||||
mv .localnet/bisq-BTC_REGTEST_Alice_dao .localnet/alice
|
mv .localnet/bisq-XMR_STAGENET_Alice_dao .localnet/alice
|
||||||
mv .localnet/bisq-BTC_REGTEST_Bob_dao .localnet/bob
|
mv .localnet/bisq-XMR_STAGENET_Bob_dao .localnet/bob
|
||||||
# Remove the preconfigured bitcoin.conf in favor of explicitly
|
# Remove the preconfigured bitcoin.conf in favor of explicitly
|
||||||
# parameterizing the invocation of bitcoind in the target below
|
# parameterizing the invocation of bitcoind in the target below
|
||||||
rm -v .localnet/bitcoind/bitcoin.conf
|
rm -v .localnet/bitcoind/bitcoin.conf
|
||||||
|
@ -190,7 +190,7 @@ bitcoind: .localnet
|
||||||
|
|
||||||
seednode: seednode/build
|
seednode: seednode/build
|
||||||
./bisq-seednode \
|
./bisq-seednode \
|
||||||
--baseCurrencyNetwork=BTC_REGTEST \
|
--baseCurrencyNetwork=XMR_STAGENET \
|
||||||
--useLocalhostForP2P=true \
|
--useLocalhostForP2P=true \
|
||||||
--useDevPrivilegeKeys=true \
|
--useDevPrivilegeKeys=true \
|
||||||
--fullDaoNode=true \
|
--fullDaoNode=true \
|
||||||
|
@ -203,7 +203,7 @@ seednode: seednode/build
|
||||||
|
|
||||||
seednode2: seednode/build
|
seednode2: seednode/build
|
||||||
./bisq-seednode \
|
./bisq-seednode \
|
||||||
--baseCurrencyNetwork=BTC_REGTEST \
|
--baseCurrencyNetwork=XMR_STAGENET \
|
||||||
--useLocalhostForP2P=true \
|
--useLocalhostForP2P=true \
|
||||||
--useDevPrivilegeKeys=true \
|
--useDevPrivilegeKeys=true \
|
||||||
--fullDaoNode=true \
|
--fullDaoNode=true \
|
||||||
|
@ -216,7 +216,7 @@ seednode2: seednode/build
|
||||||
|
|
||||||
mediator: desktop/build
|
mediator: desktop/build
|
||||||
./bisq-desktop \
|
./bisq-desktop \
|
||||||
--baseCurrencyNetwork=BTC_REGTEST \
|
--baseCurrencyNetwork=XMR_STAGENET \
|
||||||
--useLocalhostForP2P=true \
|
--useLocalhostForP2P=true \
|
||||||
--useDevPrivilegeKeys=true \
|
--useDevPrivilegeKeys=true \
|
||||||
--nodePort=4444 \
|
--nodePort=4444 \
|
||||||
|
@ -225,7 +225,7 @@ mediator: desktop/build
|
||||||
|
|
||||||
alice: setup
|
alice: setup
|
||||||
./bisq-desktop \
|
./bisq-desktop \
|
||||||
--baseCurrencyNetwork=BTC_REGTEST \
|
--baseCurrencyNetwork=XMR_STAGENET \
|
||||||
--useLocalhostForP2P=true \
|
--useLocalhostForP2P=true \
|
||||||
--useDevPrivilegeKeys=true \
|
--useDevPrivilegeKeys=true \
|
||||||
--nodePort=5555 \
|
--nodePort=5555 \
|
||||||
|
@ -240,7 +240,7 @@ alice: setup
|
||||||
|
|
||||||
bob: setup
|
bob: setup
|
||||||
./bisq-desktop \
|
./bisq-desktop \
|
||||||
--baseCurrencyNetwork=BTC_REGTEST \
|
--baseCurrencyNetwork=XMR_STAGENET \
|
||||||
--useLocalhostForP2P=true \
|
--useLocalhostForP2P=true \
|
||||||
--useDevPrivilegeKeys=true \
|
--useDevPrivilegeKeys=true \
|
||||||
--nodePort=6666 \
|
--nodePort=6666 \
|
||||||
|
|
|
@ -58,10 +58,10 @@ See the [FAQ in the wiki](https://github.com/haveno-dex/haveno/wiki/FAQ).
|
||||||
11. `cd haveno`
|
11. `cd haveno`
|
||||||
12. `./gradlew build`
|
12. `./gradlew build`
|
||||||
13. Start seed node, arbitrator, Alice, and Bob:
|
13. Start seed node, arbitrator, Alice, and Bob:
|
||||||
1. `./bisq-seednode --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=2002 --appName=bisq-BTC_REGTEST_Seed_2002 --daoActivated=false`
|
1. `./bisq-seednode --baseCurrencyNetwork=XMR_STAGENET --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=2002 --appName=bisq-XMR_STAGENET_Seed_2002 --daoActivated=false`
|
||||||
2. `./bisq-desktop --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=4444 --appName=bisq-BTC_REGTEST_arbitrator --daoActivated=false --apiPassword=apitest --apiPort=9998`
|
2. `./bisq-desktop --baseCurrencyNetwork=XMR_STAGENET --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=4444 --appName=bisq-XMR_STAGENET_arbitrator --daoActivated=false --apiPassword=apitest --apiPort=9998`
|
||||||
3. `./bisq-desktop --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=5555 --appName=bisq-BTC_REGTEST_Alice --daoActivated=false --apiPassword=apitest --apiPort=9999`
|
3. `./bisq-desktop --baseCurrencyNetwork=XMR_STAGENET --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=5555 --appName=bisq-XMR_STAGENET_Alice --daoActivated=false --apiPassword=apitest --apiPort=9999`
|
||||||
4. `./bisq-desktop --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=6666 --appName=bisq-BTC_REGTEST_Bob --daoActivated=false --apiPassword=apitest --apiPort=10000`
|
4. `./bisq-desktop --baseCurrencyNetwork=XMR_STAGENET --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=6666 --appName=bisq-XMR_STAGENET_Bob --daoActivated=false --apiPassword=apitest --apiPort=10000`
|
||||||
14. Arbitrator window > Account > cmd+n to register a new arbitrator
|
14. Arbitrator window > Account > cmd+n to register a new arbitrator
|
||||||
15. Arbitrator window > Account > cmd+d to register a new mediator
|
15. Arbitrator window > Account > cmd+d to register a new mediator
|
||||||
16. Deposit stagenet XMR to Alice and Bob's Haveno wallets (wallet address printed to terminal)
|
16. Deposit stagenet XMR to Alice and Bob's Haveno wallets (wallet address printed to terminal)
|
||||||
|
|
|
@ -59,10 +59,10 @@ task installDaoSetup(dependsOn: 'cleanDaoSetup') {
|
||||||
// Move dao-setup files from build/resources/main/dao-setup to build/resources/main
|
// Move dao-setup files from build/resources/main/dao-setup to build/resources/main
|
||||||
file(buildResourcesDir + '/dao-setup/Bitcoin-regtest')
|
file(buildResourcesDir + '/dao-setup/Bitcoin-regtest')
|
||||||
.renameTo(file(buildResourcesDir + '/Bitcoin-regtest'))
|
.renameTo(file(buildResourcesDir + '/Bitcoin-regtest'))
|
||||||
file(buildResourcesDir + '/dao-setup/bisq-BTC_REGTEST_Alice_dao')
|
file(buildResourcesDir + '/dao-setup/bisq-XMR_STAGENET_Alice_dao')
|
||||||
.renameTo(file(buildResourcesDir + '/bisq-BTC_REGTEST_Alice_dao'))
|
.renameTo(file(buildResourcesDir + '/bisq-XMR_STAGENET_Alice_dao'))
|
||||||
file(buildResourcesDir + '/dao-setup/bisq-BTC_REGTEST_Bob_dao')
|
file(buildResourcesDir + '/dao-setup/bisq-XMR_STAGENET_Bob_dao')
|
||||||
.renameTo(file(buildResourcesDir + '/bisq-BTC_REGTEST_Bob_dao'))
|
.renameTo(file(buildResourcesDir + '/bisq-XMR_STAGENET_Bob_dao'))
|
||||||
delete file(buildResourcesDir + '/dao-setup')
|
delete file(buildResourcesDir + '/dao-setup')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,9 @@ task cleanDaoSetup {
|
||||||
// re-compile any code.
|
// re-compile any code.
|
||||||
println "Deleting dao-setup directories in build dir $buildResourcesDir ..."
|
println "Deleting dao-setup directories in build dir $buildResourcesDir ..."
|
||||||
delete file(buildResourcesDir + '/Bitcoin-regtest')
|
delete file(buildResourcesDir + '/Bitcoin-regtest')
|
||||||
delete file(buildResourcesDir + '/bisq-BTC_REGTEST_Seed_2002')
|
delete file(buildResourcesDir + '/bisq-XMR_STAGENET_Seed_2002')
|
||||||
delete file(buildResourcesDir + '/bisq-BTC_REGTEST_Arb_dao')
|
delete file(buildResourcesDir + '/bisq-XMR_STAGENET_Arb_dao')
|
||||||
delete file(buildResourcesDir + '/bisq-BTC_REGTEST_Alice_dao')
|
delete file(buildResourcesDir + '/bisq-XMR_STAGENET_Alice_dao')
|
||||||
delete file(buildResourcesDir + '/bisq-BTC_REGTEST_Bob_dao')
|
delete file(buildResourcesDir + '/bisq-XMR_STAGENET_Bob_dao')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,14 +226,14 @@ checkseednoderunning() {
|
||||||
|
|
||||||
checkarbnoderunning() {
|
checkarbnoderunning() {
|
||||||
if [[ "$LINUX" == "TRUE" ]]; then
|
if [[ "$LINUX" == "TRUE" ]]; then
|
||||||
if pgrep -f "bisq.daemon.app.BisqDaemonMain --appName=bisq-BTC_REGTEST_Arb_dao" > /dev/null ; then
|
if pgrep -f "bisq.daemon.app.BisqDaemonMain --appName=bisq-XMR_STAGENET_Arb_dao" > /dev/null ; then
|
||||||
printdate "The arbitration node is running on host."
|
printdate "The arbitration node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: arbitration node is not running on host, exiting."
|
printdate "Error: arbitration node is not running on host, exiting."
|
||||||
apitestusage
|
apitestusage
|
||||||
fi
|
fi
|
||||||
elif [[ "$DARWIN" == "TRUE" ]]; then
|
elif [[ "$DARWIN" == "TRUE" ]]; then
|
||||||
if ps -A | awk '/[b]isq.daemon.app.BisqDaemonMain --appName=bisq-BTC_REGTEST_Arb_dao/ {print $1}' > /dev/null ; then
|
if ps -A | awk '/[b]isq.daemon.app.BisqDaemonMain --appName=bisq-XMR_STAGENET_Arb_dao/ {print $1}' > /dev/null ; then
|
||||||
printdate "The arbitration node is running on host."
|
printdate "The arbitration node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: arbitration node is not running on host, exiting."
|
printdate "Error: arbitration node is not running on host, exiting."
|
||||||
|
@ -247,14 +247,14 @@ checkarbnoderunning() {
|
||||||
|
|
||||||
checkalicenoderunning() {
|
checkalicenoderunning() {
|
||||||
if [[ "$LINUX" == "TRUE" ]]; then
|
if [[ "$LINUX" == "TRUE" ]]; then
|
||||||
if pgrep -f "bisq.daemon.app.BisqDaemonMain --appName=bisq-BTC_REGTEST_Alice_dao" > /dev/null ; then
|
if pgrep -f "bisq.daemon.app.BisqDaemonMain --appName=bisq-XMR_STAGENET_Alice_dao" > /dev/null ; then
|
||||||
printdate "Alice's node is running on host."
|
printdate "Alice's node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: Alice's node is not running on host, exiting."
|
printdate "Error: Alice's node is not running on host, exiting."
|
||||||
apitestusage
|
apitestusage
|
||||||
fi
|
fi
|
||||||
elif [[ "$DARWIN" == "TRUE" ]]; then
|
elif [[ "$DARWIN" == "TRUE" ]]; then
|
||||||
if ps -A | awk '/[b]isq.daemon.app.BisqDaemonMain --appName=bisq-BTC_REGTEST_Alice_dao/ {print $1}' > /dev/null ; then
|
if ps -A | awk '/[b]isq.daemon.app.BisqDaemonMain --appName=bisq-XMR_STAGENET_Alice_dao/ {print $1}' > /dev/null ; then
|
||||||
printdate "Alice's node node is running on host."
|
printdate "Alice's node node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: Alice's node is not running on host, exiting."
|
printdate "Error: Alice's node is not running on host, exiting."
|
||||||
|
@ -268,14 +268,14 @@ checkalicenoderunning() {
|
||||||
|
|
||||||
checkbobnoderunning() {
|
checkbobnoderunning() {
|
||||||
if [[ "$LINUX" == "TRUE" ]]; then
|
if [[ "$LINUX" == "TRUE" ]]; then
|
||||||
if pgrep -f "bisq.daemon.app.BisqDaemonMain --appName=bisq-BTC_REGTEST_Alice_dao" > /dev/null ; then
|
if pgrep -f "bisq.daemon.app.BisqDaemonMain --appName=bisq-XMR_STAGENET_Alice_dao" > /dev/null ; then
|
||||||
printdate "Bob's node is running on host."
|
printdate "Bob's node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: Bob's node is not running on host, exiting."
|
printdate "Error: Bob's node is not running on host, exiting."
|
||||||
apitestusage
|
apitestusage
|
||||||
fi
|
fi
|
||||||
elif [[ "$DARWIN" == "TRUE" ]]; then
|
elif [[ "$DARWIN" == "TRUE" ]]; then
|
||||||
if ps -A | awk '/[b]isq.daemon.app.BisqDaemonMain --appName=bisq-BTC_REGTEST_Alice_dao/ {print $1}' > /dev/null ; then
|
if ps -A | awk '/[b]isq.daemon.app.BisqDaemonMain --appName=bisq-XMR_STAGENET_Alice_dao/ {print $1}' > /dev/null ; then
|
||||||
printdate "Bob's node node is running on host."
|
printdate "Bob's node node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: Bob's node is not running on host, exiting."
|
printdate "Error: Bob's node is not running on host, exiting."
|
||||||
|
|
|
@ -32,7 +32,7 @@ import bisq.daemon.app.BisqDaemonMain;
|
||||||
*/
|
*/
|
||||||
public enum BisqAppConfig {
|
public enum BisqAppConfig {
|
||||||
|
|
||||||
seednode("bisq-BTC_REGTEST_Seed_2002",
|
seednode("bisq-XMR_STAGENET_Seed_2002",
|
||||||
"bisq-seednode",
|
"bisq-seednode",
|
||||||
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
SeedNodeMain.class.getName(),
|
SeedNodeMain.class.getName(),
|
||||||
|
@ -40,7 +40,7 @@ public enum BisqAppConfig {
|
||||||
5120,
|
5120,
|
||||||
-1,
|
-1,
|
||||||
49996),
|
49996),
|
||||||
arbdaemon("bisq-BTC_REGTEST_Arb_dao",
|
arbdaemon("bisq-XMR_STAGENET_Arb_dao",
|
||||||
"bisq-daemon",
|
"bisq-daemon",
|
||||||
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
BisqDaemonMain.class.getName(),
|
BisqDaemonMain.class.getName(),
|
||||||
|
@ -48,7 +48,7 @@ public enum BisqAppConfig {
|
||||||
5121,
|
5121,
|
||||||
9997,
|
9997,
|
||||||
49997),
|
49997),
|
||||||
arbdesktop("bisq-BTC_REGTEST_Arb_dao",
|
arbdesktop("bisq-XMR_STAGENET_Arb_dao",
|
||||||
"bisq-desktop",
|
"bisq-desktop",
|
||||||
"-XX:MaxRAM=3g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=3g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
BisqAppMain.class.getName(),
|
BisqAppMain.class.getName(),
|
||||||
|
@ -56,7 +56,7 @@ public enum BisqAppConfig {
|
||||||
5121,
|
5121,
|
||||||
-1,
|
-1,
|
||||||
49997),
|
49997),
|
||||||
alicedaemon("bisq-BTC_REGTEST_Alice_dao",
|
alicedaemon("bisq-XMR_STAGENET_Alice_dao",
|
||||||
"bisq-daemon",
|
"bisq-daemon",
|
||||||
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
BisqDaemonMain.class.getName(),
|
BisqDaemonMain.class.getName(),
|
||||||
|
@ -64,7 +64,7 @@ public enum BisqAppConfig {
|
||||||
5122,
|
5122,
|
||||||
9998,
|
9998,
|
||||||
49998),
|
49998),
|
||||||
alicedesktop("bisq-BTC_REGTEST_Alice_dao",
|
alicedesktop("bisq-XMR_STAGENET_Alice_dao",
|
||||||
"bisq-desktop",
|
"bisq-desktop",
|
||||||
"-XX:MaxRAM=4g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=4g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
BisqAppMain.class.getName(),
|
BisqAppMain.class.getName(),
|
||||||
|
@ -72,7 +72,7 @@ public enum BisqAppConfig {
|
||||||
5122,
|
5122,
|
||||||
-1,
|
-1,
|
||||||
49998),
|
49998),
|
||||||
bobdaemon("bisq-BTC_REGTEST_Bob_dao",
|
bobdaemon("bisq-XMR_STAGENET_Bob_dao",
|
||||||
"bisq-daemon",
|
"bisq-daemon",
|
||||||
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
BisqDaemonMain.class.getName(),
|
BisqDaemonMain.class.getName(),
|
||||||
|
@ -80,7 +80,7 @@ public enum BisqAppConfig {
|
||||||
5123,
|
5123,
|
||||||
9999,
|
9999,
|
||||||
49999),
|
49999),
|
||||||
bobdesktop("bisq-BTC_REGTEST_Bob_dao",
|
bobdesktop("bisq-XMR_STAGENET_Bob_dao",
|
||||||
"bisq-desktop",
|
"bisq-desktop",
|
||||||
"-XX:MaxRAM=4g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=4g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
BisqAppMain.class.getName(),
|
BisqAppMain.class.getName(),
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class BisqProcess extends AbstractLinuxProcess implements LinuxProcess {
|
||||||
public BisqProcess(BisqAppConfig bisqAppConfig, ApiTestConfig config) {
|
public BisqProcess(BisqAppConfig bisqAppConfig, ApiTestConfig config) {
|
||||||
super(bisqAppConfig.appName, config);
|
super(bisqAppConfig.appName, config);
|
||||||
this.bisqAppConfig = bisqAppConfig;
|
this.bisqAppConfig = bisqAppConfig;
|
||||||
this.baseCurrencyNetwork = "BTC_REGTEST";
|
this.baseCurrencyNetwork = "XMR_STAGENET";
|
||||||
this.genesisTxId = "30af0050040befd8af25068cc697e418e09c2d8ebd8d411d2240591b9ec203cf";
|
this.genesisTxId = "30af0050040befd8af25068cc697e418e09c2d8ebd8d411d2240591b9ec203cf";
|
||||||
this.genesisBlockHeight = 111;
|
this.genesisBlockHeight = 111;
|
||||||
this.seedNodes = "localhost:2002";
|
this.seedNodes = "localhost:2002";
|
||||||
|
|
|
@ -19,16 +19,13 @@ package bisq.asset;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract base class for {@link Asset}s with their own dedicated blockchain, such as
|
* Abstract base class for {@link Asset}s with their own dedicated blockchain, such as
|
||||||
* {@link bisq.asset.coins.Bitcoin} itself or one of its many derivatives, competitors and
|
* {@link bisq.asset.coins.Bitcoin}, {@link bisq.asset.coins.Ether}, and {@link bisq.asset.coins.Monero}.
|
||||||
* alternatives, often called "altcoins", such as {@link bisq.asset.coins.Litecoin},
|
|
||||||
* {@link bisq.asset.coins.Ether}, {@link bisq.asset.coins.Monero} and
|
|
||||||
* {@link bisq.asset.coins.Zcash}.
|
|
||||||
* <p>
|
* <p>
|
||||||
* In addition to the usual {@code Asset} properties, a {@code Coin} maintains information
|
* In addition to the usual {@code Asset} properties, a {@code Coin} maintains information
|
||||||
* about which {@link Network} it may be used on. By default, coins are constructed with
|
* about which {@link Network} it may be used on. By default, coins are constructed with
|
||||||
* the assumption they are for use on that coin's "main network", or "main blockchain",
|
* the assumption they are for use on that coin's "main network", or "main blockchain",
|
||||||
* i.e. that they are "real" coins for use in a production environment. In testing
|
* i.e. that they are "real" coins for use in a production environment. In testing
|
||||||
* scenarios, however, a coin may be constructed for use only on "testnet" or "regtest"
|
* scenarios, however, a coin may be constructed for use only on "testnet" or "stagenet"
|
||||||
* networks.
|
* networks.
|
||||||
*
|
*
|
||||||
* @author Chris Beams
|
* @author Chris Beams
|
||||||
|
@ -36,7 +33,7 @@ package bisq.asset;
|
||||||
*/
|
*/
|
||||||
public abstract class Coin extends AbstractAsset {
|
public abstract class Coin extends AbstractAsset {
|
||||||
|
|
||||||
public enum Network { MAINNET, TESTNET, REGTEST }
|
public enum Network { MAINNET, TESTNET, STAGENET }
|
||||||
|
|
||||||
private final Network network;
|
private final Network network;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class BSQ extends Coin {
|
||||||
public static class Regtest extends BSQ {
|
public static class Regtest extends BSQ {
|
||||||
|
|
||||||
public Regtest() {
|
public Regtest() {
|
||||||
super(Network.REGTEST, RegTestParams.get());
|
super(Network.STAGENET, RegTestParams.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ public abstract class Bitcoin extends Coin {
|
||||||
public static class Regtest extends Bitcoin {
|
public static class Regtest extends Bitcoin {
|
||||||
|
|
||||||
public Regtest() {
|
public Regtest() {
|
||||||
super(Network.REGTEST, RegTestParams.get());
|
super(Network.STAGENET, RegTestParams.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,6 +174,9 @@ public class CliMain {
|
||||||
case "BTC":
|
case "BTC":
|
||||||
out.println(formatBtcBalanceInfoTbl(balances.getBtc()));
|
out.println(formatBtcBalanceInfoTbl(balances.getBtc()));
|
||||||
break;
|
break;
|
||||||
|
case "XMR":
|
||||||
|
out.println(formatXmrBalanceInfoTbl(balances.getXmr()));
|
||||||
|
break;
|
||||||
case "":
|
case "":
|
||||||
default:
|
default:
|
||||||
out.println(formatBalancesTbls(balances));
|
out.println(formatBalancesTbls(balances));
|
||||||
|
|
|
@ -31,6 +31,7 @@ class ColumnHeaderConstants {
|
||||||
// lengths are expected to be greater than any column value length.
|
// lengths are expected to be greater than any column value length.
|
||||||
static final String COL_HEADER_ADDRESS = padEnd("%-3s Address", 52, ' ');
|
static final String COL_HEADER_ADDRESS = padEnd("%-3s Address", 52, ' ');
|
||||||
static final String COL_HEADER_AMOUNT = "BTC(min - max)";
|
static final String COL_HEADER_AMOUNT = "BTC(min - max)";
|
||||||
|
static final String COL_HEADER_BALANCE = "Balance";
|
||||||
static final String COL_HEADER_AVAILABLE_BALANCE = "Available Balance";
|
static final String COL_HEADER_AVAILABLE_BALANCE = "Available Balance";
|
||||||
static final String COL_HEADER_AVAILABLE_CONFIRMED_BALANCE = "Available Confirmed Balance";
|
static final String COL_HEADER_AVAILABLE_CONFIRMED_BALANCE = "Available Confirmed Balance";
|
||||||
static final String COL_HEADER_UNCONFIRMED_CHANGE_BALANCE = "Unconfirmed Change Balance";
|
static final String COL_HEADER_UNCONFIRMED_CHANGE_BALANCE = "Unconfirmed Change Balance";
|
||||||
|
|
|
@ -52,6 +52,8 @@ public class CurrencyFormat {
|
||||||
|
|
||||||
static final BigDecimal SECURITY_DEPOSIT_MULTIPLICAND = new BigDecimal("0.01");
|
static final BigDecimal SECURITY_DEPOSIT_MULTIPLICAND = new BigDecimal("0.01");
|
||||||
|
|
||||||
|
// TODO: (woodser): replace formatSatoshis(), formatBsq() with formatXmr()
|
||||||
|
|
||||||
@SuppressWarnings("BigDecimalMethodWithoutRoundingCalled")
|
@SuppressWarnings("BigDecimalMethodWithoutRoundingCalled")
|
||||||
public static String formatSatoshis(long sats) {
|
public static String formatSatoshis(long sats) {
|
||||||
return BTC_FORMAT.format(BigDecimal.valueOf(sats).divide(SATOSHI_DIVISOR));
|
return BTC_FORMAT.format(BigDecimal.valueOf(sats).divide(SATOSHI_DIVISOR));
|
||||||
|
|
|
@ -30,19 +30,19 @@ import static protobuf.OfferPayload.Direction.SELL;
|
||||||
class DirectionFormat {
|
class DirectionFormat {
|
||||||
|
|
||||||
static int getLongestDirectionColWidth(List<OfferInfo> offers) {
|
static int getLongestDirectionColWidth(List<OfferInfo> offers) {
|
||||||
if (offers.isEmpty() || offers.get(0).getBaseCurrencyCode().equals("BTC"))
|
if (offers.isEmpty() || offers.get(0).getBaseCurrencyCode().equals("XMR"))
|
||||||
return COL_HEADER_DIRECTION.length();
|
return COL_HEADER_DIRECTION.length();
|
||||||
else
|
else
|
||||||
return 18; // .e.g., "Sell BSQ (Buy BTC)".length()
|
return 18; // .e.g., "Sell BSQ (Buy XMR)".length()
|
||||||
}
|
}
|
||||||
|
|
||||||
static final Function<OfferInfo, String> directionFormat = (offer) -> {
|
static final Function<OfferInfo, String> directionFormat = (offer) -> {
|
||||||
String baseCurrencyCode = offer.getBaseCurrencyCode();
|
String baseCurrencyCode = offer.getBaseCurrencyCode();
|
||||||
boolean isCryptoCurrencyOffer = !baseCurrencyCode.equals("BTC");
|
boolean isCryptoCurrencyOffer = !baseCurrencyCode.equals("XMR");
|
||||||
if (!isCryptoCurrencyOffer) {
|
if (!isCryptoCurrencyOffer) {
|
||||||
return baseCurrencyCode;
|
return baseCurrencyCode;
|
||||||
} else {
|
} else {
|
||||||
// Return "Sell BSQ (Buy BTC)", or "Buy BSQ (Sell BTC)".
|
// Return "Sell BSQ (Buy XMR)", or "Buy BSQ (Sell XMR)".
|
||||||
String direction = offer.getDirection();
|
String direction = offer.getDirection();
|
||||||
String mirroredDirection = getMirroredDirection(direction);
|
String mirroredDirection = getMirroredDirection(direction);
|
||||||
Function<String, String> mixedCase = (word) -> word.charAt(0) + word.substring(1).toLowerCase();
|
Function<String, String> mixedCase = (word) -> word.charAt(0) + word.substring(1).toLowerCase();
|
||||||
|
|
|
@ -64,6 +64,7 @@ import bisq.proto.grpc.UnlockWalletRequest;
|
||||||
import bisq.proto.grpc.UnsetTxFeeRatePreferenceRequest;
|
import bisq.proto.grpc.UnsetTxFeeRatePreferenceRequest;
|
||||||
import bisq.proto.grpc.VerifyBsqSentToAddressRequest;
|
import bisq.proto.grpc.VerifyBsqSentToAddressRequest;
|
||||||
import bisq.proto.grpc.WithdrawFundsRequest;
|
import bisq.proto.grpc.WithdrawFundsRequest;
|
||||||
|
import bisq.proto.grpc.XmrBalanceInfo;
|
||||||
|
|
||||||
import protobuf.PaymentAccount;
|
import protobuf.PaymentAccount;
|
||||||
import protobuf.PaymentMethod;
|
import protobuf.PaymentMethod;
|
||||||
|
@ -107,6 +108,10 @@ public final class GrpcClient {
|
||||||
return getBalances("BTC").getBtc();
|
return getBalances("BTC").getBtc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public XmrBalanceInfo getXmrBalances() {
|
||||||
|
return getBalances("XMR").getXmr();
|
||||||
|
}
|
||||||
|
|
||||||
public BalancesInfo getBalances(String currencyCode) {
|
public BalancesInfo getBalances(String currencyCode) {
|
||||||
var request = GetBalancesRequest.newBuilder()
|
var request = GetBalancesRequest.newBuilder()
|
||||||
.setCurrencyCode(currencyCode)
|
.setCurrencyCode(currencyCode)
|
||||||
|
@ -299,7 +304,7 @@ public final class GrpcClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OfferInfo> getCryptoCurrencyOffers(String direction, String currencyCode) {
|
public List<OfferInfo> getCryptoCurrencyOffers(String direction, String currencyCode) {
|
||||||
return getOffers(direction, "BTC").stream()
|
return getOffers(direction, "XMR").stream()
|
||||||
.filter(o -> o.getBaseCurrencyCode().equalsIgnoreCase(currencyCode))
|
.filter(o -> o.getBaseCurrencyCode().equalsIgnoreCase(currencyCode))
|
||||||
.collect(toList());
|
.collect(toList());
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import bisq.proto.grpc.BalancesInfo;
|
||||||
import bisq.proto.grpc.BsqBalanceInfo;
|
import bisq.proto.grpc.BsqBalanceInfo;
|
||||||
import bisq.proto.grpc.BtcBalanceInfo;
|
import bisq.proto.grpc.BtcBalanceInfo;
|
||||||
import bisq.proto.grpc.OfferInfo;
|
import bisq.proto.grpc.OfferInfo;
|
||||||
|
import bisq.proto.grpc.XmrBalanceInfo;
|
||||||
|
|
||||||
import protobuf.PaymentAccount;
|
import protobuf.PaymentAccount;
|
||||||
|
|
||||||
|
@ -56,7 +57,7 @@ public class TableFormat {
|
||||||
+ COL_HEADER_AVAILABLE_BALANCE + COL_HEADER_DELIMITER
|
+ COL_HEADER_AVAILABLE_BALANCE + COL_HEADER_DELIMITER
|
||||||
+ COL_HEADER_CONFIRMATIONS + COL_HEADER_DELIMITER
|
+ COL_HEADER_CONFIRMATIONS + COL_HEADER_DELIMITER
|
||||||
+ COL_HEADER_IS_USED_ADDRESS + COL_HEADER_DELIMITER + "\n";
|
+ COL_HEADER_IS_USED_ADDRESS + COL_HEADER_DELIMITER + "\n";
|
||||||
String headerLine = format(headerFormatString, "BTC");
|
String headerLine = format(headerFormatString, "XMR");
|
||||||
|
|
||||||
String colDataFormat = "%-" + COL_HEADER_ADDRESS.length() + "s" // lt justify
|
String colDataFormat = "%-" + COL_HEADER_ADDRESS.length() + "s" // lt justify
|
||||||
+ " %" + (COL_HEADER_AVAILABLE_BALANCE.length() - 1) + "s" // rt justify
|
+ " %" + (COL_HEADER_AVAILABLE_BALANCE.length() - 1) + "s" // rt justify
|
||||||
|
@ -73,7 +74,7 @@ public class TableFormat {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String formatBalancesTbls(BalancesInfo balancesInfo) {
|
public static String formatBalancesTbls(BalancesInfo balancesInfo) {
|
||||||
return "BTC" + "\n"
|
return "XMR" + "\n"
|
||||||
+ formatBtcBalanceInfoTbl(balancesInfo.getBtc()) + "\n"
|
+ formatBtcBalanceInfoTbl(balancesInfo.getBtc()) + "\n"
|
||||||
+ "BSQ" + "\n"
|
+ "BSQ" + "\n"
|
||||||
+ formatBsqBalanceInfoTbl(balancesInfo.getBsq());
|
+ formatBsqBalanceInfoTbl(balancesInfo.getBsq());
|
||||||
|
@ -117,6 +118,24 @@ public class TableFormat {
|
||||||
formatSatoshis(btcBalanceInfo.getLockedBalance()));
|
formatSatoshis(btcBalanceInfo.getLockedBalance()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String formatXmrBalanceInfoTbl(XmrBalanceInfo xmrBalanceInfo) {
|
||||||
|
String headerLine = COL_HEADER_BALANCE + COL_HEADER_DELIMITER
|
||||||
|
+ COL_HEADER_AVAILABLE_BALANCE + COL_HEADER_DELIMITER
|
||||||
|
+ COL_HEADER_RESERVED_BALANCE + COL_HEADER_DELIMITER
|
||||||
|
+ COL_HEADER_TOTAL_AVAILABLE_BALANCE + COL_HEADER_DELIMITER // TODO (woodser): column names are not quite right for XMR (balance, available balance, locked balance, reserved balance, total balance)
|
||||||
|
+ COL_HEADER_LOCKED_BALANCE + COL_HEADER_DELIMITER + "\n";
|
||||||
|
String colDataFormat = "%" + COL_HEADER_BALANCE.length() + "s" // rt justify
|
||||||
|
+ " %" + (COL_HEADER_AVAILABLE_BALANCE.length() + 1) + "s" // rt justify
|
||||||
|
+ " %" + (COL_HEADER_RESERVED_BALANCE.length() + 1) + "s" // rt justify
|
||||||
|
+ " %" + (COL_HEADER_TOTAL_AVAILABLE_BALANCE.length() + 1) + "s" // rt justify
|
||||||
|
+ " %" + (COL_HEADER_LOCKED_BALANCE.length() + 1) + "s"; // rt justify
|
||||||
|
return headerLine + format(colDataFormat,
|
||||||
|
formatSatoshis(xmrBalanceInfo.getAvailableBalance()),
|
||||||
|
formatSatoshis(xmrBalanceInfo.getReservedBalance()),
|
||||||
|
formatSatoshis(xmrBalanceInfo.getTotalBalance()),
|
||||||
|
formatSatoshis(xmrBalanceInfo.getLockedBalance()));
|
||||||
|
}
|
||||||
|
|
||||||
public static String formatPaymentAcctTbl(List<PaymentAccount> paymentAccounts) {
|
public static String formatPaymentAcctTbl(List<PaymentAccount> paymentAccounts) {
|
||||||
// Some column values might be longer than header, so we need to calculate them.
|
// Some column values might be longer than header, so we need to calculate them.
|
||||||
int nameColWidth = getLongestColumnSize(
|
int nameColWidth = getLongestColumnSize(
|
||||||
|
@ -150,7 +169,7 @@ public class TableFormat {
|
||||||
throw new IllegalArgumentException(format("%s offers argument is empty", currencyCode.toLowerCase()));
|
throw new IllegalArgumentException(format("%s offers argument is empty", currencyCode.toLowerCase()));
|
||||||
|
|
||||||
String baseCurrencyCode = offers.get(0).getBaseCurrencyCode();
|
String baseCurrencyCode = offers.get(0).getBaseCurrencyCode();
|
||||||
return baseCurrencyCode.equalsIgnoreCase("BTC")
|
return baseCurrencyCode.equalsIgnoreCase("XMR")
|
||||||
? formatFiatOfferTable(offers, currencyCode)
|
? formatFiatOfferTable(offers, currencyCode)
|
||||||
: formatCryptoCurrencyOfferTable(offers, baseCurrencyCode);
|
: formatCryptoCurrencyOfferTable(offers, baseCurrencyCode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,13 +135,13 @@ public class TradeFormat {
|
||||||
bsqReceiveAddress.apply(tradeInfo, showBsqBuyerAddress));
|
bsqReceiveAddress.apply(tradeInfo, showBsqBuyerAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Function<TradeInfo, String> priceHeader = (t) -> // TODO (woodser): update these to XMR
|
private static final Function<TradeInfo, String> priceHeader = (t) ->
|
||||||
t.getOffer().getBaseCurrencyCode().equals("BTC")
|
t.getOffer().getBaseCurrencyCode().equals("XMR")
|
||||||
? COL_HEADER_PRICE
|
? COL_HEADER_PRICE
|
||||||
: COL_HEADER_PRICE_OF_ALTCOIN;
|
: COL_HEADER_PRICE_OF_ALTCOIN;
|
||||||
|
|
||||||
private static final Function<TradeInfo, String> priceHeaderCurrencyCode = (t) ->
|
private static final Function<TradeInfo, String> priceHeaderCurrencyCode = (t) ->
|
||||||
t.getOffer().getBaseCurrencyCode().equals("BTC")
|
t.getOffer().getBaseCurrencyCode().equals("XMR")
|
||||||
? t.getOffer().getCounterCurrencyCode()
|
? t.getOffer().getCounterCurrencyCode()
|
||||||
: t.getOffer().getBaseCurrencyCode();
|
: t.getOffer().getBaseCurrencyCode();
|
||||||
|
|
||||||
|
@ -150,18 +150,18 @@ public class TradeFormat {
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final Function<TradeInfo, String> paymentStatusHeaderCurrencyCode = (t) ->
|
private static final Function<TradeInfo, String> paymentStatusHeaderCurrencyCode = (t) ->
|
||||||
t.getOffer().getBaseCurrencyCode().equals("BTC")
|
t.getOffer().getBaseCurrencyCode().equals("XMR")
|
||||||
? t.getOffer().getCounterCurrencyCode()
|
? t.getOffer().getCounterCurrencyCode()
|
||||||
: t.getOffer().getBaseCurrencyCode();
|
: t.getOffer().getBaseCurrencyCode();
|
||||||
|
|
||||||
private static final Function<TradeInfo, String> priceFormat = (t) ->
|
private static final Function<TradeInfo, String> priceFormat = (t) ->
|
||||||
t.getOffer().getBaseCurrencyCode().equals("BTC")
|
t.getOffer().getBaseCurrencyCode().equals("XMR")
|
||||||
? formatPrice(t.getTradePrice())
|
? formatPrice(t.getTradePrice())
|
||||||
: formatCryptoCurrencyPrice(t.getOffer().getPrice());
|
: formatCryptoCurrencyPrice(t.getOffer().getPrice());
|
||||||
|
|
||||||
private static final Function<TradeInfo, String> amountFormat = (t) ->
|
private static final Function<TradeInfo, String> amountFormat = (t) ->
|
||||||
t.getOffer().getBaseCurrencyCode().equals("BTC")
|
t.getOffer().getBaseCurrencyCode().equals("XMR")
|
||||||
? formatSatoshis(t.getTradeAmountAsLong()) // TODO (woodser): delete formatSatoshis(), formatBsq() and change base currency code to XMR
|
? formatXmr(ParsingUtils.satoshisToXmrAtomicUnits(t.getTradeAmountAsLong()))
|
||||||
: formatCryptoCurrencyOfferVolume(t.getOffer().getVolume());
|
: formatCryptoCurrencyOfferVolume(t.getOffer().getVolume());
|
||||||
|
|
||||||
private static final BiFunction<TradeInfo, Boolean, String> makerTakerMinerTxFeeFormat = (t, isTaker) -> {
|
private static final BiFunction<TradeInfo, Boolean, String> makerTakerMinerTxFeeFormat = (t, isTaker) -> {
|
||||||
|
@ -177,15 +177,15 @@ public class TradeFormat {
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final Function<TradeInfo, String> tradeCostFormat = (t) ->
|
private static final Function<TradeInfo, String> tradeCostFormat = (t) ->
|
||||||
t.getOffer().getBaseCurrencyCode().equals("BTC")
|
t.getOffer().getBaseCurrencyCode().equals("XMR")
|
||||||
? formatOfferVolume(t.getOffer().getVolume())
|
? formatOfferVolume(t.getOffer().getVolume())
|
||||||
: formatSatoshis(t.getTradeAmountAsLong());
|
: formatXmr(ParsingUtils.satoshisToXmrAtomicUnits(t.getTradeAmountAsLong()));
|
||||||
|
|
||||||
private static final BiFunction<TradeInfo, Boolean, String> bsqReceiveAddress = (t, showBsqBuyerAddress) -> {
|
private static final BiFunction<TradeInfo, Boolean, String> bsqReceiveAddress = (t, showBsqBuyerAddress) -> {
|
||||||
if (showBsqBuyerAddress) {
|
if (showBsqBuyerAddress) {
|
||||||
ContractInfo contract = t.getContract();
|
ContractInfo contract = t.getContract();
|
||||||
boolean isBuyerMakerAndSellerTaker = contract.getIsBuyerMakerAndSellerTaker();
|
boolean isBuyerMakerAndSellerTaker = contract.getIsBuyerMakerAndSellerTaker();
|
||||||
return isBuyerMakerAndSellerTaker // (is BTC buyer / maker)
|
return isBuyerMakerAndSellerTaker // (is XMR buyer / maker)
|
||||||
? contract.getTakerPaymentAccountPayload().getAddress()
|
? contract.getTakerPaymentAccountPayload().getAddress()
|
||||||
: contract.getMakerPaymentAccountPayload().getAddress();
|
: contract.getMakerPaymentAccountPayload().getAddress();
|
||||||
} else {
|
} else {
|
||||||
|
@ -194,12 +194,12 @@ public class TradeFormat {
|
||||||
};
|
};
|
||||||
|
|
||||||
private static boolean shouldShowBsqBuyerAddress(TradeInfo tradeInfo, boolean isTaker) {
|
private static boolean shouldShowBsqBuyerAddress(TradeInfo tradeInfo, boolean isTaker) {
|
||||||
if (tradeInfo.getOffer().getBaseCurrencyCode().equals("BTC")) {
|
if (tradeInfo.getOffer().getBaseCurrencyCode().equals("XMR")) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
ContractInfo contract = tradeInfo.getContract();
|
ContractInfo contract = tradeInfo.getContract();
|
||||||
// Do not forget buyer and seller refer to BTC buyer and seller, not BSQ
|
// Do not forget buyer and seller refer to XMR buyer and seller, not BSQ
|
||||||
// buyer and seller. If you are buying BSQ, you are the (BTC) seller.
|
// buyer and seller. If you are buying BSQ, you are the XMR seller.
|
||||||
boolean isBuyerMakerAndSellerTaker = contract.getIsBuyerMakerAndSellerTaker();
|
boolean isBuyerMakerAndSellerTaker = contract.getIsBuyerMakerAndSellerTaker();
|
||||||
if (isTaker) {
|
if (isTaker) {
|
||||||
return !isBuyerMakerAndSellerTaker;
|
return !isBuyerMakerAndSellerTaker;
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class Version {
|
||||||
return p2pMessageVersion;
|
return p2pMessageVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The version for the crypto network (BTC_Mainnet = 0, BTC_TestNet = 1, BTC_Regtest = 2, ...)
|
// The version for the crypto network (XMR_Mainnet = 0, XMR_Testnet = 1, XMR_Regtest = 2, ...)
|
||||||
private static int BASE_CURRENCY_NETWORK;
|
private static int BASE_CURRENCY_NETWORK;
|
||||||
|
|
||||||
public static void setBaseCryptoNetworkId(int baseCryptoNetworkId) {
|
public static void setBaseCryptoNetworkId(int baseCryptoNetworkId) {
|
||||||
|
|
|
@ -25,12 +25,12 @@ import org.bitcoinj.params.TestNet3Params;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
public enum BaseCurrencyNetwork {
|
public enum BaseCurrencyNetwork {
|
||||||
BTC_MAINNET(MainNetParams.get(), "BTC", "MAINNET", "Bitcoin"),
|
XMR_MAINNET(MainNetParams.get(), "XMR", "MAINNET", "Monero"),
|
||||||
BTC_TESTNET(TestNet3Params.get(), "BTC", "TESTNET", "Bitcoin"),
|
XMR_TESTNET(TestNet3Params.get(), "XMR", "TESTNET", "Monero"),
|
||||||
BTC_REGTEST(RegTestParams.get(), "BTC", "REGTEST", "Bitcoin"),
|
XMR_STAGENET(RegTestParams.get(), "XMR", "STAGENET", "Monero"),
|
||||||
BTC_DAO_TESTNET(RegTestParams.get(), "BTC", "REGTEST", "Bitcoin"), // server side regtest until v0.9.5
|
BTC_DAO_TESTNET(RegTestParams.get(), "XMR", "STAGENET", "Monero"),
|
||||||
BTC_DAO_BETANET(MainNetParams.get(), "BTC", "MAINNET", "Bitcoin"), // mainnet test genesis
|
BTC_DAO_BETANET(MainNetParams.get(), "XMR", "MAINNET", "Monero"), // mainnet test genesis
|
||||||
BTC_DAO_REGTEST(RegTestParams.get(), "BTC", "REGTEST", "Bitcoin"); // server side regtest after v0.9.5, had breaking code changes so we started over again
|
BTC_DAO_REGTEST(RegTestParams.get(), "XMR", "STAGENET", "Monero");
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final NetworkParameters parameters;
|
private final NetworkParameters parameters;
|
||||||
|
@ -49,11 +49,11 @@ public enum BaseCurrencyNetwork {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMainnet() {
|
public boolean isMainnet() {
|
||||||
return "BTC_MAINNET".equals(name());
|
return "XMR_MAINNET".equals(name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTestnet() {
|
public boolean isTestnet() {
|
||||||
return "BTC_TESTNET".equals(name());
|
return "XMR_TESTNET".equals(name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDaoTestNet() {
|
public boolean isDaoTestNet() {
|
||||||
|
@ -68,8 +68,8 @@ public enum BaseCurrencyNetwork {
|
||||||
return "BTC_DAO_BETANET".equals(name());
|
return "BTC_DAO_BETANET".equals(name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRegtest() {
|
public boolean isStagenet() {
|
||||||
return "BTC_REGTEST".equals(name());
|
return "XMR_STAGENET".equals(name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getDefaultMinFeePerVbyte() {
|
public long getDefaultMinFeePerVbyte() {
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class Config {
|
||||||
// Static fields that provide access to Config properties in locations where injecting
|
// Static fields that provide access to Config properties in locations where injecting
|
||||||
// a Config instance is not feasible. See Javadoc for corresponding static accessors.
|
// a Config instance is not feasible. See Javadoc for corresponding static accessors.
|
||||||
private static File APP_DATA_DIR_VALUE;
|
private static File APP_DATA_DIR_VALUE;
|
||||||
private static BaseCurrencyNetwork BASE_CURRENCY_NETWORK_VALUE = BaseCurrencyNetwork.BTC_MAINNET;
|
private static BaseCurrencyNetwork BASE_CURRENCY_NETWORK_VALUE = BaseCurrencyNetwork.XMR_MAINNET;
|
||||||
|
|
||||||
// Default "data dir properties", i.e. properties that can determine the location of
|
// Default "data dir properties", i.e. properties that can determine the location of
|
||||||
// Bisq's application data directory (appDataDir)
|
// Bisq's application data directory (appDataDir)
|
||||||
|
@ -338,7 +338,7 @@ public class Config {
|
||||||
.withRequiredArg()
|
.withRequiredArg()
|
||||||
.ofType(BaseCurrencyNetwork.class)
|
.ofType(BaseCurrencyNetwork.class)
|
||||||
.withValuesConvertedBy(new EnumValueConverter(BaseCurrencyNetwork.class))
|
.withValuesConvertedBy(new EnumValueConverter(BaseCurrencyNetwork.class))
|
||||||
.defaultsTo(BaseCurrencyNetwork.BTC_MAINNET);
|
.defaultsTo(BaseCurrencyNetwork.XMR_MAINNET);
|
||||||
|
|
||||||
ArgumentAcceptingOptionSpec<Boolean> ignoreLocalBtcNodeOpt =
|
ArgumentAcceptingOptionSpec<Boolean> ignoreLocalBtcNodeOpt =
|
||||||
parser.accepts(IGNORE_LOCAL_BTC_NODE,
|
parser.accepts(IGNORE_LOCAL_BTC_NODE,
|
||||||
|
@ -348,7 +348,7 @@ public class Config {
|
||||||
.defaultsTo(false);
|
.defaultsTo(false);
|
||||||
|
|
||||||
ArgumentAcceptingOptionSpec<String> bitcoinRegtestHostOpt =
|
ArgumentAcceptingOptionSpec<String> bitcoinRegtestHostOpt =
|
||||||
parser.accepts(BITCOIN_REGTEST_HOST, "Bitcoin Core node when using BTC_REGTEST network")
|
parser.accepts(BITCOIN_REGTEST_HOST, "Bitcoin Core node when using XMR_STAGENET network")
|
||||||
.withRequiredArg()
|
.withRequiredArg()
|
||||||
.ofType(String.class)
|
.ofType(String.class)
|
||||||
.describedAs("host[:port]")
|
.describedAs("host[:port]")
|
||||||
|
@ -416,7 +416,7 @@ public class Config {
|
||||||
.describedAs("host:port[,...]");
|
.describedAs("host:port[,...]");
|
||||||
|
|
||||||
ArgumentAcceptingOptionSpec<Boolean> useLocalhostForP2POpt =
|
ArgumentAcceptingOptionSpec<Boolean> useLocalhostForP2POpt =
|
||||||
parser.accepts(USE_LOCALHOST_FOR_P2P, "Use localhost P2P network for development. Only available for non-BTC_MAINNET configuration.")
|
parser.accepts(USE_LOCALHOST_FOR_P2P, "Use localhost P2P network for development. Only available for non-XMR_MAINNET configuration.")
|
||||||
.availableIf(BASE_CURRENCY_NETWORK)
|
.availableIf(BASE_CURRENCY_NETWORK)
|
||||||
.withRequiredArg()
|
.withRequiredArg()
|
||||||
.ofType(boolean.class)
|
.ofType(boolean.class)
|
||||||
|
@ -919,7 +919,7 @@ public class Config {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Static accessor that returns either the default base currency network value of
|
* Static accessor that returns either the default base currency network value of
|
||||||
* {@link BaseCurrencyNetwork#BTC_MAINNET} or the value assigned via the
|
* {@link BaseCurrencyNetwork#XMR_MAINNET} or the value assigned via the
|
||||||
* {@value BASE_CURRENCY_NETWORK} option. The non-static
|
* {@value BASE_CURRENCY_NETWORK} option. The non-static
|
||||||
* {@link #baseCurrencyNetwork} property should be favored whenever possible and
|
* {@link #baseCurrencyNetwork} property should be favored whenever possible and
|
||||||
* this static accessor should be used only in code locations where it is infeasible
|
* this static accessor should be used only in code locations where it is infeasible
|
||||||
|
|
|
@ -22,6 +22,7 @@ import bisq.core.api.model.BalancesInfo;
|
||||||
import bisq.core.api.model.BsqBalanceInfo;
|
import bisq.core.api.model.BsqBalanceInfo;
|
||||||
import bisq.core.api.model.BtcBalanceInfo;
|
import bisq.core.api.model.BtcBalanceInfo;
|
||||||
import bisq.core.api.model.TxFeeRateInfo;
|
import bisq.core.api.model.TxFeeRateInfo;
|
||||||
|
import bisq.core.api.model.XmrBalanceInfo;
|
||||||
import bisq.core.app.AppStartupState;
|
import bisq.core.app.AppStartupState;
|
||||||
import bisq.core.btc.Balances;
|
import bisq.core.btc.Balances;
|
||||||
import bisq.core.btc.exceptions.AddressEntryException;
|
import bisq.core.btc.exceptions.AddressEntryException;
|
||||||
|
@ -160,11 +161,13 @@ class CoreWalletsService {
|
||||||
|
|
||||||
switch (currencyCode.trim().toUpperCase()) {
|
switch (currencyCode.trim().toUpperCase()) {
|
||||||
case "BSQ":
|
case "BSQ":
|
||||||
return new BalancesInfo(getBsqBalances(), BtcBalanceInfo.EMPTY);
|
return new BalancesInfo(getBsqBalances(), BtcBalanceInfo.EMPTY, XmrBalanceInfo.EMPTY);
|
||||||
case "BTC":
|
case "BTC":
|
||||||
return new BalancesInfo(BsqBalanceInfo.EMPTY, getBtcBalances());
|
return new BalancesInfo(BsqBalanceInfo.EMPTY, getBtcBalances(), XmrBalanceInfo.EMPTY);
|
||||||
|
case "XMR":
|
||||||
|
return new BalancesInfo(BsqBalanceInfo.EMPTY, BtcBalanceInfo.EMPTY, getXmrBalances());
|
||||||
default:
|
default:
|
||||||
return new BalancesInfo(getBsqBalances(), getBtcBalances());
|
return new BalancesInfo(getBsqBalances(), getBtcBalances(), getXmrBalances());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -602,6 +605,7 @@ class CoreWalletsService {
|
||||||
unlockingBondsBalance.value);
|
unlockingBondsBalance.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO (woodser): delete this since it's serving XMR balances
|
||||||
private BtcBalanceInfo getBtcBalances() {
|
private BtcBalanceInfo getBtcBalances() {
|
||||||
verifyWalletsAreAvailable();
|
verifyWalletsAreAvailable();
|
||||||
verifyEncryptedWalletIsUnlocked();
|
verifyEncryptedWalletIsUnlocked();
|
||||||
|
@ -624,6 +628,29 @@ class CoreWalletsService {
|
||||||
lockedBalance.value);
|
lockedBalance.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private XmrBalanceInfo getXmrBalances() {
|
||||||
|
verifyWalletsAreAvailable();
|
||||||
|
verifyEncryptedWalletIsUnlocked();
|
||||||
|
|
||||||
|
var availableBalance = balances.getAvailableBalance().get();
|
||||||
|
if (availableBalance == null)
|
||||||
|
throw new IllegalStateException("available balance is not yet available");
|
||||||
|
|
||||||
|
var reservedBalance = balances.getReservedBalance().get();
|
||||||
|
if (reservedBalance == null)
|
||||||
|
throw new IllegalStateException("reserved balance is not yet available");
|
||||||
|
|
||||||
|
var lockedBalance = balances.getLockedBalance().get();
|
||||||
|
if (lockedBalance == null)
|
||||||
|
throw new IllegalStateException("locked balance is not yet available");
|
||||||
|
|
||||||
|
return new XmrBalanceInfo(availableBalance.add(lockedBalance).value,
|
||||||
|
availableBalance.value,
|
||||||
|
lockedBalance.value,
|
||||||
|
reservedBalance.value,
|
||||||
|
availableBalance.add(lockedBalance).add(reservedBalance).value);
|
||||||
|
}
|
||||||
|
|
||||||
// Returns a Coin for the transfer amount string, or a RuntimeException if invalid.
|
// Returns a Coin for the transfer amount string, or a RuntimeException if invalid.
|
||||||
private Coin getValidTransferAmount(String amount, CoinFormatter coinFormatter) {
|
private Coin getValidTransferAmount(String amount, CoinFormatter coinFormatter) {
|
||||||
Coin amountAsCoin = parseToCoin(amount, coinFormatter);
|
Coin amountAsCoin = parseToCoin(amount, coinFormatter);
|
||||||
|
|
|
@ -12,10 +12,12 @@ public class BalancesInfo implements Payload {
|
||||||
// balancesInfo.getBtcBalanceInfo().getAvailableBalance().
|
// balancesInfo.getBtcBalanceInfo().getAvailableBalance().
|
||||||
private final BsqBalanceInfo bsq;
|
private final BsqBalanceInfo bsq;
|
||||||
private final BtcBalanceInfo btc;
|
private final BtcBalanceInfo btc;
|
||||||
|
private final XmrBalanceInfo xmr;
|
||||||
|
|
||||||
public BalancesInfo(BsqBalanceInfo bsq, BtcBalanceInfo btc) {
|
public BalancesInfo(BsqBalanceInfo bsq, BtcBalanceInfo btc, XmrBalanceInfo xmr) {
|
||||||
this.bsq = bsq;
|
this.bsq = bsq;
|
||||||
this.btc = btc;
|
this.btc = btc;
|
||||||
|
this.xmr = xmr;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -27,12 +29,14 @@ public class BalancesInfo implements Payload {
|
||||||
return bisq.proto.grpc.BalancesInfo.newBuilder()
|
return bisq.proto.grpc.BalancesInfo.newBuilder()
|
||||||
.setBsq(bsq.toProtoMessage())
|
.setBsq(bsq.toProtoMessage())
|
||||||
.setBtc(btc.toProtoMessage())
|
.setBtc(btc.toProtoMessage())
|
||||||
|
.setXmr(xmr.toProtoMessage())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BalancesInfo fromProto(bisq.proto.grpc.BalancesInfo proto) {
|
public static BalancesInfo fromProto(bisq.proto.grpc.BalancesInfo proto) {
|
||||||
return new BalancesInfo(BsqBalanceInfo.fromProto(proto.getBsq()),
|
return new BalancesInfo(BsqBalanceInfo.fromProto(proto.getBsq()),
|
||||||
BtcBalanceInfo.fromProto(proto.getBtc()));
|
BtcBalanceInfo.fromProto(proto.getBtc()),
|
||||||
|
XmrBalanceInfo.fromProto(proto.getXmr()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -40,6 +44,7 @@ public class BalancesInfo implements Payload {
|
||||||
return "BalancesInfo{" + "\n" +
|
return "BalancesInfo{" + "\n" +
|
||||||
" " + bsq.toString() + "\n" +
|
" " + bsq.toString() + "\n" +
|
||||||
", " + btc.toString() + "\n" +
|
", " + btc.toString() + "\n" +
|
||||||
|
", " + xmr.toString() + "\n" +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
84
core/src/main/java/bisq/core/api/model/XmrBalanceInfo.java
Normal file
84
core/src/main/java/bisq/core/api/model/XmrBalanceInfo.java
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
package bisq.core.api.model;
|
||||||
|
|
||||||
|
import bisq.common.Payload;
|
||||||
|
|
||||||
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public class XmrBalanceInfo implements Payload {
|
||||||
|
|
||||||
|
public static final XmrBalanceInfo EMPTY = new XmrBalanceInfo(-1,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
-1);
|
||||||
|
|
||||||
|
// All balances are in XMR centineros: https://www.getmonero.org/resources/moneropedia/denominations.html
|
||||||
|
private final long balance;
|
||||||
|
private final long availableBalance;
|
||||||
|
private final long lockedBalance;
|
||||||
|
private final long reservedBalance;
|
||||||
|
private final long totalBalance; // balance + reserved
|
||||||
|
|
||||||
|
public XmrBalanceInfo(long balance,
|
||||||
|
long availableBalance,
|
||||||
|
long lockedBalance,
|
||||||
|
long reservedBalance,
|
||||||
|
long totalBalance) {
|
||||||
|
this.balance = balance;
|
||||||
|
this.availableBalance = availableBalance;
|
||||||
|
this.lockedBalance = lockedBalance;
|
||||||
|
this.reservedBalance = reservedBalance;
|
||||||
|
this.totalBalance = totalBalance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
|
public static XmrBalanceInfo valueOf(long balance,
|
||||||
|
long availableBalance,
|
||||||
|
long lockedBalance,
|
||||||
|
long reservedBalance,
|
||||||
|
long totalBalance) {
|
||||||
|
// Convenience for creating a model instance instead of a proto.
|
||||||
|
return new XmrBalanceInfo(balance,
|
||||||
|
availableBalance,
|
||||||
|
lockedBalance,
|
||||||
|
reservedBalance,
|
||||||
|
totalBalance);
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// PROTO BUFFER
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public bisq.proto.grpc.XmrBalanceInfo toProtoMessage() {
|
||||||
|
return bisq.proto.grpc.XmrBalanceInfo.newBuilder()
|
||||||
|
.setBalance(balance)
|
||||||
|
.setAvailableBalance(availableBalance)
|
||||||
|
.setLockedBalance(lockedBalance)
|
||||||
|
.setReservedBalance(reservedBalance)
|
||||||
|
.setTotalBalance(totalBalance)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static XmrBalanceInfo fromProto(bisq.proto.grpc.XmrBalanceInfo proto) {
|
||||||
|
return new XmrBalanceInfo(proto.getBalance(),
|
||||||
|
proto.getAvailableBalance(),
|
||||||
|
proto.getLockedBalance(),
|
||||||
|
proto.getReservedBalance(),
|
||||||
|
proto.getTotalBalance());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "BtcBalanceInfo{" +
|
||||||
|
"balance=" + balance +
|
||||||
|
", availableBalance=" + availableBalance +
|
||||||
|
", lockedBalance=" + lockedBalance +
|
||||||
|
", reservedBalance=" + reservedBalance +
|
||||||
|
", totalBalance=" + totalBalance +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
|
@ -88,6 +88,7 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet
|
||||||
System.exit(EXIT_SUCCESS);
|
System.exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
} catch (ConfigException ex) {
|
} catch (ConfigException ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
System.err.println("error: " + ex.getMessage());
|
System.err.println("error: " + ex.getMessage());
|
||||||
System.exit(EXIT_FAILURE);
|
System.exit(EXIT_FAILURE);
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
|
@ -205,6 +206,7 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet
|
||||||
bisqSetup.start();
|
bisqSetup.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public abstract void onSetupComplete();
|
public abstract void onSetupComplete();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -290,7 +290,7 @@ public class BisqSetup {
|
||||||
|
|
||||||
public void start() {
|
public void start() {
|
||||||
// If user tried to downgrade we require a shutdown
|
// If user tried to downgrade we require a shutdown
|
||||||
if (Config.baseCurrencyNetwork() == BaseCurrencyNetwork.BTC_MAINNET &&
|
if (Config.baseCurrencyNetwork() == BaseCurrencyNetwork.XMR_MAINNET &&
|
||||||
hasDowngraded(downGradePreventionHandler)) {
|
hasDowngraded(downGradePreventionHandler)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -374,7 +374,7 @@ public class MyBlindVoteListService implements PersistedDataHost, DaoStateListen
|
||||||
// Only payloads received from seed nodes would ignore that date check.
|
// Only payloads received from seed nodes would ignore that date check.
|
||||||
int minPeers = Config.baseCurrencyNetwork().isMainnet() ? 4 : 1;
|
int minPeers = Config.baseCurrencyNetwork().isMainnet() ? 4 : 1;
|
||||||
if ((p2PService.getNumConnectedPeers().get() >= minPeers && p2PService.isBootstrapped()) ||
|
if ((p2PService.getNumConnectedPeers().get() >= minPeers && p2PService.isBootstrapped()) ||
|
||||||
Config.baseCurrencyNetwork().isRegtest()) {
|
Config.baseCurrencyNetwork().isStagenet()) {
|
||||||
myBlindVoteList.stream()
|
myBlindVoteList.stream()
|
||||||
.filter(blindVote -> periodService.isTxInPhaseAndCycle(blindVote.getTxId(),
|
.filter(blindVote -> periodService.isTxInPhaseAndCycle(blindVote.getTxId(),
|
||||||
DaoPhase.Phase.BLIND_VOTE,
|
DaoPhase.Phase.BLIND_VOTE,
|
||||||
|
|
|
@ -138,7 +138,7 @@ public enum Param {
|
||||||
PHASE_UNDEFINED("0", ParamType.BLOCK),
|
PHASE_UNDEFINED("0", ParamType.BLOCK),
|
||||||
PHASE_PROPOSAL(Config.baseCurrencyNetwork().isMainnet() ?
|
PHASE_PROPOSAL(Config.baseCurrencyNetwork().isMainnet() ?
|
||||||
"3601" : // mainnet; 24 days
|
"3601" : // mainnet; 24 days
|
||||||
Config.baseCurrencyNetwork().isRegtest() ?
|
Config.baseCurrencyNetwork().isStagenet() ?
|
||||||
"4" : // regtest
|
"4" : // regtest
|
||||||
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
||||||
"144" : // daoBetaNet; 1 day
|
"144" : // daoBetaNet; 1 day
|
||||||
|
@ -148,7 +148,7 @@ public enum Param {
|
||||||
ParamType.BLOCK, 2, 2),
|
ParamType.BLOCK, 2, 2),
|
||||||
PHASE_BREAK1(Config.baseCurrencyNetwork().isMainnet() ?
|
PHASE_BREAK1(Config.baseCurrencyNetwork().isMainnet() ?
|
||||||
"149" : // mainnet; 1 day
|
"149" : // mainnet; 1 day
|
||||||
Config.baseCurrencyNetwork().isRegtest() ?
|
Config.baseCurrencyNetwork().isStagenet() ?
|
||||||
"1" : // regtest
|
"1" : // regtest
|
||||||
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
||||||
"10" : // daoBetaNet
|
"10" : // daoBetaNet
|
||||||
|
@ -158,7 +158,7 @@ public enum Param {
|
||||||
ParamType.BLOCK, 2, 2),
|
ParamType.BLOCK, 2, 2),
|
||||||
PHASE_BLIND_VOTE(Config.baseCurrencyNetwork().isMainnet() ?
|
PHASE_BLIND_VOTE(Config.baseCurrencyNetwork().isMainnet() ?
|
||||||
"451" : // mainnet; 3 days
|
"451" : // mainnet; 3 days
|
||||||
Config.baseCurrencyNetwork().isRegtest() ?
|
Config.baseCurrencyNetwork().isStagenet() ?
|
||||||
"2" : // regtest
|
"2" : // regtest
|
||||||
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
||||||
"144" : // daoBetaNet; 1 day
|
"144" : // daoBetaNet; 1 day
|
||||||
|
@ -168,7 +168,7 @@ public enum Param {
|
||||||
ParamType.BLOCK, 2, 2),
|
ParamType.BLOCK, 2, 2),
|
||||||
PHASE_BREAK2(Config.baseCurrencyNetwork().isMainnet() ?
|
PHASE_BREAK2(Config.baseCurrencyNetwork().isMainnet() ?
|
||||||
"9" : // mainnet
|
"9" : // mainnet
|
||||||
Config.baseCurrencyNetwork().isRegtest() ?
|
Config.baseCurrencyNetwork().isStagenet() ?
|
||||||
"1" : // regtest
|
"1" : // regtest
|
||||||
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
||||||
"10" : // daoBetaNet
|
"10" : // daoBetaNet
|
||||||
|
@ -178,7 +178,7 @@ public enum Param {
|
||||||
ParamType.BLOCK, 2, 2),
|
ParamType.BLOCK, 2, 2),
|
||||||
PHASE_VOTE_REVEAL(Config.baseCurrencyNetwork().isMainnet() ?
|
PHASE_VOTE_REVEAL(Config.baseCurrencyNetwork().isMainnet() ?
|
||||||
"451" : // mainnet; 3 days
|
"451" : // mainnet; 3 days
|
||||||
Config.baseCurrencyNetwork().isRegtest() ?
|
Config.baseCurrencyNetwork().isStagenet() ?
|
||||||
"2" : // regtest
|
"2" : // regtest
|
||||||
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
||||||
"144" : // daoBetaNet; 1 day
|
"144" : // daoBetaNet; 1 day
|
||||||
|
@ -188,7 +188,7 @@ public enum Param {
|
||||||
ParamType.BLOCK, 2, 2),
|
ParamType.BLOCK, 2, 2),
|
||||||
PHASE_BREAK3(Config.baseCurrencyNetwork().isMainnet() ?
|
PHASE_BREAK3(Config.baseCurrencyNetwork().isMainnet() ?
|
||||||
"9" : // mainnet
|
"9" : // mainnet
|
||||||
Config.baseCurrencyNetwork().isRegtest() ?
|
Config.baseCurrencyNetwork().isStagenet() ?
|
||||||
"1" : // regtest
|
"1" : // regtest
|
||||||
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
||||||
"10" : // daoBetaNet
|
"10" : // daoBetaNet
|
||||||
|
@ -198,7 +198,7 @@ public enum Param {
|
||||||
ParamType.BLOCK, 2, 2),
|
ParamType.BLOCK, 2, 2),
|
||||||
PHASE_RESULT(Config.baseCurrencyNetwork().isMainnet() ?
|
PHASE_RESULT(Config.baseCurrencyNetwork().isMainnet() ?
|
||||||
"10" : // mainnet
|
"10" : // mainnet
|
||||||
Config.baseCurrencyNetwork().isRegtest() ?
|
Config.baseCurrencyNetwork().isStagenet() ?
|
||||||
"2" : // regtest
|
"2" : // regtest
|
||||||
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
Config.baseCurrencyNetwork().isDaoBetaNet() ?
|
||||||
"10" : // daoBetaNet
|
"10" : // daoBetaNet
|
||||||
|
|
|
@ -226,7 +226,7 @@ public class MyProposalListService implements PersistedDataHost, DaoStateListene
|
||||||
// of that cycle so it is 1 blind vote getting rebroadcast at each startup to my neighbors.
|
// of that cycle so it is 1 blind vote getting rebroadcast at each startup to my neighbors.
|
||||||
int minPeers = Config.baseCurrencyNetwork().isMainnet() ? 4 : 1;
|
int minPeers = Config.baseCurrencyNetwork().isMainnet() ? 4 : 1;
|
||||||
if ((p2PService.getNumConnectedPeers().get() >= minPeers && p2PService.isBootstrapped()) ||
|
if ((p2PService.getNumConnectedPeers().get() >= minPeers && p2PService.isBootstrapped()) ||
|
||||||
Config.baseCurrencyNetwork().isRegtest()) {
|
Config.baseCurrencyNetwork().isStagenet()) {
|
||||||
myProposalList.stream()
|
myProposalList.stream()
|
||||||
.filter(proposal -> periodService.isTxInPhaseAndCycle(proposal.getTxId(),
|
.filter(proposal -> periodService.isTxInPhaseAndCycle(proposal.getTxId(),
|
||||||
DaoPhase.Phase.PROPOSAL,
|
DaoPhase.Phase.PROPOSAL,
|
||||||
|
|
|
@ -112,7 +112,7 @@ public class GenesisTxInfo {
|
||||||
boolean isDaoTestNet = baseCurrencyNetwork.isDaoTestNet();
|
boolean isDaoTestNet = baseCurrencyNetwork.isDaoTestNet();
|
||||||
boolean isDaoBetaNet = baseCurrencyNetwork.isDaoBetaNet();
|
boolean isDaoBetaNet = baseCurrencyNetwork.isDaoBetaNet();
|
||||||
boolean isDaoRegTest = baseCurrencyNetwork.isDaoRegTest();
|
boolean isDaoRegTest = baseCurrencyNetwork.isDaoRegTest();
|
||||||
boolean isRegtest = baseCurrencyNetwork.isRegtest();
|
boolean isRegtest = baseCurrencyNetwork.isStagenet();
|
||||||
if (!genesisTxId.isEmpty()) {
|
if (!genesisTxId.isEmpty()) {
|
||||||
this.genesisTxId = genesisTxId;
|
this.genesisTxId = genesisTxId;
|
||||||
} else if (isMainnet) {
|
} else if (isMainnet) {
|
||||||
|
|
|
@ -95,7 +95,7 @@ public enum BondedRoleType {
|
||||||
this.requiredBondUnit = requiredBondUnit;
|
this.requiredBondUnit = requiredBondUnit;
|
||||||
this.unlockTimeInBlocks = Config.baseCurrencyNetwork().isMainnet() ?
|
this.unlockTimeInBlocks = Config.baseCurrencyNetwork().isMainnet() ?
|
||||||
unlockTimeInDays * 144 : // mainnet (144 blocks per day)
|
unlockTimeInDays * 144 : // mainnet (144 blocks per day)
|
||||||
Config.baseCurrencyNetwork().isRegtest() ?
|
Config.baseCurrencyNetwork().isStagenet() ?
|
||||||
5 : // regtest (arbitrarily low value for dev testing)
|
5 : // regtest (arbitrarily low value for dev testing)
|
||||||
144; // testnet (relatively short time for testing purposes)
|
144; // testnet (relatively short time for testing purposes)
|
||||||
this.link = link;
|
this.link = link;
|
||||||
|
|
|
@ -46,8 +46,8 @@ import org.jetbrains.annotations.NotNull;
|
||||||
public class Res {
|
public class Res {
|
||||||
public static void setup() {
|
public static void setup() {
|
||||||
BaseCurrencyNetwork baseCurrencyNetwork = Config.baseCurrencyNetwork();
|
BaseCurrencyNetwork baseCurrencyNetwork = Config.baseCurrencyNetwork();
|
||||||
setBaseCurrencyCode("XMR");
|
setBaseCurrencyCode(baseCurrencyNetwork.getCurrencyCode());
|
||||||
setBaseCurrencyName("Monero");
|
setBaseCurrencyName(baseCurrencyNetwork.getCurrencyName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CanBeFinal")
|
@SuppressWarnings("CanBeFinal")
|
||||||
|
@ -78,20 +78,20 @@ public class Res {
|
||||||
private static String baseCurrencyNameLowerCase;
|
private static String baseCurrencyNameLowerCase;
|
||||||
|
|
||||||
public static void setBaseCurrencyCode(String baseCurrencyCode) {
|
public static void setBaseCurrencyCode(String baseCurrencyCode) {
|
||||||
Res.baseCurrencyCode = "XMR";
|
Res.baseCurrencyCode = baseCurrencyCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setBaseCurrencyName(String baseCurrencyName) {
|
public static void setBaseCurrencyName(String baseCurrencyName) {
|
||||||
Res.baseCurrencyName = "Monero";
|
Res.baseCurrencyName = baseCurrencyName;
|
||||||
baseCurrencyNameLowerCase = baseCurrencyName.toLowerCase();
|
baseCurrencyNameLowerCase = baseCurrencyName.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getBaseCurrencyCode() {
|
public static String getBaseCurrencyCode() {
|
||||||
return "XMR";
|
return baseCurrencyCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getBaseCurrencyName() {
|
public static String getBaseCurrencyName() {
|
||||||
return "Monero";
|
return baseCurrencyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Capitalize first character
|
// Capitalize first character
|
||||||
|
|
|
@ -112,6 +112,7 @@ public class DefaultSeedNodeRepository implements SeedNodeRepository {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Collection<NodeAddress> getSeedNodeAddresses() {
|
public Collection<NodeAddress> getSeedNodeAddresses() {
|
||||||
if (cache.isEmpty())
|
if (cache.isEmpty())
|
||||||
reload();
|
reload();
|
||||||
|
@ -119,6 +120,7 @@ public class DefaultSeedNodeRepository implements SeedNodeRepository {
|
||||||
return cache;
|
return cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isSeedNode(NodeAddress nodeAddress) {
|
public boolean isSeedNode(NodeAddress nodeAddress) {
|
||||||
if (cache.isEmpty())
|
if (cache.isEmpty())
|
||||||
reload();
|
reload();
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class MakerSetsLockTime extends TradeTask {
|
||||||
|
|
||||||
// 10 days for altcoins, 20 days for other payment methods
|
// 10 days for altcoins, 20 days for other payment methods
|
||||||
// For regtest dev environment we use 5 blocks
|
// For regtest dev environment we use 5 blocks
|
||||||
int delay = Config.baseCurrencyNetwork().isRegtest() ?
|
int delay = Config.baseCurrencyNetwork().isStagenet() ?
|
||||||
5 :
|
5 :
|
||||||
Restrictions.getLockTime(processModel.getOffer().getPaymentMethod().isAsset());
|
Restrictions.getLockTime(processModel.getOffer().getPaymentMethod().isAsset());
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,12 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||||
new BlockChainExplorer("mempool.emzy.de (@emzy)", "https://mempool.emzy.de/bisq/tx/", "https://mempool.emzy.de/bisq/address/"),
|
new BlockChainExplorer("mempool.emzy.de (@emzy)", "https://mempool.emzy.de/bisq/tx/", "https://mempool.emzy.de/bisq/address/"),
|
||||||
new BlockChainExplorer("mempool.bisq.services (@devinbileck)", "https://mempool.bisq.services/bisq/tx/", "https://mempool.bisq.services/bisq/address/")
|
new BlockChainExplorer("mempool.bisq.services (@devinbileck)", "https://mempool.bisq.services/bisq/tx/", "https://mempool.bisq.services/bisq/address/")
|
||||||
));
|
));
|
||||||
|
private static final ArrayList<BlockChainExplorer> XMR_MAIN_NET_EXPLORERS = new ArrayList<>(Arrays.asList(
|
||||||
|
new BlockChainExplorer("xmrchain.net", "https://xmrchain.net/tx/", "")
|
||||||
|
));
|
||||||
|
private static final ArrayList<BlockChainExplorer> XMR_TEST_NET_EXPLORERS = new ArrayList<>(Arrays.asList(
|
||||||
|
new BlockChainExplorer("testnet.xmrchain.net", "https://testnet.xmrchain.net/tx/", "")
|
||||||
|
));
|
||||||
|
|
||||||
private static final ArrayList<String> XMR_TX_PROOF_SERVICES_CLEAR_NET = new ArrayList<>(Arrays.asList(
|
private static final ArrayList<String> XMR_TX_PROOF_SERVICES_CLEAR_NET = new ArrayList<>(Arrays.asList(
|
||||||
"xmrblocks.monero.emzy.de", // @emzy
|
"xmrblocks.monero.emzy.de", // @emzy
|
||||||
|
@ -284,9 +290,12 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||||
setCryptoCurrencies(CurrencyUtil.getMainCryptoCurrencies());
|
setCryptoCurrencies(CurrencyUtil.getMainCryptoCurrencies());
|
||||||
|
|
||||||
BaseCurrencyNetwork baseCurrencyNetwork = Config.baseCurrencyNetwork();
|
BaseCurrencyNetwork baseCurrencyNetwork = Config.baseCurrencyNetwork();
|
||||||
if ("BTC".equals(baseCurrencyNetwork.getCurrencyCode())) { // TODO (woodser): change to XMR when --baseCurrencyNetwork=XMR_REGTEST supported
|
if ("BTC".equals(baseCurrencyNetwork.getCurrencyCode())) {
|
||||||
setBlockChainExplorerMainNet(BTC_MAIN_NET_EXPLORERS.get(0));
|
setBlockChainExplorerMainNet(BTC_MAIN_NET_EXPLORERS.get(0));
|
||||||
setBlockChainExplorerTestNet(BTC_TEST_NET_EXPLORERS.get(0));
|
setBlockChainExplorerTestNet(BTC_TEST_NET_EXPLORERS.get(0));
|
||||||
|
} else if ("XMR".equals(baseCurrencyNetwork.getCurrencyCode())) {
|
||||||
|
setBlockChainExplorerMainNet(XMR_MAIN_NET_EXPLORERS.get(0));
|
||||||
|
setBlockChainExplorerTestNet(XMR_TEST_NET_EXPLORERS.get(0));
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("BaseCurrencyNetwork not defined. BaseCurrencyNetwork=" + baseCurrencyNetwork);
|
throw new RuntimeException("BaseCurrencyNetwork not defined. BaseCurrencyNetwork=" + baseCurrencyNetwork);
|
||||||
}
|
}
|
||||||
|
@ -829,10 +838,10 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||||
public BlockChainExplorer getBlockChainExplorer() {
|
public BlockChainExplorer getBlockChainExplorer() {
|
||||||
BaseCurrencyNetwork baseCurrencyNetwork = Config.baseCurrencyNetwork();
|
BaseCurrencyNetwork baseCurrencyNetwork = Config.baseCurrencyNetwork();
|
||||||
switch (baseCurrencyNetwork) {
|
switch (baseCurrencyNetwork) {
|
||||||
case BTC_MAINNET:
|
case XMR_MAINNET:
|
||||||
return prefPayload.getBlockChainExplorerMainNet();
|
return prefPayload.getBlockChainExplorerMainNet();
|
||||||
case BTC_TESTNET:
|
case XMR_TESTNET:
|
||||||
case BTC_REGTEST:
|
case XMR_STAGENET:
|
||||||
return prefPayload.getBlockChainExplorerTestNet();
|
return prefPayload.getBlockChainExplorerTestNet();
|
||||||
case BTC_DAO_TESTNET:
|
case BTC_DAO_TESTNET:
|
||||||
return BTC_DAO_TEST_NET_EXPLORERS.get(0);
|
return BTC_DAO_TEST_NET_EXPLORERS.get(0);
|
||||||
|
@ -848,10 +857,10 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||||
public ArrayList<BlockChainExplorer> getBlockChainExplorers() {
|
public ArrayList<BlockChainExplorer> getBlockChainExplorers() {
|
||||||
BaseCurrencyNetwork baseCurrencyNetwork = Config.baseCurrencyNetwork();
|
BaseCurrencyNetwork baseCurrencyNetwork = Config.baseCurrencyNetwork();
|
||||||
switch (baseCurrencyNetwork) {
|
switch (baseCurrencyNetwork) {
|
||||||
case BTC_MAINNET:
|
case XMR_MAINNET:
|
||||||
return BTC_MAIN_NET_EXPLORERS;
|
return BTC_MAIN_NET_EXPLORERS;
|
||||||
case BTC_TESTNET:
|
case XMR_TESTNET:
|
||||||
case BTC_REGTEST:
|
case XMR_STAGENET:
|
||||||
return BTC_TEST_NET_EXPLORERS;
|
return BTC_TEST_NET_EXPLORERS;
|
||||||
case BTC_DAO_TESTNET:
|
case BTC_DAO_TESTNET:
|
||||||
return BTC_DAO_TEST_NET_EXPLORERS;
|
return BTC_DAO_TEST_NET_EXPLORERS;
|
||||||
|
|
|
@ -18,7 +18,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
public class ParsingUtils {
|
public class ParsingUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Temporary multiplier to convert Coin satoshis to XMR atomic units.
|
* Temporary multiplier to convert Coin satoshis (denominating XMR centineros) to XMR atomic units.
|
||||||
*
|
*
|
||||||
* TODO (woodser): replace bitcoinj/Coin entirely?
|
* TODO (woodser): replace bitcoinj/Coin entirely?
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3149,11 +3149,11 @@ formatter.asTaker={0} {1} as taker
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Monero Mainnet
|
XMR_MAINNET=Monero Mainnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Monero Testnet
|
XMR_TESTNET=Monero Testnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Monero Regtest
|
XMR_STAGENET=Monero Stagenet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Monero DAO Testnet (deprecated)
|
BTC_DAO_TESTNET=Monero DAO Testnet (deprecated)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} jako příjemce
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Bitcoin Mainnet
|
XMR_MAINNET=Monero Mainnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Bitcoin Testnet
|
XMR_TESTNET=Monero Testnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Bitcoin Regtest
|
XMR_STAGENET=Monero Stagenet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Bitcoin DAO Testnet (zastaralé)
|
BTC_DAO_TESTNET=Bitcoin DAO Testnet (zastaralé)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} als Abnehmer
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Bitcoin-Hauptnetzwerk
|
XMR_MAINNET=Bitcoin-Hauptnetzwerk
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Bitcoin-Testnetzwerk
|
XMR_TESTNET=Bitcoin-Testnetzwerk
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Bitcoin-Regtest
|
XMR_STAGENET=Bitcoin-Regtest
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Bitcoin-DAO-Testnetzwerk (veraltet)
|
BTC_DAO_TESTNET=Bitcoin-DAO-Testnetzwerk (veraltet)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} como tomador
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Red principal de Bitcoin
|
XMR_MAINNET=Red principal de Monero
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Red de prueba de Bitcoin
|
XMR_TESTNET=Red de prueba de Monero
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Regtest Bitcoin
|
XMR_STAGENET=Stagenet Monero
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Testnet de Bitcoin DAO (depreciada)
|
BTC_DAO_TESTNET=Testnet de Bitcoin DAO (depreciada)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} به عنوان پذیرنده
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Bitcoin Mainnet
|
XMR_MAINNET=Monero Mainnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Bitcoin Testnet
|
XMR_TESTNET=Monero Testnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Bitcoin Regtest
|
XMR_STAGENET=Monero Stagenet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Bitcoin DAO Testnet (deprecated)
|
BTC_DAO_TESTNET=Bitcoin DAO Testnet (deprecated)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} en tant que taker
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Bitcoin Mainnet
|
XMR_MAINNET=Monero Mainnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Bitcoin Testnet
|
XMR_TESTNET=Monero Testnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Bitcoin Regtest
|
XMR_STAGENET=Monero Stagenet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Bitcoin DAO Testnet (obsolète)
|
BTC_DAO_TESTNET=Bitcoin DAO Testnet (obsolète)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} come taker
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Mainnet Bitcoin
|
XMR_MAINNET=Mainnet Bitcoin
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Testnet Bitcoin
|
XMR_TESTNET=Testnet Bitcoin
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Regtest Bitcoin
|
XMR_STAGENET=Regtest Bitcoin
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Testnet DAO Bitcoin (deprecata)
|
BTC_DAO_TESTNET=Testnet DAO Bitcoin (deprecata)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1}のテイカー
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=ビットコイン メインネット
|
XMR_MAINNET=Monero Mainnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=ビットコイン テストネット
|
XMR_TESTNET=Monero Testnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=ビットコイン(Regtest)
|
XMR_STAGENET=Monero Stagenet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=ビットコインDAOテストネット(非推奨)
|
BTC_DAO_TESTNET=ビットコインDAOテストネット(非推奨)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} como aceitador
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Mainnet do Bitcoin
|
XMR_MAINNET=Mainnet do Monero
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Testnet do Bitcoin
|
XMR_TESTNET=Testnet do Monero
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Regtest do Bitcoin
|
XMR_STAGENET=Stagenet do Monero
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Testnet da DAO do Bitcoin (descontinuada)
|
BTC_DAO_TESTNET=Testnet da DAO do Bitcoin (descontinuada)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} como aceitador
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Mainnet de Bitcoin
|
XMR_MAINNET=Mainnet de Monero
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Testnet de Bitcoin
|
XMR_TESTNET=Testnet de Monero
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Regtest Bitcoin
|
XMR_STAGENET=Stagenet Monero
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Testnet da OAD do Bitcoin (discontinuada)
|
BTC_DAO_TESTNET=Testnet da OAD do Bitcoin (discontinuada)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} как тейкер
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Осн. сеть Биткойн
|
XMR_MAINNET=XMR Mainnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Тестовая сеть Биткойн
|
XMR_TESTNET=XMR Testnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Режим регрессионного тестирования в сети Биткойн
|
XMR_STAGENET=XMR Stagenet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Тестовая сеть ДАО Биткойн (устаревшая)
|
BTC_DAO_TESTNET=Тестовая сеть ДАО Биткойн (устаревшая)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} ในฐานะคนรับ
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Bitcoin Mainnet
|
XMR_MAINNET=Monero Mainnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Bitcoin Testnet
|
XMR_TESTNET=Monero Testnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Bitcoin Regtest
|
XMR_STAGENET=Monero Stagenet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Bitcoin DAO Testnet (deprecated)
|
BTC_DAO_TESTNET=Bitcoin DAO Testnet (deprecated)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} như người nhận
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=Bitcoin Mainnet
|
XMR_MAINNET=Bitcoin Mainnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=Bitcoin Testnet
|
XMR_TESTNET=Bitcoin Testnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=Bitcoin Regtest
|
XMR_STAGENET=Bitcoin Regtest
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=Bitcoin DAO Testnet (không tán thành)
|
BTC_DAO_TESTNET=Bitcoin DAO Testnet (không tán thành)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} 是买家
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=比特币主干网络
|
XMR_MAINNET=XMR Mainnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=比特币测试网络
|
XMR_TESTNET=XMR Testnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=比特币回归测试
|
XMR_STAGENET=XMR Stagenet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=比特币 DAO 测试网络(弃用)
|
BTC_DAO_TESTNET=比特币 DAO 测试网络(弃用)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
|
@ -2553,11 +2553,11 @@ formatter.asTaker={0} {1} 是買家
|
||||||
# we use enum values here
|
# we use enum values here
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_MAINNET=比特幣主幹網絡
|
XMR_MAINNET=XMR Mainnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_TESTNET=比特幣測試網絡
|
XMR_TESTNET=XMR Testnet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_REGTEST=比特幣迴歸測試
|
XMR_STAGENET=XMR Stagenet
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
BTC_DAO_TESTNET=比特幣 DAO 測試網絡(棄用)
|
BTC_DAO_TESTNET=比特幣 DAO 測試網絡(棄用)
|
||||||
# suppress inspection "UnusedProperty"
|
# suppress inspection "UnusedProperty"
|
||||||
|
|
2
core/src/main/resources/xmr_mainnet.seednodes
Normal file
2
core/src/main/resources/xmr_mainnet.seednodes
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# nodeaddress.onion:port [(@owner,@backup)]
|
||||||
|
placeholder.onion:8000 (@placeholder)
|
3
core/src/main/resources/xmr_stagenet.seednodes
Normal file
3
core/src/main/resources/xmr_stagenet.seednodes
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# nodeaddress.onion:port [(@owner,@backup)]
|
||||||
|
localhost:2002 (@devtest1)
|
||||||
|
localhost:3002 (@devtest2)
|
2
core/src/main/resources/xmr_testnet.seednodes
Normal file
2
core/src/main/resources/xmr_testnet.seednodes
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# nodeaddress.onion:port [(@owner)]
|
||||||
|
placeholder.onion:8001
|
|
@ -68,28 +68,28 @@ public class CurrencyUtilTest {
|
||||||
boolean daoTradingActivated = false;
|
boolean daoTradingActivated = false;
|
||||||
// Test if BSQ on mainnet is failing
|
// Test if BSQ on mainnet is failing
|
||||||
Assert.assertFalse(CurrencyUtil.findAsset(assetRegistry, "BSQ",
|
Assert.assertFalse(CurrencyUtil.findAsset(assetRegistry, "BSQ",
|
||||||
BaseCurrencyNetwork.BTC_MAINNET, daoTradingActivated).isPresent());
|
BaseCurrencyNetwork.XMR_MAINNET, daoTradingActivated).isPresent());
|
||||||
|
|
||||||
// on testnet/regtest it is allowed
|
// on testnet/regtest it is allowed
|
||||||
assertEquals(CurrencyUtil.findAsset(assetRegistry, "BSQ",
|
assertEquals(CurrencyUtil.findAsset(assetRegistry, "BSQ",
|
||||||
BaseCurrencyNetwork.BTC_TESTNET, daoTradingActivated).get().getTickerSymbol(), "BSQ");
|
BaseCurrencyNetwork.XMR_TESTNET, daoTradingActivated).get().getTickerSymbol(), "BSQ");
|
||||||
|
|
||||||
|
|
||||||
daoTradingActivated = true;
|
daoTradingActivated = true;
|
||||||
// With daoTradingActivated we can request BSQ
|
// With daoTradingActivated we can request BSQ
|
||||||
assertEquals(CurrencyUtil.findAsset(assetRegistry, "BSQ",
|
assertEquals(CurrencyUtil.findAsset(assetRegistry, "BSQ",
|
||||||
BaseCurrencyNetwork.BTC_MAINNET, daoTradingActivated).get().getTickerSymbol(), "BSQ");
|
BaseCurrencyNetwork.XMR_MAINNET, daoTradingActivated).get().getTickerSymbol(), "BSQ");
|
||||||
|
|
||||||
// Test if not matching ticker is failing
|
// Test if not matching ticker is failing
|
||||||
Assert.assertFalse(CurrencyUtil.findAsset(assetRegistry, "BSQ1",
|
Assert.assertFalse(CurrencyUtil.findAsset(assetRegistry, "BSQ1",
|
||||||
BaseCurrencyNetwork.BTC_MAINNET, daoTradingActivated).isPresent());
|
BaseCurrencyNetwork.XMR_MAINNET, daoTradingActivated).isPresent());
|
||||||
|
|
||||||
// Add a mock coin which has no mainnet version, needs to fail if we are on mainnet
|
// Add a mock coin which has no mainnet version, needs to fail if we are on mainnet
|
||||||
MockTestnetCoin.Testnet mockTestnetCoin = new MockTestnetCoin.Testnet();
|
MockTestnetCoin.Testnet mockTestnetCoin = new MockTestnetCoin.Testnet();
|
||||||
try {
|
try {
|
||||||
assetRegistry.addAsset(mockTestnetCoin);
|
assetRegistry.addAsset(mockTestnetCoin);
|
||||||
CurrencyUtil.findAsset(assetRegistry, "MOCK_COIN",
|
CurrencyUtil.findAsset(assetRegistry, "MOCK_COIN",
|
||||||
BaseCurrencyNetwork.BTC_MAINNET, daoTradingActivated);
|
BaseCurrencyNetwork.XMR_MAINNET, daoTradingActivated);
|
||||||
Assert.fail("Expected an IllegalArgumentException");
|
Assert.fail("Expected an IllegalArgumentException");
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
String wantMessage = "We are on mainnet and we could not find an asset with network type mainnet";
|
String wantMessage = "We are on mainnet and we could not find an asset with network type mainnet";
|
||||||
|
@ -99,34 +99,34 @@ public class CurrencyUtilTest {
|
||||||
|
|
||||||
// For testnet its ok
|
// For testnet its ok
|
||||||
assertEquals(CurrencyUtil.findAsset(assetRegistry, "MOCK_COIN",
|
assertEquals(CurrencyUtil.findAsset(assetRegistry, "MOCK_COIN",
|
||||||
BaseCurrencyNetwork.BTC_TESTNET, daoTradingActivated).get().getTickerSymbol(), "MOCK_COIN");
|
BaseCurrencyNetwork.XMR_TESTNET, daoTradingActivated).get().getTickerSymbol(), "MOCK_COIN");
|
||||||
assertEquals(Coin.Network.TESTNET, mockTestnetCoin.getNetwork());
|
assertEquals(Coin.Network.TESTNET, mockTestnetCoin.getNetwork());
|
||||||
|
|
||||||
// For regtest its still found
|
// For regtest its still found
|
||||||
assertEquals(CurrencyUtil.findAsset(assetRegistry, "MOCK_COIN",
|
assertEquals(CurrencyUtil.findAsset(assetRegistry, "MOCK_COIN",
|
||||||
BaseCurrencyNetwork.BTC_REGTEST, daoTradingActivated).get().getTickerSymbol(), "MOCK_COIN");
|
BaseCurrencyNetwork.XMR_STAGENET, daoTradingActivated).get().getTickerSymbol(), "MOCK_COIN");
|
||||||
|
|
||||||
|
|
||||||
// We test if we are not on mainnet to get the mainnet coin
|
// We test if we are not on mainnet to get the mainnet coin
|
||||||
Coin ether = new Ether();
|
Coin ether = new Ether();
|
||||||
assertEquals(CurrencyUtil.findAsset(assetRegistry, "ETH",
|
assertEquals(CurrencyUtil.findAsset(assetRegistry, "ETH",
|
||||||
BaseCurrencyNetwork.BTC_TESTNET, daoTradingActivated).get().getTickerSymbol(), "ETH");
|
BaseCurrencyNetwork.XMR_TESTNET, daoTradingActivated).get().getTickerSymbol(), "ETH");
|
||||||
assertEquals(CurrencyUtil.findAsset(assetRegistry, "ETH",
|
assertEquals(CurrencyUtil.findAsset(assetRegistry, "ETH",
|
||||||
BaseCurrencyNetwork.BTC_REGTEST, daoTradingActivated).get().getTickerSymbol(), "ETH");
|
BaseCurrencyNetwork.XMR_STAGENET, daoTradingActivated).get().getTickerSymbol(), "ETH");
|
||||||
assertEquals(Coin.Network.MAINNET, ether.getNetwork());
|
assertEquals(Coin.Network.MAINNET, ether.getNetwork());
|
||||||
|
|
||||||
// We test if network matches exactly if there are distinct network types defined like with BSQ
|
// We test if network matches exactly if there are distinct network types defined like with BSQ
|
||||||
Coin bsq = (Coin) CurrencyUtil.findAsset(assetRegistry, "BSQ", BaseCurrencyNetwork.BTC_MAINNET, daoTradingActivated).get();
|
Coin bsq = (Coin) CurrencyUtil.findAsset(assetRegistry, "BSQ", BaseCurrencyNetwork.XMR_MAINNET, daoTradingActivated).get();
|
||||||
assertEquals("BSQ", bsq.getTickerSymbol());
|
assertEquals("BSQ", bsq.getTickerSymbol());
|
||||||
assertEquals(Coin.Network.MAINNET, bsq.getNetwork());
|
assertEquals(Coin.Network.MAINNET, bsq.getNetwork());
|
||||||
|
|
||||||
bsq = (Coin) CurrencyUtil.findAsset(assetRegistry, "BSQ", BaseCurrencyNetwork.BTC_TESTNET, daoTradingActivated).get();
|
bsq = (Coin) CurrencyUtil.findAsset(assetRegistry, "BSQ", BaseCurrencyNetwork.XMR_TESTNET, daoTradingActivated).get();
|
||||||
assertEquals("BSQ", bsq.getTickerSymbol());
|
assertEquals("BSQ", bsq.getTickerSymbol());
|
||||||
assertEquals(Coin.Network.TESTNET, bsq.getNetwork());
|
assertEquals(Coin.Network.TESTNET, bsq.getNetwork());
|
||||||
|
|
||||||
bsq = (Coin) CurrencyUtil.findAsset(assetRegistry, "BSQ", BaseCurrencyNetwork.BTC_REGTEST, daoTradingActivated).get();
|
bsq = (Coin) CurrencyUtil.findAsset(assetRegistry, "BSQ", BaseCurrencyNetwork.XMR_STAGENET, daoTradingActivated).get();
|
||||||
assertEquals("BSQ", bsq.getTickerSymbol());
|
assertEquals("BSQ", bsq.getTickerSymbol());
|
||||||
assertEquals(Coin.Network.REGTEST, bsq.getNetwork());
|
assertEquals(Coin.Network.STAGENET, bsq.getNetwork());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class MockTestnetCoin extends Coin {
|
||||||
public static class Regtest extends MockTestnetCoin {
|
public static class Regtest extends MockTestnetCoin {
|
||||||
|
|
||||||
public Regtest() {
|
public Regtest() {
|
||||||
super(Network.REGTEST, RegTestParams.get());
|
super(Network.STAGENET, RegTestParams.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -584,7 +584,7 @@ public class ProposalDisplay {
|
||||||
} else if (proposal instanceof RemoveAssetProposal) {
|
} else if (proposal instanceof RemoveAssetProposal) {
|
||||||
RemoveAssetProposal removeAssetProposal = (RemoveAssetProposal) proposal;
|
RemoveAssetProposal removeAssetProposal = (RemoveAssetProposal) proposal;
|
||||||
checkNotNull(assetComboBox, "assetComboBox must not be null");
|
checkNotNull(assetComboBox, "assetComboBox must not be null");
|
||||||
CurrencyUtil.findAsset(removeAssetProposal.getTickerSymbol(), BaseCurrencyNetwork.BTC_MAINNET)
|
CurrencyUtil.findAsset(removeAssetProposal.getTickerSymbol(), BaseCurrencyNetwork.XMR_MAINNET)
|
||||||
.ifPresent(asset -> {
|
.ifPresent(asset -> {
|
||||||
assetComboBox.getSelectionModel().select(asset);
|
assetComboBox.getSelectionModel().select(asset);
|
||||||
comboBoxValueTextField.setText(assetComboBox.getConverter().toString(asset));
|
comboBoxValueTextField.setText(assetComboBox.getConverter().toString(asset));
|
||||||
|
|
|
@ -51,12 +51,12 @@ public class InventoryMonitorMain {
|
||||||
private static InventoryMonitor inventoryMonitor;
|
private static InventoryMonitor inventoryMonitor;
|
||||||
private static boolean stopped;
|
private static boolean stopped;
|
||||||
|
|
||||||
// prog args for regtest: 10 1 BTC_REGTEST
|
// prog args for regtest: 10 1 XMR_STAGENET
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// Default values
|
// Default values
|
||||||
int intervalSec = 120;
|
int intervalSec = 120;
|
||||||
boolean useLocalhostForP2P = false;
|
boolean useLocalhostForP2P = false;
|
||||||
BaseCurrencyNetwork network = BaseCurrencyNetwork.BTC_MAINNET;
|
BaseCurrencyNetwork network = BaseCurrencyNetwork.XMR_MAINNET;
|
||||||
int port = 80;
|
int port = 80;
|
||||||
|
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ A sample configuration file looks like follows:
|
||||||
# true overwrites the reporters picked by the developers (for debugging for example) (defaults to false)
|
# true overwrites the reporters picked by the developers (for debugging for example) (defaults to false)
|
||||||
System.useConsoleReporter=true
|
System.useConsoleReporter=true
|
||||||
|
|
||||||
# 0 -> BTC_MAINNET, 1 -> BTC_TESTNET (default)
|
# 0 -> XMR_MAINNET, 1 -> XMR_TESTNET (default)
|
||||||
System.baseCurrencyNetwork=0
|
System.baseCurrencyNetwork=0
|
||||||
|
|
||||||
## Each Metric is configured via a set of properties.
|
## Each Metric is configured via a set of properties.
|
||||||
|
|
|
@ -91,7 +91,7 @@ public abstract class Metric extends Configurable implements Runnable {
|
||||||
super.configure(properties);
|
super.configure(properties);
|
||||||
reporter.configure(properties);
|
reporter.configure(properties);
|
||||||
|
|
||||||
Version.setBaseCryptoNetworkId(Integer.parseInt(properties.getProperty("System." + BASE_CURRENCY_NETWORK, "1"))); // defaults to BTC_TESTNET
|
Version.setBaseCryptoNetworkId(Integer.parseInt(properties.getProperty("System." + BASE_CURRENCY_NETWORK, "1"))); // defaults to XMR_TESTNET
|
||||||
|
|
||||||
// decide whether to enable or disable the task
|
// decide whether to enable or disable the task
|
||||||
if (configuration.isEmpty() || !configuration.getProperty("enabled", "false").equals("true")
|
if (configuration.isEmpty() || !configuration.getProperty("enabled", "false").equals("true")
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# true overwrites the reporters picked by the developers (for debugging for example) (defaults to false)
|
# true overwrites the reporters picked by the developers (for debugging for example) (defaults to false)
|
||||||
System.useConsoleReporter=true
|
System.useConsoleReporter=true
|
||||||
|
|
||||||
# 0 -> BTC_MAINNET, 1 -> BTC_TESTNET (default)
|
# 0 -> XMR_MAINNET, 1 -> XMR_TESTNET (default)
|
||||||
System.baseCurrencyNetwork=0
|
System.baseCurrencyNetwork=0
|
||||||
|
|
||||||
## Each Metric is configured via a set of properties.
|
## Each Metric is configured via a set of properties.
|
||||||
|
|
|
@ -586,6 +586,7 @@ message BalancesInfo {
|
||||||
// balancesInfo.getBtcBalanceInfo().getAvailableBalance().
|
// balancesInfo.getBtcBalanceInfo().getAvailableBalance().
|
||||||
BsqBalanceInfo bsq = 1;
|
BsqBalanceInfo bsq = 1;
|
||||||
BtcBalanceInfo btc = 2;
|
BtcBalanceInfo btc = 2;
|
||||||
|
XmrBalanceInfo xmr = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message BsqBalanceInfo {
|
message BsqBalanceInfo {
|
||||||
|
@ -604,6 +605,14 @@ message BtcBalanceInfo {
|
||||||
uint64 lockedBalance = 4;
|
uint64 lockedBalance = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message XmrBalanceInfo {
|
||||||
|
uint64 balance = 1;
|
||||||
|
uint64 availableBalance = 2;
|
||||||
|
uint64 lockedBalance = 3;
|
||||||
|
uint64 reservedBalance = 4;
|
||||||
|
uint64 totalBalance = 5; // balance + reserved
|
||||||
|
}
|
||||||
|
|
||||||
message AddressBalanceInfo {
|
message AddressBalanceInfo {
|
||||||
string address = 1;
|
string address = 1;
|
||||||
int64 balance = 2;
|
int64 balance = 2;
|
||||||
|
|
|
@ -10,7 +10,7 @@ services:
|
||||||
- 8000:8000
|
- 8000:8000
|
||||||
environment:
|
environment:
|
||||||
- NODE_PORT=8000
|
- NODE_PORT=8000
|
||||||
- BASE_CURRENCY_NETWORK=BTC_REGTEST
|
- BASE_CURRENCY_NETWORK=XMR_STAGENET
|
||||||
- SEED_NODES=seednode:8000
|
- SEED_NODES=seednode:8000
|
||||||
- MY_ADDRESS=seednode:8000
|
- MY_ADDRESS=seednode:8000
|
||||||
- USE_LOCALHOST_FOR_P2P=true
|
- USE_LOCALHOST_FOR_P2P=true
|
||||||
|
|
|
@ -176,9 +176,9 @@ public class SeedNodeMain extends ExecutableForAppWithP2p {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupConnectionLossCheck() {
|
private void setupConnectionLossCheck() {
|
||||||
// For dev testing (usually on BTC_REGTEST) we don't want to get the seed shut
|
// For dev testing (usually on XMR_STAGENET) we don't want to get the seed shut
|
||||||
// down as it is normal that the seed is the only actively running node.
|
// down as it is normal that the seed is the only actively running node.
|
||||||
if (Config.baseCurrencyNetwork() == BaseCurrencyNetwork.BTC_REGTEST) {
|
if (Config.baseCurrencyNetwork() == BaseCurrencyNetwork.XMR_STAGENET) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue