/** Returns a standard regression test params (similar to unitTests) */ @Deprecated public static NetworkParameters regTests() { return RegTestParams.get(); }
/** * Construct a BitcoinClient from URI, user name, and password. * @param server URI of the Bitcoin RPC server * @param rpcuser Username (if required) * @param rpcpassword Password (if required) * @deprecated You need to specify NetworkParameters, this constructor defaults to RegTest * @see BitcoinClient#BitcoinClient(NetworkParameters, URI, String, String) */ @Deprecated public BitcoinClient(URI server, String rpcuser, String rpcpassword) { this(RegTestParams.get(), server, rpcuser, rpcpassword); }
/** Returns a standard regression test params (similar to unitTests) */ @Deprecated public static NetworkParameters regTests() { return RegTestParams.get(); }
/** Returns a standard regression test params (similar to unitTests) */ @Deprecated public static NetworkParameters regTests() { return RegTestParams.get(); }
/** Returns a standard regression test context (similar to unitTests) */ @Deprecated public static NetworkParameters regTests() { return RegTestParams.get(); }
@Deprecated public BitcoinExtendedClient(URI server, String rpcuser, String rpcpassword) { super(RegTestParams.get(), server, rpcuser, rpcpassword); }
@Deprecated public RpcConfig(URI uri, String username, String password) { this(RegTestParams.get(), uri, username, password); }
public ExamplePaymentChannelClient() { channelSize = CENT; myKey = new ECKey(); params = RegTestParams.get(); }
/** Returns the network parameters for the given string paymentProtocolID or NULL if not recognized. */ @Nullable public static NetworkParameters fromPmtProtocolID(String pmtProtocolId) { if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_MAINNET)) { return MainNetParams.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_TESTNET)) { return TestNet3Params.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_UNIT_TESTS)) { return UnitTestParams.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_REGTEST)) { return RegTestParams.get(); } else { return null; } }
/** Returns the network parameters for the given string ID or NULL if not recognized. */ @Nullable public static NetworkParameters fromID(String id) { if (id.equals(ID_MAINNET)) { return MainNetParams.get(); } else if (id.equals(ID_TESTNET)) { return TestNet3Params.get(); } else if (id.equals(ID_UNITTESTNET)) { return UnitTestParams.get(); } else if (id.equals(ID_REGTEST)) { return RegTestParams.get(); } else { return null; } }
/** Returns the network parameters for the given string ID or NULL if not recognized. */ @Nullable public static NetworkParameters fromID(String id) { if (id.equals(ID_MAINNET)) { return MainNetParams.get(); } else if (id.equals(ID_TESTNET)) { return TestNet3Params.get(); } else if (id.equals(ID_UNITTESTNET)) { return UnitTestParams.get(); } else if (id.equals(ID_REGTEST)) { return RegTestParams.get(); } else { return null; } }
public static NetworkParameters getNetworkParams(BitcoinNet bitcoinNet) { switch (bitcoinNet) { case REGTEST: return RegTestParams.get(); case TESTNET: return TestNet3Params.get(); case MAINNET: return MainNetParams.get(); default: throw new RuntimeException("Please set the server property io.iconator.commons.bitcoin.network to " + "(regtest|testnet|main)"); } }
/** Returns the network parameters for the given string paymentProtocolID or NULL if not recognized. */ @Nullable public static NetworkParameters fromPmtProtocolID(String pmtProtocolId) { if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_MAINNET)) { return MainNetParams.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_TESTNET)) { return TestNet3Params.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_UNIT_TESTS)) { return UnitTestParams.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_REGTEST)) { return RegTestParams.get(); } else { return null; } }
/** Returns the network parameters for the given string ID or NULL if not recognized. */ @Nullable public static NetworkParameters fromID(String id) { if (id.equals(ID_MAINNET)) { return MainNetParams.get(); } else if (id.equals(ID_TESTNET)) { return TestNet3Params.get(); } else if (id.equals(ID_UNITTESTNET)) { return UnitTestParams.get(); } else if (id.equals(ID_REGTEST)) { return RegTestParams.get(); } else { return null; } }
/** Returns the network parameters for the given string paymentProtocolID or NULL if not recognized. */ @Nullable public static NetworkParameters fromPmtProtocolID(String pmtProtocolId) { if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_MAINNET)) { return MainNetParams.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_TESTNET)) { return TestNet3Params.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_UNIT_TESTS)) { return UnitTestParams.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_REGTEST)) { return RegTestParams.get(); } else { return null; } }
/** Returns the network parameters for the given string paymentProtocolID or NULL if not recognized. */ @Nullable public static NetworkParameters fromPmtProtocolID(String pmtProtocolId) { if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_MAINNET)) { return MainNetParams.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_TESTNET)) { return TestNet3Params.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_UNIT_TESTS)) { return UnitTestParams.get(); } else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_REGTEST)) { return RegTestParams.get(); } else { return null; } }
public NetworkParameters get() { switch(this) { case MAIN: case PROD: return MainNetParams.get(); case TEST: return TestNet3Params.get(); case REGTEST: default: return RegTestParams.get(); } } }
public BitcoinExtendedClient(RpcConfig config) { super(RegTestParams.get(), config.getURI(), config.getUsername(), config.getPassword()); }
@Bean @ConditionalOnMissingBean public NetworkParameters params() { BriefLogFormatter.init(); NetworkParameters params = MainNetParams.get(); if (properties.getNetwork().equals(Network.TEST_NET)) { params = TestNet3Params.get(); } else if (properties.getNetwork().equals(Network.REGTEST_NET)) { params = RegTestParams.get(); } else if (properties.getNetwork().equals(Network.MAIN_NET)) { params = MainNetParams.get(); } return params; }
public static boolean isSelectable(Transaction tx, boolean usingInstantX) { // Only pick chain-included transactions, or transactions that are pending (whether ours or not). // InstantSend requires 6 confirmations TransactionConfidence confidence = tx.getConfidence(); TransactionConfidence.ConfidenceType type = confidence.getConfidenceType(); return (type.equals(TransactionConfidence.ConfidenceType.BUILDING) && (usingInstantX ? confidence.getDepthInBlocks() >= 6 : true)) || type.equals(TransactionConfidence.ConfidenceType.PENDING) && (usingInstantX ? false : true) && // In regtest mode we expect to have only one peer, so we won't see transactions propagate. // TODO: The value 1 below dates from a time when transactions we broadcast *to* were counted, set to 0 (confidence.numBroadcastPeers() > 1 || tx.getParams() == RegTestParams.get()); } }