Package org.ethereum.net.p2p

Examples of org.ethereum.net.p2p.Peer


      try {
        int peerPort = ByteUtil.byteArrayToInt(portBytes);
        InetAddress address = InetAddress.getByAddress(ipBytes);

                String peerId = peerIdRaw == null ? "" :  Hex.toHexString(peerIdRaw);
                Peer peer = new Peer(address, peerPort, peerId);
        peers.add(peer);
      } catch (UnknownHostException e) {
        throw new RuntimeException("Malformed ip", e);
      }
    }
View Full Code Here


        logger.info(peersMessage.toString());

        assertEquals(1, peersMessage.getPeers().size());

        Iterator<Peer> it = peersMessage.getPeers().iterator();
        Peer peer = it.next();

        assertEquals(P2pMessageCodes.PEERS, peersMessage.getCommand());
        assertEquals("/104.148.216.72", peer.getAddress().toString());
        assertEquals(112, peer.getPort());
        assertEquals("36659c3656c488437cceb11abeb9b9fc69b8055144a7e7db3584d03e606083f90e17a1d3021d674579407cdaaafdfeef485872ab719db9f2b6283f498bb90a71",
            peer.getPeerId());
    }
View Full Code Here

TOP

Related Classes of org.ethereum.net.p2p.Peer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.