Метод | Описание | |
---|---|---|
AddAddress ( |
Add an address to the list of potential peers to connect to.
|
|
AddPeerDiscovery ( IPeerDiscovery peerDiscovery ) : void |
Add addresses from a discovery source to the list of potential peers to connect to.
|
|
BroadcastTransaction ( |
Broadcast a transaction to all connected peers.
|
|
DownloadBlockChain ( ) : void |
Download the block chain from peers. This method wait until the download is complete. "Complete" is defined as downloading from at least one peer all the blocks that are in that peer's inventory. |
|
PeerGroup ( IBlockStore blockStore, |
Creates a PeerGroup with the given parameters and a default 5 second connection timeout.
|
|
PeerGroup ( IBlockStore blockStore, |
Creates a PeerGroup with the given parameters. The connectionDelayMillis parameter controls how long the PeerGroup will wait between attempts to connect to nodes or read from any added peer discovery sources.
|
|
Run ( ) : void |
Repeatedly get the next peer address from the inactive queue and try to connect. We can be terminated with Thread.interrupt. When an interrupt is received, we will ask the executor to shutdown and ask each peer to disconnect. At that point no threads or network connections will be active. |
|
Start ( ) : void |
Starts the background thread that makes connections.
|
|
StartBlockChainDownload ( IPeerEventListener listener ) : void |
Start downloading the block chain from the first available peer. If no peers are currently connected, the download will be started once a peer starts. If the peer dies, the download will resume with another peer. |
|
Stop ( ) : void |
Stop this PeerGroup. The peer group will be asynchronously shut down. After it is shut down all peers will be disconnected and no threads will be running. |
Метод | Описание | |
---|---|---|
HandleNewPeer ( Peer peer ) : void | ||
HandlePeerDeath ( Peer peer ) : void |
Метод | Описание | |
---|---|---|
DiscoverPeers ( ) : void | ||
StartBlockChainDownloadFromPeer ( Peer peer ) : void | ||
TryNextPeer ( ) : void |
Try connecting to a peer. If we exceed the number of connections, delay and try again.
|
public AddAddress ( |
||
peerAddress | ||
Результат | void |
public AddPeerDiscovery ( IPeerDiscovery peerDiscovery ) : void | ||
peerDiscovery | IPeerDiscovery | |
Результат | void |
public BroadcastTransaction ( |
||
tx | ||
Результат | bool |
protected HandleNewPeer ( Peer peer ) : void | ||
peer | Peer | |
Результат | void |
protected HandlePeerDeath ( Peer peer ) : void | ||
peer | Peer | |
Результат | void |
public PeerGroup ( IBlockStore blockStore, |
||
blockStore | IBlockStore | |
@params | ||
chain | ||
Результат | System |
public PeerGroup ( IBlockStore blockStore, |
||
blockStore | IBlockStore | |
@params | ||
chain | ||
connectionDelayMillis | int | |
Результат | System |
public StartBlockChainDownload ( IPeerEventListener listener ) : void | ||
listener | IPeerEventListener | A listener for chain download events, may not be null. |
Результат | void |