change version to 0.1.0 and pass in an agent string on stratum login

This commit is contained in:
cryptonote-social 2020-07-26 08:24:28 -07:00
parent 493d427ccd
commit 64df7ee6dd
9 changed files with 17 additions and 13 deletions

View File

@ -12,7 +12,7 @@ import (
const (
APPLICATION_NAME = "cryptonote.social Monero miner"
VERSION_STRING = "0.0.8"
VERSION_STRING = "0.1.0"
STATS_WEBPAGE = "https://cryptonote.social/xmr"
DONATE_USERNAME = "donate-getmonero-org"
@ -29,7 +29,7 @@ var (
startDiff = flag.Int("start_diff", 0, "a starting difficulty value for the pool")
)
func MultiMain(s ScreenStater) {
func MultiMain(s ScreenStater, agent string) {
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), "==== %s %s ====\n", APPLICATION_NAME, VERSION_STRING)
fmt.Fprint(flag.CommandLine.Output(),
@ -102,7 +102,7 @@ func MultiMain(s ScreenStater) {
crylog.Info("Miner username:", *uname)
crylog.Info("Threads:", *threads)
if Mine(s, *threads, *uname, *rigid, *saver, hr1, hr2, *startDiff, *tls) != nil {
if Mine(s, *threads, *uname, *rigid, *saver, hr1, hr2, *startDiff, *tls, agent) != nil {
crylog.Error("Miner failed:", err)
}
}

View File

@ -1,4 +1,4 @@
csminer v0.0.8 (Linux/Gnome version)
csminer v0.1.0 (Linux/Gnome version)
SYNOPSIS

View File

@ -12,7 +12,7 @@ import (
)
func main() {
csminer.MultiMain(GnomeScreenStater{})
csminer.MultiMain(GnomeScreenStater{}, csminer.VERSION_STRING+" (linux)")
}
type GnomeScreenStater struct {

View File

@ -71,11 +71,11 @@ type ScreenStater interface {
GetScreenStateChannel() (chan ScreenState, error)
}
func Mine(s ScreenStater, threads int, uname, rigid string, saver bool, excludeHrStart int, excludeHrEnd int, startDiff int, useTLS bool) error {
func Mine(s ScreenStater, threads int, uname, rigid string, saver bool, excludeHrStart int, excludeHrEnd int, startDiff int, useTLS bool, agent string) error {
if useTLS {
cl = client.NewClient("cryptonote.social:5556")
cl = client.NewClient("cryptonote.social:5556", agent)
} else {
cl = client.NewClient("cryptonote.social:5555")
cl = client.NewClient("cryptonote.social:5555", agent)
}
startTime = time.Now()
lastStatsResetTime = time.Now()

View File

@ -1,4 +1,4 @@
csminer v0.0.8 (OSX version)
csminer v0.1.0 (OSX version)
SYNOPSIS

View File

@ -107,5 +107,5 @@ func getBatteryPowerState() (bool, error) {
}
func main() {
csminer.MultiMain(OSXScreenStater{})
csminer.MultiMain(OSXScreenStater{}, csminer.VERSION_STRING+" (osx)")
}

View File

@ -55,14 +55,16 @@ type MultiClientJob struct {
type Client struct {
address string
agent string
conn net.Conn
JobChannel chan *MultiClientJob
responseChannel chan *SubmitWorkResponse
}
func NewClient(address string) *Client {
func NewClient(address string, agent string) *Client {
return &Client{
address: address,
agent: agent,
}
}
@ -91,10 +93,12 @@ func (cl *Client) Connect(uname, pw, rigid string, useTLS bool) error {
Login string `json:"login"`
Pass string `json:"pass"`
RigID string `json:"rigid"`
Agent string
}{
Login: uname,
Pass: pw,
RigID: rigid,
Agent: cl.agent,
},
}

View File

@ -1,4 +1,4 @@
csminer v0.0.8 (Windows version)
csminer v0.1.0 (Windows version)
SYNOPSIS

View File

@ -50,5 +50,5 @@ func GetScreenStateChannel() (chan bool, error) {
}
func main() {
csminer.MultiMain(WinScreenStater{})
csminer.MultiMain(WinScreenStater{}, csminer.VERSION_STRING+" (win)")
}