IOException, ClassNotFoundException, InvalidKeyException, SignatureException,
NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException {
KeyPairGenerator gen = KeyPairGenerator.getInstance("DSA");
KeyPair keyPairPeer1 = gen.generateKeyPair();
Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4834).keyPair(keyPairPeer1)
.setEnableIndirectReplication(true).makeAndListen();
KeyPair keyPairPeer2 = gen.generateKeyPair();
Peer p2 = new PeerMaker(Number160.createHash(2)).masterPeer(p1).keyPair(keyPairPeer2)
.setEnableIndirectReplication(true).makeAndListen();
p2.bootstrap().setPeerAddress(p1.getPeerAddress()).start().awaitUninterruptibly();
p1.bootstrap().setPeerAddress(p2.getPeerAddress()).start().awaitUninterruptibly();