Documentation ¶
Index ¶
- Constants
- Variables
- func GetMessageID(m PoolDetectiveMsg) int
- type AckMsg
- type BlockObserverBlockObservedMsg
- type BlockObserverGetCoinsRequestMsg
- type BlockObserverGetCoinsResponseCoin
- type BlockObserverGetCoinsResponseMsg
- type ConnectionEvent
- type CoordinatorGetConfigRequestMsg
- type CoordinatorGetConfigResponseMsg
- type CoordinatorGetConfigResponseStratumServer
- type CoordinatorRefreshConfigMsg
- type CoordinatorRestartPoolObserverMsg
- type ErrorMsg
- type MessageType
- type MsgHeader
- type PoolDetectiveConn
- func (pdc *PoolDetectiveConn) Close() error
- func (pdc *PoolDetectiveConn) Publish(channel []byte, msg PoolDetectiveMsg) error
- func (pdc *PoolDetectiveConn) Recv() (PoolDetectiveMsg, bool, error)
- func (pdc *PoolDetectiveConn) RecvSub() (PoolDetectiveMsg, []byte, bool, error)
- func (pdc *PoolDetectiveConn) Send(msg PoolDetectiveMsg) error
- func (pdc *PoolDetectiveConn) Subscribe(channel []byte) error
- type PoolDetectiveMsg
- type ShareEvent
- type StratumClientConnectionEventMsg
- type StratumClientDifficultyMsg
- type StratumClientExtraNonceMsg
- type StratumClientJobMsg
- type StratumClientLoginDetailsRequestMsg
- type StratumClientLoginDetailsResponseMsg
- type StratumClientShareEventMsg
- type StratumClientSubmitShareMsg
- type StratumClientTargetMsg
Constants ¶
Variables ¶
var MessageTypeToTypeMap = map[MessageType]reflect.Type{}
var TypeToMessageTypeMap = map[reflect.Type]MessageType{ reflect.TypeOf(&BlockObserverBlockObservedMsg{}): MessageType(1), reflect.TypeOf(&StratumClientConnectionEventMsg{}): MessageType(2), reflect.TypeOf(&StratumClientDifficultyMsg{}): MessageType(3), reflect.TypeOf(&StratumClientExtraNonceMsg{}): MessageType(4), reflect.TypeOf(&StratumClientJobMsg{}): MessageType(5), reflect.TypeOf(&StratumClientLoginDetailsRequestMsg{}): MessageType(6), reflect.TypeOf(&StratumClientLoginDetailsResponseMsg{}): MessageType(7), reflect.TypeOf(&StratumClientShareEventMsg{}): MessageType(8), reflect.TypeOf(&StratumClientSubmitShareMsg{}): MessageType(9), reflect.TypeOf(&AckMsg{}): MessageType(10), reflect.TypeOf(&ErrorMsg{}): MessageType(11), reflect.TypeOf(&BlockObserverGetCoinsRequestMsg{}): MessageType(12), reflect.TypeOf(&BlockObserverGetCoinsResponseMsg{}): MessageType(13), reflect.TypeOf(&CoordinatorGetConfigRequestMsg{}): MessageType(14), reflect.TypeOf(&CoordinatorGetConfigResponseMsg{}): MessageType(15), reflect.TypeOf(&CoordinatorRefreshConfigMsg{}): MessageType(16), reflect.TypeOf(&CoordinatorRestartPoolObserverMsg{}): MessageType(17), reflect.TypeOf(&StratumClientTargetMsg{}): MessageType(18), }
Functions ¶
func GetMessageID ¶
func GetMessageID(m PoolDetectiveMsg) int
Types ¶
type BlockObserverBlockObservedMsg ¶
type BlockObserverBlockObservedMsg struct { Header MsgHeader LocationID int Observed int64 CoinID int PeerIP []byte PeerPort int BlockHash [32]byte }
BlockObserverBlockObservedMsg is sent from the block observer to the hub when one of its peers announces a block
type BlockObserverGetCoinsRequestMsg ¶
type BlockObserverGetCoinsRequestMsg struct {
Header MsgHeader
}
BlockObserverGetCoinsRequestMsg is sent from the block observer to the hub to discover the known coins and their ID
type BlockObserverGetCoinsResponseMsg ¶
type BlockObserverGetCoinsResponseMsg struct { Header MsgHeader Coins []BlockObserverGetCoinsResponseCoin }
BlockObserverBlockObservedMsg is sent from the block observer to the hub when one of its peers announces a block
type ConnectionEvent ¶
type ConnectionEvent int8
const ( ConnectionEventConnected ConnectionEvent = 1 ConnectionEventDisconnected ConnectionEvent = 2 ConnectionEventAuthenticationSucceeded ConnectionEvent = 3 ConnectionEventAuthenticationFailed ConnectionEvent = 4 )
type CoordinatorGetConfigResponseMsg ¶
type CoordinatorGetConfigResponseMsg struct { Header MsgHeader StratumServers []CoordinatorGetConfigResponseStratumServer StratumClientPoolObserverIDs []int }
type CoordinatorRefreshConfigMsg ¶
type CoordinatorRefreshConfigMsg struct {
Header MsgHeader
}
type MessageType ¶
type MessageType int16
func GetMessageType ¶
func GetMessageType(m PoolDetectiveMsg) MessageType
type PoolDetectiveConn ¶
type PoolDetectiveConn struct {
// contains filtered or unexported fields
}
func NewPublisher ¶
func NewPublisher(port int) (*PoolDetectiveConn, error)
func NewServer ¶
func NewServer(port int) (*PoolDetectiveConn, error)
func NewSubscriber ¶
func NewSubscriber(host string, port int) (*PoolDetectiveConn, error)
func (*PoolDetectiveConn) Close ¶
func (pdc *PoolDetectiveConn) Close() error
func (*PoolDetectiveConn) Publish ¶
func (pdc *PoolDetectiveConn) Publish(channel []byte, msg PoolDetectiveMsg) error
func (*PoolDetectiveConn) Recv ¶
func (pdc *PoolDetectiveConn) Recv() (PoolDetectiveMsg, bool, error)
func (*PoolDetectiveConn) RecvSub ¶
func (pdc *PoolDetectiveConn) RecvSub() (PoolDetectiveMsg, []byte, bool, error)
func (*PoolDetectiveConn) Send ¶
func (pdc *PoolDetectiveConn) Send(msg PoolDetectiveMsg) error
func (*PoolDetectiveConn) Subscribe ¶
func (pdc *PoolDetectiveConn) Subscribe(channel []byte) error
type PoolDetectiveMsg ¶
type PoolDetectiveMsg interface { }
func NewMessage ¶
func NewMessage(mt MessageType) PoolDetectiveMsg
type StratumClientConnectionEventMsg ¶
type StratumClientConnectionEventMsg struct { Header MsgHeader PoolObserverID int Event ConnectionEvent Observed int64 }
StratumClientConnectionEventMsg is sent from the stratum client to the hub for connection-level events (connected, disconnected, authenticated, etc)
type StratumClientDifficultyMsg ¶
StratumClientDifficultyMsg is sent from the stratum client to the hub when it received a change in difficulty
type StratumClientExtraNonceMsg ¶
type StratumClientExtraNonceMsg struct { Header MsgHeader PoolObserverID int ExtraNonce1 []byte ExtraNonce2Size int8 }
StratumClientExtraNonceMsg is sent from the stratum client to the hub when it received a change in extranonce data
type StratumClientJobMsg ¶
type StratumClientJobMsg struct { Header MsgHeader PoolObserverID int Observed int64 JobID []byte PreviousBlockHash []byte GenTX1 []byte GenTX2 []byte MerkleBranches [][]byte BlockVersion []byte DifficultyBits []byte Timestamp int64 CleanJobs bool Reserved []byte }
StratumClientJobMsg is sent from the stratum client to the hub when it received a new job
type StratumClientLoginDetailsRequestMsg ¶
StratumClientLoginDetailsRequestMsg is sent from the stratum client to the hub to indicate it wants to receive stratum details to connect to (host, port, login, pwd)
type StratumClientLoginDetailsResponseMsg ¶
type StratumClientLoginDetailsResponseMsg struct { Header MsgHeader Host string Port int Login string Password string Protocol int }
StratumClientLoginDetailsResponseMsg is sent from the stratum client to the hub to indicate it wants to receive stratum details to connect to (host, port, login, pwd)
type StratumClientShareEventMsg ¶
type StratumClientShareEventMsg struct {}
StratumClientShareEventMsg is sent from the stratum client to the hub for share-level events (submitted, accepted, declined)
type StratumClientSubmitShareMsg ¶
type StratumClientSubmitShareMsg struct {}
StratumClientSubmitShareMsg is sent from the hub to the stratum client to have the stratum client submit the share
type StratumClientTargetMsg ¶
StratumClientTargetMsg is sent from the stratum client to the hub when it received a new target
Source Files ¶
- conn.go
- message.go
- msgack.go
- msgblockobserverblockobserved.go
- msgblockobservergetcoinsrequest.go
- msgblockobservergetcoinsresponse.go
- msgcoordinatorgetconfigrequest.go
- msgcoordinatorgetconfigresponse.go
- msgcoordinatorrefreshconfig.go
- msgcoordinatorrestartpoolobserver.go
- msgerror.go
- msgstratumclientconnectionevent.go
- msgstratumclientdifficulty.go
- msgstratumclientextranonce.go
- msgstratumclientjob.go
- msgstratumclientlogindetailsrequest.go
- msgstratumclientlogindetailsresponse.go
- msgstratumclientshareevent.go
- msgstratumclientsubmitshare.go
- msgstratumclienttarget.go
- msgtypes.go
- ports.go
- util.go