/** * <p>Creates a PeerGroup that accesses the network via the Tor network. The provided TorClient is used so you can * preconfigure it beforehand. It should not have been already started. You can just use "new TorClient()" if * you don't have any particular configuration requirements.</p> * * <p>Peer discovery is automatically configured to use DNS seeds resolved via a random selection of exit nodes. * If running on the Oracle JDK the unlimited strength jurisdiction checks will also be overridden, * as they no longer apply anyway and can cause startup failures due to the requirement for AES-256.</p> * * <p>The user does not need any additional software for this: it's all pure Java. As of April 2014 <b>this mode * is experimental</b>.</p> * * @throws TimeoutException if Tor fails to start within 20 seconds. */ public static PeerGroup newWithTor(Context context, @Nullable AbstractBlockChain chain, TorClient torClient) throws TimeoutException { return newWithTor(context, chain, torClient, true); }
/** * <p>Creates a PeerGroup that accesses the network via the Tor network. The provided TorClient is used so you can * preconfigure it beforehand. It should not have been already started. You can just use "new TorClient()" if * you don't have any particular configuration requirements.</p> * * <p>Peer discovery is automatically configured to use DNS seeds resolved via a random selection of exit nodes. * If running on the Oracle JDK the unlimited strength jurisdiction checks will also be overridden, * as they no longer apply anyway and can cause startup failures due to the requirement for AES-256.</p> * * <p>The user does not need any additional software for this: it's all pure Java. As of April 2014 <b>this mode * is experimental</b>.</p> * * @throws TimeoutException if Tor fails to start within 20 seconds. */ public static PeerGroup newWithTor(Context context, @Nullable AbstractBlockChain chain, TorClient torClient) throws TimeoutException { return newWithTor(context, chain, torClient, true); }
/** See {@link #newWithTor(Context, AbstractBlockChain, TorClient)} */ public static PeerGroup newWithTor(NetworkParameters params, @Nullable AbstractBlockChain chain, TorClient torClient) throws TimeoutException { return newWithTor(Context.getOrCreate(params), chain, torClient); }
/** See {@link #newWithTor(Context, AbstractBlockChain, TorClient)} */ public static PeerGroup newWithTor(NetworkParameters params, @Nullable AbstractBlockChain chain, TorClient torClient) throws TimeoutException { return newWithTor(Context.getOrCreate(params), chain, torClient); }
protected PeerGroup createPeerGroup() throws TimeoutException { if (useTor) { TorClient torClient = new TorClient(); torClient.getConfig().setDataDirectory(directory); return PeerGroup.newWithTor(params, vChain, torClient); } else return new PeerGroup(params, vChain); }
protected PeerGroup createPeerGroup() throws TimeoutException { if (useTor) { TorClient torClient = new TorClient(); torClient.getConfig().setDataDirectory(directory); return PeerGroup.newWithTor(params, vChain, torClient); } else return new PeerGroup(params, vChain); }
if (options.has("tor")) { try { peers = PeerGroup.newWithTor(params, chain, new TorClient()); } catch (TimeoutException e) { System.err.println("Tor startup timed out, falling back to clear net ...");