-
Notifications
You must be signed in to change notification settings - Fork 104
/
Const.go
81 lines (63 loc) · 2.09 KB
/
Const.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package main
import (
"encoding/hex"
"github.com/holiman/uint256"
)
// AuthorizeStat 认证状态
type AuthorizeStat uint8
const (
StatConnected AuthorizeStat = iota
StatSubScribed
StatAuthorized
StatDisconnected
StatExit
)
// Stratum协议类型
type StratumProtocol uint8
const (
// 未知协议
ProtocolUnknown StratumProtocol = iota
// ETHProxy 协议
ProtocolETHProxy
// NiceHash 的 EthereumStratum/1.0.0 协议
ProtocolEthereumStratum
// 传统 Stratum 协议
ProtocolLegacyStratum
)
// NiceHash Ethereum Stratum Protocol 的协议类型前缀
const EthereumStratumPrefix = "ethereumstratum/"
// 响应中使用的 NiceHash Ethereum Stratum Protocol 的版本
const EthereumStratumVersion = "EthereumStratum/1.0.0"
const DownSessionChannelCache uint = 64
const UpSessionChannelCache uint = 512
const UpSessionManagerChannelCache uint = 64
const SessionManagerChannelCache uint = 64
const UpSessionDialTimeoutSeconds Seconds = 15
const UpSessionReadTimeoutSeconds Seconds = 60
const UpSessionUserAgent = "btccom-agent/2.0.0-mu"
const DefaultWorkerName = "__default__"
const DefaultIpWorkerNameFormat = "{1}x{2}x{3}x{4}"
// UpSessionNumPerSubAccount 每个子账户的矿池连接数量
const UpSessionNumPerSubAccount uint8 = 5
const (
CapVersionRolling = "verrol" // ASICBoost version rolling
CapSubmitResponse = "subres" // Send response of mining.submit
)
const DownSessionDisconnectWhenLostAsicboost = true
const UpSessionTLSInsecureSkipVerify = true
const FakeJobNotifyIntervalSeconds Seconds = 30
var FakeJobIDETHPrefixBin = []byte{
0xfa, 0x6e, 0x07, 0x0b, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}
var FakeJobIDETHPrefix = hex.EncodeToString(FakeJobIDETHPrefixBin)
const EthereumInvalidExtraNonce = 0xffffffff
const EthereumJobIDQueueSize = 256
var EthereumPoolDiff1 = uint256.Int{
0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff,
}