forked from hacash/miner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
28 lines (24 loc) · 954 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package message
// type
const (
PoolAndWorkerAgreementVersionNumber uint16 = 1 // Communication protocol version number
// Mining end type
WorkerKindOfBlank uint8 = 0
WorkerKindOfCPU uint8 = 1 // CPU
WorkerKindOfGPU uint8 = 2 // GPU graphics card mining
)
// Error response
const (
MsgErrorRetCodeSuccess uint16 = 0 // OK
MsgErrorRetCodeConnectReadSengErr uint16 = 1 // Message sending or reading error
MsgErrorRetCodeAgreementVersionNumberErr uint16 = 2 // Too many connections
MsgErrorRetCodeTooManyConnects uint16 = 3 // Too many connections
)
// msg
const (
// 0 is an error
MinerWorkMsgTypeWorkerRegistration uint16 = 1 // Worker Registration
MinerWorkMsgTypeServerResponse uint16 = 2 // Server response
MinerWorkMsgTypeMiningBlock uint16 = 3 // Block mining information sent by the ore pool to the miners
MinerWorkMsgTypeReportMiningResult uint16 = 4 // Mining result reporting
)