In BitcoinJ, what is the purpose of Peer?

1

In BitcoinJ, there is PeerGroup and Peer.

I understand there are differences such as one is related to a group of peers while other is related to a single peer.

When should I use which construct? Are both necessary?

From the code, it seems that we should only be interested in PeerGroup and not Peer. Then whats the purpose of Peer?

Jus12

Posted 2014-10-28T07:42:09.527

Reputation: 1 243

Answers

1

When should I use which construct?

Use PeerGroup, unless you want to connect to a specific Bitcoin node.

From the code, it seems that we should only be interested in PeerGroup and not Peer.

PeerGroup will construct Peer objects. It's necessary, even if you don't use it directly.

Nick ODell

Posted 2014-10-28T07:42:09.527

Reputation: 26 536