diff --git a/capi/capi.go b/capi/capi.go index e59e01d..d1b25b9 100644 --- a/capi/capi.go +++ b/capi/capi.go @@ -13,7 +13,8 @@ func PoolLogin( rigid *C.char, wallet *C.char, agent *C.char, - config *C.char) ( + config *C.char, + bool dev) ( code int, message *C.char) { args := &minerlib.PoolLoginArgs{ @@ -23,6 +24,7 @@ func PoolLogin( Agent: C.GoString(agent), Config: C.GoString(config), UseTLS: true, + Dev: dev, } resp := minerlib.PoolLogin(args) return resp.Code, C.CString(resp.Message) diff --git a/capi/niceapi.h b/capi/niceapi.h index ea18e61..ab6fc9b 100644 --- a/capi/niceapi.h +++ b/capi/niceapi.h @@ -20,6 +20,8 @@ typedef struct pool_login_args { const char* agent; // config: advanced options config string, can be empty string const char* config; + // dev: set to true to connect to develompent server instead of prod + bool dev; } pool_login_args; @@ -44,7 +46,8 @@ pool_login_response pool_login(const pool_login_args *args) { (char*)args->rigid, (char*)args->wallet, (char*)args->agent, - (char*)args->config); + (char*)args->config, + args->dev); pool_login_response response; response.code = (int)r.r0; response.message = r.r1; diff --git a/linux/README.txt b/linux/README.txt index 2f69798..a8bf415 100644 --- a/linux/README.txt +++ b/linux/README.txt @@ -1,4 +1,4 @@ -csminer v0.2.0 (Linux/Gnome version) +csminer v0.3.0 (Linux/Gnome version) SYNOPSIS @@ -66,6 +66,9 @@ username and you can login with the username alone, e.g.: ./csminer -user=your-chosen-username +Wallet address must be specified however if you want to send authenticated chat messages or +make config updates such as changing your notification e-mail address. + Implementation csminer utilizes the RandomX implementation from https://github.com/tevador/RandomX and will @@ -73,4 +76,5 @@ perform similarly to other mining software based on this library such as xmrig. Feedback & Bug Reports -Send to: +Send to: , or send a chat to the build-in chatroom using the "c " key command. diff --git a/miner.go b/miner.go index 661bd3e..d568890 100644 --- a/miner.go +++ b/miner.go @@ -46,6 +46,7 @@ type MinerConfig struct { ExcludeHrStart, ExcludeHrEnd int UseTLS bool AdvancedConfig string + Dev bool } func Mine(c *MinerConfig) error { @@ -75,6 +76,7 @@ func Mine(c *MinerConfig) error { Agent: c.Agent, Config: c.AdvancedConfig, UseTLS: c.UseTLS, + Dev: c.Dev, }) if plResp.Code < 0 { crylog.Error("Pool server not responding:", plResp.Message) diff --git a/minerlib/minerlib.go b/minerlib/minerlib.go index 397c1ad..9d4e2b4 100644 --- a/minerlib/minerlib.go +++ b/minerlib/minerlib.go @@ -116,6 +116,9 @@ type PoolLoginArgs struct { // UseTLS: Whether to use TLS when connecting to the pool UseTLS bool + + // Dev: Whether to connect to the dev server or prod + Dev bool } type PoolLoginResponse struct { @@ -174,6 +177,20 @@ func getMiningActivityState() int { return MINING_ACTIVE } +func getServerHostPort(useTLS, dev bool) string { + switch { + case useTLS && !dev: + return "cryptonote.social:5556" + case !useTLS && !dev: + return "cryptonote.social:5555" + case useTLS && !dev: + return "cryptonote.social:4445" + // case !useTLS && dev: + default: + return "cryptonote.social:4444" + } +} + // Called by the user to log into the pool for the first time, or re-log into the pool with new // credentials. func PoolLogin(args *PoolLoginArgs) *PoolLoginResponse { @@ -207,10 +224,7 @@ func PoolLogin(args *PoolLoginArgs) *PoolLoginResponse { agent := args.Agent config := args.Config rigid := args.RigID - dest := "cryptonote.social:5555" - if args.UseTLS { - dest = "cryptonote.social:5556" - } + dest := getServerHostPort(args.UseTLS, args.Dev) err, code, message, jc := cl.Connect(dest, args.UseTLS, agent, loginName, config, rigid) if err != nil { if code != 0 {