forked from rpcpool/tpu-traffic-classifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validator-ports.go
43 lines (33 loc) · 852 Bytes
/
validator-ports.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
package main
import "strconv"
type ValidatorPorts struct {
TPU uint16
TPUfwd uint16
TPUvote uint16
TPUquic uint16
TPUquicfwd uint16
}
func (vp *ValidatorPorts) TPUstr() string {
return strconv.FormatUint(uint64(vp.TPU), 10)
}
func (vp *ValidatorPorts) TPUquicstr() string {
return strconv.FormatUint(uint64(vp.TPUquic), 10)
}
func (vp *ValidatorPorts) Fwdstr() string {
return strconv.FormatUint(uint64(vp.TPUfwd), 10)
}
func (vp *ValidatorPorts) TPUquicfwdstr() string {
return strconv.FormatUint(uint64(vp.TPUquicfwd), 10)
}
func (vp *ValidatorPorts) Votestr() string {
return strconv.FormatUint(uint64(vp.TPUvote), 10)
}
func NewValidatorPorts(tpu uint16, tpu_quic uint16) *ValidatorPorts {
return &ValidatorPorts{
TPU: tpu,
TPUfwd: tpu + 1,
TPUvote: tpu + 2,
TPUquic: tpu_quic,
TPUquicfwd: tpu_quic+1,
}
}