Documentation
¶
Index ¶
- Constants
- type Addr
- type Block
- type DAddr
- type FilterAdd
- type FilterClear
- type FilterLoad
- type GetAddr
- type GetBlocks
- type GetData
- type Inv
- type InvType
- type InvVect
- type MemPool
- type MerkleBlock
- type NotFound
- type Ping
- type Pong
- type Reject
- type RejectCode
- type Tx
- type TxFilterLoad
- type VerAck
- type Version
Constants ¶
View Source
const ( // MaxFilterLoadHashFuncs is the maximum number of hash functions to // load into the Bloom filter. MaxFilterLoadHashFuncs = 50 // MaxFilterLoadFilterSize is the maximum size in bytes a filter may be. MaxFilterLoadFilterSize = 36000 )
View Source
const MaxAddrPerMsg = 1000
View Source
const MaxBlockLocatorsPerMsg = 500
MaxBlockLocatorsPerMsg is the maximum number of block locator hashes allowed per message.
View Source
const ( // MaxFilterAddDataSize is the maximum byte size of a data // element to add to the Bloom filter. It is equal to the // maximum element size of a script. MaxFilterAddDataSize = 520 )
View Source
const ( // MaxInvPerMsg is the maximum number of inventory vectors that can be in a // single inv message. MaxInvPerMsg = 50000 )
View Source
const (
// MaxTxFilterLoadDataSize is the maximum size in bytes a filter may be.
MaxTxFilterLoadDataSize = 50000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addr ¶
type Addr struct {
AddrList []*p2p.NetAddress
}
func NewAddr ¶
func NewAddr(addresses []*p2p.NetAddress) *Addr
type Block ¶
type Block struct {
common.Serializable
}
func NewBlock ¶
func NewBlock(block common.Serializable) *Block
type DAddr ¶ added in v0.3.2
type DAddr struct {
// The peer ID indicates who's address it is.
PID [33]byte
// Timestamp represents the time when this message created.
Timestamp time.Time
// Which peer ID is used to encode the address cipher.
Encode [33]byte
// The encrypted network address using the encode peer ID.
Cipher []byte
// Signature of the encode peer ID and cipher to proof the sender itself.
Signature []byte
}
DAddr represents a DPOS peer address.
type FilterClear ¶
type FilterClear struct {
// contains filtered or unexported fields
}
func (*FilterClear) CMD ¶
func (msg *FilterClear) CMD() string
func (*FilterClear) Deserialize ¶
type FilterLoad ¶
func (*FilterLoad) CMD ¶
func (msg *FilterLoad) CMD() string
func (*FilterLoad) Deserialize ¶
func (msg *FilterLoad) Deserialize(r io.Reader) error
func (*FilterLoad) MaxLength ¶
func (msg *FilterLoad) MaxLength() uint32
type GetAddr ¶
type GetAddr struct {
// contains filtered or unexported fields
}
func NewGetAddr ¶
func NewGetAddr() *GetAddr
func (*GetAddr) Deserialize ¶
type GetBlocks ¶
func NewGetBlocks ¶
type Inv ¶
type Inv struct {
InvList []*InvVect
}
func NewInvSize ¶
func (*Inv) AddInvVect ¶
AddInvVect adds an inventory vector to the message.
type InvVect ¶
func NewInvVect ¶
NewInvVect returns a new InvVect using the provided type and hash.
type MemPool ¶
type MemPool struct {
// contains filtered or unexported fields
}
func (*MemPool) Deserialize ¶
type MerkleBlock ¶
type MerkleBlock struct {
Header common.Serializable
Transactions uint32
Hashes []*common.Uint256
Flags []byte
}
func NewMerkleBlock ¶
func NewMerkleBlock(header common.Serializable) *MerkleBlock
func (*MerkleBlock) CMD ¶
func (msg *MerkleBlock) CMD() string
func (*MerkleBlock) Deserialize ¶
func (msg *MerkleBlock) Deserialize(r io.Reader) error
func (*MerkleBlock) MaxLength ¶
func (msg *MerkleBlock) MaxLength() uint32
type Reject ¶
type Reject struct {
// Cmd is the command for the message which was rejected such as
// as CmdBlock or CmdReject. This can be obtained from the Command function
// of a Message.
Cmd string
// RejectCode is a code indicating why the command was rejected. It
// is encoded as a uint8 on the wire.
Code RejectCode
// Reason is a human-readable string with specific details (over and
// above the reject code) about why the command was rejected.
Reason string
// Hash identifies a specific block or transaction that was rejected
// and therefore only applies the MsgBlock and MsgReject messages.
Hash common.Uint256
}
type RejectCode ¶
type RejectCode uint8
RejectCode represents a numeric value by which a remote peer indicates why a message was rejected.
const ( RejectMalformed RejectCode = 0x01 RejectInvalid RejectCode = 0x10 RejectObsolete RejectCode = 0x11 RejectDuplicate RejectCode = 0x12 RejectNonstandard RejectCode = 0x40 RejectDust RejectCode = 0x41 RejectInsufficientFee RejectCode = 0x42 RejectCheckpoint RejectCode = 0x43 )
These constants define the various supported reject codes.
func (RejectCode) String ¶
func (code RejectCode) String() string
String returns the RejectCode in human-readable form.
type Tx ¶
type Tx struct {
common.Serializable
}
func NewTx ¶
func NewTx(tx common.Serializable) *Tx
type TxFilterLoad ¶
TxFilterLoad is a message to load a transaction filter, it can be a bloom filter or other transaction filters.
func (*TxFilterLoad) CMD ¶
func (msg *TxFilterLoad) CMD() string
func (*TxFilterLoad) Deserialize ¶
func (msg *TxFilterLoad) Deserialize(r io.Reader) error
func (*TxFilterLoad) MaxLength ¶
func (msg *TxFilterLoad) MaxLength() uint32
type VerAck ¶
type VerAck struct {
// contains filtered or unexported fields
}
func (*VerAck) Deserialize ¶
Click to show internal directories.
Click to hide internal directories.