@PostConstruct public void start() { peerGroup.startAsync(); }
/** Does a blocking startup. */ public void start() { Futures.getUnchecked(startAsync()); }
/** Does a blocking startup. */ public void start() { Futures.getUnchecked(startAsync()); }
/** Does a blocking startup. */ public void start() { Futures.getUnchecked(startAsync()); }
/** Does a blocking startup. */ public void start() { Futures.getUnchecked(startAsync()); }
public PeerMonitor() { setupNetwork(); setupGUI(); peerGroup.startAsync(); }
peerGroup.startAsync(); log.debug("Started peer group.");
peerGroup.startAsync(); peerGroup.startBlockChainDownload(blockchainDownloadListener);
public static void main(String[] args) throws Exception { File file = new File(args[0]); Wallet wallet = Wallet.loadFromFile(file); System.out.println(wallet.toString()); // Set up the components and link them together. final NetworkParameters params = TestNet3Params.get(); BlockStore blockStore = new MemoryBlockStore(params); BlockChain chain = new BlockChain(params, wallet, blockStore); final PeerGroup peerGroup = new PeerGroup(params, chain); peerGroup.startAsync(); wallet.addCoinsReceivedEventListener(new WalletCoinsReceivedEventListener() { @Override public synchronized void onCoinsReceived(Wallet w, Transaction tx, Coin prevBalance, Coin newBalance) { System.out.println("\nReceived tx " + tx.getHashAsString()); System.out.println(tx.toString()); } }); // Now download and process the block chain. peerGroup.downloadBlockChain(); peerGroup.stopAsync(); wallet.saveToFile(file); System.out.println("\nDone!\n"); System.out.println(wallet.toString()); } }
listener.await(); } else { Futures.addCallback(vPeerGroup.startAsync(), new FutureCallback() { @Override public void onSuccess(@Nullable Object result) {
listener.await(); } else { Futures.addCallback(vPeerGroup.startAsync(), new FutureCallback() { @Override public void onSuccess(@Nullable Object result) {
listener.await(); } else { Futures.addCallback(vPeerGroup.startAsync(), new FutureCallback() { @Override public void onSuccess(@Nullable Object result) {
peerGroup.startAsync(); peerGroup.downloadBlockChain(); peerGroup.stopAsync();
listener.await(); } else { Futures.addCallback(vPeerGroup.startAsync(), new FutureCallback() { @Override public void onSuccess(@Nullable Object result) {
peers.startAsync(); try { latch.await();
peerGroup.startAsync(); peerGroup.startBlockChainDownload(null);