Documentation
¶
Index ¶
- Variables
- type ErrorMessage
- type Features
- type FuzzClient
- func (c *FuzzClient) Close() error
- func (c *FuzzClient) GetState(hash types.HeaderHash) (types.StateKeyVals, error)
- func (c *FuzzClient) Handshake(peerInfo PeerInfo) (PeerInfo, error)
- func (c *FuzzClient) ImportBlock(block types.Block, priorStateRoot types.StateRoot) (types.StateRoot, *ErrorMessage, error)
- func (c *FuzzClient) SetState(header types.Header, state types.StateKeyVals, ancestry types.Ancestry) (types.StateRoot, error)
- type FuzzServer
- type FuzzService
- type FuzzServiceStub
- func (s *FuzzServiceStub) GetState(headerHash types.HeaderHash) (types.StateKeyVals, error)
- func (s *FuzzServiceStub) Handshake(peerInfo PeerInfo) (PeerInfo, error)
- func (s *FuzzServiceStub) ImportBlock(block types.Block) (types.StateRoot, error)
- func (s *FuzzServiceStub) SetState(header types.Header, stateKeyVals types.StateKeyVals, ancestry types.Ancestry) (types.StateRoot, error)
- type GetState
- type ImportBlock
- type Message
- type MessageType
- type PeerInfo
- type SetState
- type State
- type StateRoot
- type Version
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ErrorMessage ¶
type ErrorMessage struct {
Error string
}
func (*ErrorMessage) MarshalBinary ¶
func (m *ErrorMessage) MarshalBinary() ([]byte, error)
func (*ErrorMessage) UnmarshalBinary ¶
func (m *ErrorMessage) UnmarshalBinary(data []byte) error
type Features ¶
type Features uint32
func (*Features) MarshalBinary ¶
func (*Features) UnmarshalBinary ¶
type FuzzClient ¶
type FuzzClient struct {
// contains filtered or unexported fields
}
func NewFuzzClient ¶
func NewFuzzClient(network, address string) (*FuzzClient, error)
func (*FuzzClient) Close ¶
func (c *FuzzClient) Close() error
func (*FuzzClient) GetState ¶
func (c *FuzzClient) GetState(hash types.HeaderHash) (types.StateKeyVals, error)
func (*FuzzClient) ImportBlock ¶
func (c *FuzzClient) ImportBlock(block types.Block, priorStateRoot types.StateRoot) (types.StateRoot, *ErrorMessage, error)
type FuzzServer ¶
type FuzzServer struct {
Listener net.Listener
Service FuzzService
}
TODO
func NewFuzzServer ¶
func NewFuzzServer(network, address string) (*FuzzServer, error)
func (*FuzzServer) ListenAndServe ¶
func (s *FuzzServer) ListenAndServe(ctx context.Context) error
blocks until terminated
type FuzzService ¶
type FuzzServiceStub ¶
type FuzzServiceStub struct{}
func (*FuzzServiceStub) GetState ¶
func (s *FuzzServiceStub) GetState(headerHash types.HeaderHash) (types.StateKeyVals, error)
func (*FuzzServiceStub) Handshake ¶
func (s *FuzzServiceStub) Handshake(peerInfo PeerInfo) (PeerInfo, error)
func (*FuzzServiceStub) ImportBlock ¶
ImportBlock receives a block and determines if the block is valid or mutant(fork) in mutant case, fallback to target state by identifying parent block
type GetState ¶
type GetState types.HeaderHash
func (*GetState) MarshalBinary ¶
func (*GetState) UnmarshalBinary ¶
type ImportBlock ¶
func (*ImportBlock) MarshalBinary ¶
func (m *ImportBlock) MarshalBinary() ([]byte, error)
func (*ImportBlock) UnmarshalBinary ¶
func (m *ImportBlock) UnmarshalBinary(data []byte) error
type Message ¶
type Message struct {
Type MessageType
PeerInfo *PeerInfo
ImportBlock *ImportBlock
SetState *SetState
GetState *GetState
StateRoot *StateRoot
State *State
// For ImportBlock
Error *ErrorMessage
}
func (*Message) MarshalBinary ¶
type MessageType ¶
type MessageType uint8
const ( MessageType_PeerInfo MessageType = 0 MessageType_SetState MessageType = 1 MessageType_StateRoot MessageType = 2 MessageType_ImportBlock MessageType = 3 MessageType_GetState MessageType = 4 MessageType_State MessageType = 5 MessageType_ErrorMessage MessageType = 255 )
type PeerInfo ¶
type PeerInfo struct {
FuzzVersion uint8 `json:"fuzz_version"`
FuzzFeatures Features `json:"fuzz_features"`
JamVersion Version `json:"jam_version"`
AppVersion Version `json:"app_version"`
AppName string `json:"app_name"`
}
func (*PeerInfo) FromConfig ¶
func (*PeerInfo) FromValues ¶
func (*PeerInfo) MarshalBinary ¶
func (*PeerInfo) UnmarshalBinary ¶
type State ¶
type State types.StateKeyVals
func (*State) MarshalBinary ¶
func (*State) UnmarshalBinary ¶
Click to show internal directories.
Click to hide internal directories.