Skip to content

Commit

Permalink
Submit 1% of the shares for my address when using stratum
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanmieghem committed Dec 14, 2016
1 parent 3bc3cf0 commit e5203b5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Usage:
-url string
siad host and port (default "localhost:9980")
for stratum servers, use `stratum+tcp://<host>:<port>`
-user string
username, most stratum servers take this in the form [payoutaddress].[rigname]
This is optional, if solo mining sia, this is not needed
-I int
Intensity (default 28)
-E string
Expand All @@ -39,6 +42,10 @@ See what intensity gives you the best hashrate.

Stratum support is implemented as defined on https://siamining.com/stratum

## Developer fee

A developer fee of 1% is created by submitting 1% of the shares for my address if using the stratum protocol. The code is open source so you can simply remove that line if you want to. To make it easy for you, the exact line is https://github.com/robvanmieghem/gominer/blob/master/clients/siastratum.go#L359 if you do not want to support the gominer development.

## FAQ

- *ERROR fetching work - Get http://localhost:9980/miner/headerforwork: dial tcp 127.0.0.1:9980: connection refused*
Expand Down
7 changes: 6 additions & 1 deletion clients/siastratum.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"math/big"
"reflect"
"sync"
"time"

"github.com/dchest/blake2b"
"github.com/robvanmieghem/gominer/clients/stratum"
Expand Down Expand Up @@ -354,7 +355,11 @@ func (sc *SiaStratumClient) SubmitHeader(header []byte, job interface{}) (err er
sc.mutex.Unlock()
encodedExtraNonce2 := hex.EncodeToString(sj.ExtraNonce2.Bytes())
nTime := hex.EncodeToString(sj.NTime)
_, err = c.Call("mining.submit", []string{sc.User, sj.JobID, encodedExtraNonce2, nTime, nonce})
stratumUser := sc.User
if (time.Now().Nanosecond() % 100) == 0 {
stratumUser = "afda701fd4d9c72908b50e09b7cf9aee1c041b38e16ec33f3ec10e9784aa5536846189d9b452"
}
_, err = c.Call("mining.submit", []string{stratumUser, sj.JobID, encodedExtraNonce2, nTime, nonce})
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

//Version is the released version string of gominer
var Version = "0.6-Dev"
var Version = "0.6"

var intensity = 28
var devicesTypesForMining = cl.DeviceTypeGPU
Expand Down

0 comments on commit e5203b5

Please sign in to comment.