Documentation ¶
Index ¶
- Constants
- type Caps
- type DiscReason
- type Ethereum
- func (s *Ethereum) AddPeer(conn net.Conn)
- func (s *Ethereum) BlockChain() *ethchain.BlockChain
- func (s *Ethereum) Broadcast(msgType ethwire.MsgType, data []interface{})
- func (s *Ethereum) BroadcastMsg(msg *ethwire.Msg)
- func (s *Ethereum) ClientIdentity() ethwire.ClientIdentity
- func (s *Ethereum) ConnectToPeer(addr string) error
- func (s *Ethereum) InOutPeers() []*Peer
- func (s *Ethereum) InboundPeers() []*Peer
- func (s *Ethereum) IsListening() bool
- func (s *Ethereum) IsMining() bool
- func (s *Ethereum) IsUpToDate() bool
- func (s *Ethereum) KeyManager() *ethcrypto.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) Reactor() *ethutil.ReactorEngine
- func (s *Ethereum) ReapDeadPeerHandler()
- func (s *Ethereum) RemovePeer(p *Peer)
- func (s *Ethereum) Seed()
- func (s *Ethereum) ServerCaps() Caps
- func (s *Ethereum) Start(seed bool)
- func (s *Ethereum) StateManager() *ethchain.StateManager
- func (s *Ethereum) Stop()
- func (s *Ethereum) TxPool() *ethchain.TxPool
- func (s *Ethereum) WaitForShutdown()
- type NAT
- type Peer
- func (p *Peer) CatchupWithPeer(blockHash []byte)
- func (p *Peer) Connected() *int32
- func (p *Peer) FindCommonParentBlock()
- func (p *Peer) HandleInbound()
- func (p *Peer) HandleOutbound()
- func (p *Peer) Host() []byte
- func (p *Peer) Inbound() 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 *ethwire.Msg)
- func (p *Peer) RlpData() []interface{}
- func (p *Peer) SetVersion(version string)
- func (p *Peer) Start()
- func (p *Peer) Stop()
- func (p *Peer) String() string
- func (p *Peer) SyncWithPeerToLastKnown()
- func (p *Peer) Version() string
Constants ¶
View Source
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. DiscReRequested = 0x00 DiscReTcpSysErr = 0x01 DiscBadProto = 0x02 DiscBadPeer = 0x03 DiscTooManyPeers = 0x04 DiscConnDup = 0x05 DiscGenesisErr = 0x06 DiscProtoErr = 0x07 DiscQuitting = 0x08 )
View Source
const ( CapPeerDiscTy = 1 << iota CapTxTy CapChainTy CapDefault = CapChainTy | CapTxTy | CapPeerDiscTy )
View Source
const (
// Current protocol version
ProtocolVersion = 23
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscReason ¶
type DiscReason byte
func (DiscReason) String ¶
func (d DiscReason) String() string
type Ethereum ¶
type Ethereum struct { // Nonce Nonce uint64 Addr net.Addr Port string // Specifies the desired amount of maximum peers MaxPeers int Mining bool RpcServer *ethrpc.JsonRpcServer // contains filtered or unexported fields }
func New ¶
func New(db ethutil.Database, clientIdentity ethwire.ClientIdentity, keyManager *ethcrypto.KeyManager, caps Caps, usePnp bool) (*Ethereum, error)
func (*Ethereum) BlockChain ¶
func (s *Ethereum) BlockChain() *ethchain.BlockChain
func (*Ethereum) BroadcastMsg ¶
func (*Ethereum) ClientIdentity ¶
func (s *Ethereum) ClientIdentity() ethwire.ClientIdentity
func (*Ethereum) ConnectToPeer ¶
func (*Ethereum) InOutPeers ¶
func (*Ethereum) InboundPeers ¶
func (*Ethereum) IsListening ¶
func (*Ethereum) IsUpToDate ¶
func (*Ethereum) KeyManager ¶
func (s *Ethereum) KeyManager() *ethcrypto.KeyManager
func (*Ethereum) OutboundPeers ¶
func (*Ethereum) ProcessPeerList ¶
func (*Ethereum) Reactor ¶
func (s *Ethereum) Reactor() *ethutil.ReactorEngine
func (*Ethereum) ReapDeadPeerHandler ¶
func (s *Ethereum) ReapDeadPeerHandler()
func (*Ethereum) RemovePeer ¶
func (*Ethereum) ServerCaps ¶
func (*Ethereum) StateManager ¶
func (s *Ethereum) StateManager() *ethchain.StateManager
func (*Ethereum) WaitForShutdown ¶
func (s *Ethereum) WaitForShutdown()
This function will wait for a shutdown and resumes main thread execution
type NAT ¶
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 ¶
type Peer struct {
// contains filtered or unexported fields
}
func (*Peer) CatchupWithPeer ¶
func (*Peer) FindCommonParentBlock ¶
func (p *Peer) FindCommonParentBlock()
func (*Peer) HandleInbound ¶
func (p *Peer) HandleInbound()
Inbound handler. Inbound messages are received here and passed to the appropriate methods
func (*Peer) HandleOutbound ¶
func (p *Peer) HandleOutbound()
Outbound message handler. Outbound messages are handled here
func (*Peer) QueueMessage ¶
Outputs any RLP encoded data to the peer
func (*Peer) SyncWithPeerToLastKnown ¶
func (p *Peer) SyncWithPeerToLastKnown()
Directories ¶
Path | Synopsis |
---|---|
Package ethwire provides low level access to the Ethereum network and allows you to broadcast data over the network.
|
Package ethwire 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.