use of io.bitsquare.common.crypto.KeyStorage in project bitsquare by bitsquare.
the class StressTestMailboxMessage method createPeerNode.
@NotNull
private P2PService createPeerNode(int n, int port) {
// peer data directories
final File peerDir = new File(testDataDir.toFile(), String.format("peer-%06d", n));
final File peerTorDir = new File(peerDir, "tor");
final File peerStorageDir = new File(peerDir, "db");
final File peerKeysDir = new File(peerDir, "keys");
//noinspection ResultOfMethodCallIgnored
// needed for creating the key ring
peerKeysDir.mkdirs();
// peer keys
final KeyStorage peerKeyStorage = new KeyStorage(peerKeysDir);
final KeyRing peerKeyRing = new KeyRing(peerKeyStorage);
final EncryptionService peerEncryptionService = new EncryptionService(peerKeyRing);
return new P2PService(seedNodesRepository, port, peerTorDir, useLocalhost, REGTEST_NETWORK_ID, P2PService.MAX_CONNECTIONS_DEFAULT, peerStorageDir, null, null, null, new Clock(), null, peerEncryptionService, peerKeyRing);
}
Aggregations