use of org.bitcoinj.kits.WalletAppKit in project cryptoputty by alokmenghrajani.
the class CryptoputtyApplication method initialize.
@Override
public void initialize(final Bootstrap<CryptoputtyConfiguration> bootstrap) {
bootstrap.addBundle(new ViewBundle<>());
NetworkParameters params = TestNet3Params.get();
File tempDir = Files.createTempDir();
tempDir.deleteOnExit();
kit = new WalletAppKit(params, tempDir, "cryptoputty");
try {
kit.restoreWalletFromSeed(new DeterministicSeed("office suit release flame robust know depth truly swim bird quality reopen", null, "", 1522261414L));
kit.setBlockingStartup(false);
kit.setAutoSave(true);
kit.startAsync();
kit.awaitRunning();
// Perhaps having bloom filters doesn't hurt since we don't plan to do anything
// kit.peerGroup().setBloomFilteringEnabled(false);
// I have no idea what I'm doing, but let's increase these max values.
kit.peerGroup().setMaxPeersToDiscoverCount(10000);
kit.peerGroup().setMaxConnections(5000);
log.info(format("send money to: %s", kit.wallet().freshReceiveAddress().toString()));
log.info("done initializing");
} catch (UnreadableWalletException e) {
e.printStackTrace();
}
}
Aggregations