private NetworkParameters getNetworkParameters() { return NetworkParameters.fromID(NetworkParameters.ID_MAINNET); }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); params = NetworkParameters.fromID(in.readUTF()); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); params = NetworkParameters.fromID(in.readUTF()); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); params = NetworkParameters.fromID(in.readUTF()); }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); params = NetworkParameters.fromID(in.readUTF()); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); params = checkNotNull(NetworkParameters.fromID(in.readUTF())); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); params = checkNotNull(NetworkParameters.fromID(in.readUTF())); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); params = checkNotNull(NetworkParameters.fromID(in.readUTF())); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); params = checkNotNull(NetworkParameters.fromID(in.readUTF())); } }
@JsonCreator public RpcConfig(@JsonProperty("netid") String netIdString, @JsonProperty("uri") String uri, @JsonProperty("username") String username, @JsonProperty("password") String password) throws URISyntaxException { this(NetworkParameters.fromID(netIdString), new URI(uri), username, password); }
public Btcd(NetworkParameters netParams, String rpcuser, String rpcpass) throws MalformedURLException { super(netParams, 0); this.rpcuser = rpcuser; this.rpcpass = rpcpass; if (netParams.equals(NetworkParameters.fromID(NetworkParameters.ID_MAINNET))) { url = new URL("http://127.0.0.1:8334"); } else if (netParams.equals(NetworkParameters.fromID(NetworkParameters.ID_TESTNET))) { url = new URL("http://127.0.0.1:18334"); } else { throw new IllegalArgumentException("Invalid network parameters passed to btcd. "); } }
public MockBitcoin() { super(NetworkParameters.fromID(NetworkParameters.ID_TESTNET), 3); }
public BitcoinCrypto(NetworkParameters networkParameters, DeterministicSeed seed) throws Exception, NoSuchAlgorithmException { this.params = NetworkParameters.fromID(networkParameters.getId()); this.keyChainGroup = new KeyChainGroup(networkParameters, seed); Security.insertProviderAt(new BouncyCastleProvider(), 1); crashIfJCEMissing(); //this.sr = SecureRandom.getInstance("SHA1PRNG", new BouncyCastleProvider()); this.sr = SecureRandom.getInstance("SHA1PRNG"); this.keyPG = KeyPairGenerator.getInstance("ECIES", new BouncyCastleProvider()); //this.kit = initKit(seed); //this.wallet = kit.wallet(); }
public BitcoinCrypto(NetworkParameters networkParameters) throws NoSuchAlgorithmException, Exception { this.params = NetworkParameters.fromID(networkParameters.getId()); this.keyChainGroup = new KeyChainGroup(networkParameters); Security.insertProviderAt(new BouncyCastleProvider(), 1); crashIfJCEMissing(); //this.sr = SecureRandom.getInstance("SHA1PRNG", new BouncyCastleProvider()); this.sr = SecureRandom.getInstance("SHA1PRNG"); this.keyPG = KeyPairGenerator.getInstance("ECIES", new BouncyCastleProvider()); //this.kit = getKit(); //this.wallet = getKit().wallet(); }
private Wallet generateNewWallet() { final Wallet wallet = new Wallet(NetworkParameters.fromID(NetworkParameters.ID_MAINNET)); final DeterministicSeed seed = wallet.getKeyChainSeed(); this.masterSeed = seedToString(seed); return wallet; }
/** * Cheap test to see if input stream is a wallet. This checks for a magic value at the beginning of the stream. * * @param is * input stream to test * @return true if input stream is a wallet */ public static boolean isWallet(InputStream is) { try { final CodedInputStream cis = CodedInputStream.newInstance(is); final int tag = cis.readTag(); final int field = WireFormat.getTagFieldNumber(tag); if (field != 1) // network_identifier return false; final String network = cis.readString(); return NetworkParameters.fromID(network) != null; } catch (IOException x) { return false; } } }
/** * Cheap test to see if input stream is a wallet. This checks for a magic value at the beginning of the stream. * * @param is * input stream to test * @return true if input stream is a wallet */ public static boolean isWallet(InputStream is) { try { final CodedInputStream cis = CodedInputStream.newInstance(is); final int tag = cis.readTag(); final int field = WireFormat.getTagFieldNumber(tag); if (field != 1) // network_identifier return false; final String network = cis.readString(); return NetworkParameters.fromID(network) != null; } catch (IOException x) { return false; } } }
/** * Cheap test to see if input stream is a wallet. This checks for a magic value at the beginning of the stream. * * @param is * input stream to test * @return true if input stream is a wallet */ public static boolean isWallet(InputStream is) { try { final CodedInputStream cis = CodedInputStream.newInstance(is); final int tag = cis.readTag(); final int field = WireFormat.getTagFieldNumber(tag); if (field != 1) // network_identifier return false; final String network = cis.readString(); return NetworkParameters.fromID(network) != null; } catch (IOException x) { return false; } } }
RealTestCase(String session) throws BitcoinCrypto.Exception, NoSuchAlgorithmException { super(new Bytestring(("CoinShuffle Shufflepuff " + session).getBytes()), defaultType, defaultAmount, defaultFee); crypto = new BitcoinCrypto(NetworkParameters.fromID(NetworkParameters.ID_TESTNET)); }
@Test public void testGetParams() throws Exception { assertEquals("Test that default params are testnet",NetworkParameters.fromID(NetworkParameters.ID_TESTNET),bitcoinCryptoNoP.getParams()); // assertEquals("Test for mainnet params that got parsed to constructor ",NetworkParameters.fromID(NetworkParameters.ID_MAINNET),bitcoinCryptoMain.getParams()); assertEquals(NetworkParameters.ID_TESTNET,bitcoinCryptoNoP.getParams().getId()); }