Documentation ¶
Index ¶
- Constants
- func PastPeers() []string
- type BlockPool
- func (self *BlockPool) Add(b *types.Block, peer *Peer)
- func (self *BlockPool) AddHash(hash []byte, peer *Peer)
- func (self *BlockPool) AddNew(b *types.Block, peer *Peer)
- func (self *BlockPool) Blocks() (blocks types.Blocks)
- func (self *BlockPool) DistributeHashes()
- func (self *BlockPool) FetchHashes(peer *Peer) bool
- func (self *BlockPool) HasCommonHash(hash []byte) bool
- func (self *BlockPool) HasLatestHash() bool
- func (self *BlockPool) Len() int
- func (self *BlockPool) Remove(hash []byte)
- func (self *BlockPool) Reset()
- func (self *BlockPool) Start()
- func (self *BlockPool) Stop()
- type Caps
- type ChainSyncEvent
- type DiscReason
- type Ethereum
- func (s *Ethereum) AddPeer(conn net.Conn)
- func (self *Ethereum) BlacklistPeer(peer *Peer)
- func (s *Ethereum) BlockManager() *core.BlockManager
- func (s *Ethereum) BlockPool() *BlockPool
- func (s *Ethereum) Broadcast(msgType wire.MsgType, data []interface{})
- func (s *Ethereum) BroadcastMsg(msg *wire.Msg)
- func (s *Ethereum) ChainManager() *core.ChainManager
- func (s *Ethereum) ClientIdentity() wire.ClientIdentity
- func (s *Ethereum) ConnectToPeer(addr string) error
- func (self *Ethereum) Db() ethutil.Database
- func (s *Ethereum) EventMux() *event.TypeMux
- func (self *Ethereum) GetFilter(id int) *core.Filter
- func (s *Ethereum) HighestTDPeer() (td *big.Int)
- func (s *Ethereum) InOutPeers() []*Peer
- func (s *Ethereum) InboundPeers() []*Peer
- func (self *Ethereum) InstallFilter(filter *core.Filter) (id int)
- func (s *Ethereum) IsListening() bool
- func (s *Ethereum) IsMining() bool
- func (s *Ethereum) IsUpToDate() bool
- func (s *Ethereum) KeyManager() *crypto.KeyManager
- func (s *Ethereum) OutboundPeers() []*Peer
- func (s *Ethereum) PeerCount() int
- func (s *Ethereum) Peers() *list.List
- func (s *Ethereum) ProcessPeerList(addrs []string)
- func (s *Ethereum) PushPeer(peer *Peer)
- func (s *Ethereum) RemovePeer(p *Peer)
- func (s *Ethereum) Seed()
- func (s *Ethereum) ServerCaps() Caps
- func (s *Ethereum) Start(seed bool)
- func (s *Ethereum) Stop()
- func (s *Ethereum) TxPool() *core.TxPool
- func (self *Ethereum) UninstallFilter(id int)
- func (s *Ethereum) WaitForShutdown()
- type NAT
- type Peer
- func (self *Peer) Caps() *ethutil.Value
- func (self *Peer) Connect(addr string) (conn net.Conn, err error)
- func (p *Peer) Connected() *int32
- func (self *Peer) FetchBlocks(hashes [][]byte)
- func (self *Peer) FetchHashes() bool
- func (self *Peer) FetchingHashes() bool
- func (p *Peer) HandleInbound()
- func (p *Peer) HandleOutbound()
- func (p *Peer) Host() []byte
- func (p *Peer) Inbound() bool
- func (self *Peer) IsCap(cap string) bool
- func (p *Peer) LastPong() int64
- func (p *Peer) LastSend() time.Time
- func (p *Peer) PingTime() string
- func (p *Peer) Port() uint16
- func (p *Peer) QueueMessage(msg *wire.Msg)
- func (p *Peer) RlpData() []interface{}
- func (p *Peer) SetVersion(version string)
- func (p *Peer) Start()
- func (p *Peer) Stop()
- func (p *Peer) StopWithReason(reason DiscReason)
- func (p *Peer) String() string
- func (p *Peer) Version() string
- type PeerListEvent
Constants ¶
View Source
const ( // Current protocol version ProtocolVersion = 49 // Current P2P version P2PVersion = 2 // Ethereum network version NetVersion = 0 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockPool ¶ added in v0.7.11
type BlockPool struct {
ChainLength, BlocksProcessed int
// contains filtered or unexported fields
}
func NewBlockPool ¶ added in v0.7.11
func (*BlockPool) DistributeHashes ¶ added in v0.7.11
func (self *BlockPool) DistributeHashes()
func (*BlockPool) FetchHashes ¶ added in v0.7.11
func (*BlockPool) HasCommonHash ¶ added in v0.7.11
func (*BlockPool) HasLatestHash ¶ added in v0.7.11
type Caps ¶ added in v0.7.11
type Caps byte
Peer capabilities
const ( CapPeerDiscTy Caps = 1 << iota CapTxTy CapChainTy CapDefault = CapChainTy | CapTxTy | CapPeerDiscTy )
type ChainSyncEvent ¶ added in v0.7.11
type ChainSyncEvent struct {
InSync bool
}
type DiscReason ¶ added in v0.7.11
type DiscReason byte
const ( // Values are given explicitly instead of by iota because these values are // defined by the wire protocol spec; it is easier for humans to ensure // correctness when values are explicit. DiscRequested DiscReason = iota DiscReTcpSysErr DiscBadProto DiscBadPeer DiscTooManyPeers DiscConnDup DiscGenesisErr DiscProtoErr DiscQuitting )
func (DiscReason) String ¶ added in v0.7.11
func (d DiscReason) String() string
type Ethereum ¶ added in v0.7.11
type Ethereum struct { // Nonce Nonce uint64 Addr net.Addr Port string // Specifies the desired amount of maximum peers MaxPeers int Mining bool RpcServer *rpc.JsonRpcServer // contains filtered or unexported fields }
func New ¶ added in v0.7.11
func New(db ethutil.Database, clientIdentity wire.ClientIdentity, keyManager *crypto.KeyManager, caps Caps, usePnp bool) (*Ethereum, error)
func (*Ethereum) BlacklistPeer ¶ added in v0.7.11
func (*Ethereum) BlockManager ¶ added in v0.7.11
func (s *Ethereum) BlockManager() *core.BlockManager
func (*Ethereum) BroadcastMsg ¶ added in v0.7.11
func (*Ethereum) ChainManager ¶ added in v0.7.11
func (s *Ethereum) ChainManager() *core.ChainManager
func (*Ethereum) ClientIdentity ¶ added in v0.7.11
func (s *Ethereum) ClientIdentity() wire.ClientIdentity
func (*Ethereum) ConnectToPeer ¶ added in v0.7.11
func (*Ethereum) GetFilter ¶ added in v0.7.11
GetFilter retrieves a filter installed using InstallFilter. The filter may not be modified.
func (*Ethereum) HighestTDPeer ¶ added in v0.7.11
func (*Ethereum) InOutPeers ¶ added in v0.7.11
func (*Ethereum) InboundPeers ¶ added in v0.7.11
func (*Ethereum) InstallFilter ¶ added in v0.7.11
InstallFilter adds filter for blockchain events. The filter's callbacks will run for matching blocks and messages. The filter should not be modified after it has been installed.
func (*Ethereum) IsListening ¶ added in v0.7.11
func (*Ethereum) IsUpToDate ¶ added in v0.7.11
func (*Ethereum) KeyManager ¶ added in v0.7.11
func (s *Ethereum) KeyManager() *crypto.KeyManager
func (*Ethereum) OutboundPeers ¶ added in v0.7.11
func (*Ethereum) ProcessPeerList ¶ added in v0.7.11
func (*Ethereum) RemovePeer ¶ added in v0.7.11
func (*Ethereum) ServerCaps ¶ added in v0.7.11
func (*Ethereum) UninstallFilter ¶ added in v0.7.11
func (*Ethereum) WaitForShutdown ¶ added in v0.7.11
func (s *Ethereum) WaitForShutdown()
This function will wait for a shutdown and resumes main thread execution
type NAT ¶ added in v0.7.11
type NAT interface { GetExternalAddress() (addr net.IP, err error) AddPortMapping(protocol string, externalPort, internalPort int, description string, timeout int) (mappedExternalPort int, err error) DeletePortMapping(protocol string, externalPort, internalPort int) (err error) }
protocol is either "udp" or "tcp"
type Peer ¶ added in v0.7.11
type Peer struct {
// contains filtered or unexported fields
}
func NewOutboundPeer ¶ added in v0.7.11
func (*Peer) FetchBlocks ¶ added in v0.7.11
func (*Peer) FetchHashes ¶ added in v0.7.11
func (*Peer) FetchingHashes ¶ added in v0.7.11
func (*Peer) HandleInbound ¶ added in v0.7.11
func (p *Peer) HandleInbound()
Inbound handler. Inbound messages are received here and passed to the appropriate methods
func (*Peer) HandleOutbound ¶ added in v0.7.11
func (p *Peer) HandleOutbound()
Outbound message handler. Outbound messages are handled here
func (*Peer) QueueMessage ¶ added in v0.7.11
Outputs any RLP encoded data to the peer
func (*Peer) StopWithReason ¶ added in v0.7.11
func (p *Peer) StopWithReason(reason DiscReason)
type PeerListEvent ¶ added in v0.7.11
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
compression
|
|
Package event implements an event multiplexer.
|
Package event implements an event multiplexer. |
Package logger implements a multi-output leveled logger.
|
Package logger implements a multi-output leveled logger. |
Package rlp implements the RLP serialization format.
|
Package rlp implements the RLP serialization format. |
tests
|
|
Package wire provides low level access to the Ethereum network and allows you to broadcast data over the network.
|
Package wire provides low level access to the Ethereum network and allows you to broadcast data over the network. |
Click to show internal directories.
Click to hide internal directories.