Skip to content

Commit

Permalink
supports frkhash
Browse files Browse the repository at this point in the history
supports frkhash
  • Loading branch information
yuriy0803 committed Nov 28, 2023
1 parent b79b149 commit 0dd343b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/yuriy0803/open-etc-pool-friends
go 1.19

require (
github.com/gorilla/mux v1.8.0
github.com/gorilla/mux v1.8.1
github.com/robfig/cron v1.2.0
github.com/yuriy0803/core-geth1 v0.0.0-20231028143816-9cc1f7728b95
github.com/yuriy0803/etchash v0.0.0-20231101190535-3e061b3bab83
github.com/yuriy0803/core-geth1 v0.0.0-20231122180645-3601ffad87c7
github.com/yuriy0803/etchash v0.0.0-20231128170642-42138ef896b6
github.com/yvasiyarov/gorelic v0.0.7
gopkg.in/redis.v3 v3.6.4
)
Expand All @@ -17,12 +17,12 @@ require (
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/garyburd/redigo v1.6.4 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/holiman/uint256 v1.2.3 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.29.0 // indirect
github.com/yvasiyarov/go-metrics v0.0.0-20150112132944-c25f46c4b940 // indirect
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20160601141957-9c099fbc30e9 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/sys v0.15.0 // indirect
gopkg.in/bsm/ratelimit.v1 v1.0.0-20170922094635-f56db5e73a5e // indirect
)
13 changes: 13 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o=
github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw=
github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU=
github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
Expand All @@ -52,8 +56,12 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuriy0803/core-geth1 v0.0.0-20231028143816-9cc1f7728b95 h1:RyT3fy3GZKNIKw0FKcQsvMSkdQLaJ3NY/tmKQbuxy3g=
github.com/yuriy0803/core-geth1 v0.0.0-20231028143816-9cc1f7728b95/go.mod h1:ig3WlkZEoxpZuLcu3mN+t7BOhVaZ6lEciDsovHYaZDI=
github.com/yuriy0803/core-geth1 v0.0.0-20231122180645-3601ffad87c7 h1:Qh1lF49wclbdRRypBz9ZhQ9NRmHAxPLwTwS/Lsc8CjY=
github.com/yuriy0803/core-geth1 v0.0.0-20231122180645-3601ffad87c7/go.mod h1:yf10EqBwKdsy8nnhlSvJFXwzhBh0/btBez47+g+faY8=
github.com/yuriy0803/etchash v0.0.0-20231101190535-3e061b3bab83 h1:85YNTK2bQbT9JM9O2VkGXQXesWcAe3j6iSd7c5nX37M=
github.com/yuriy0803/etchash v0.0.0-20231101190535-3e061b3bab83/go.mod h1:3bPvXxlZEQd6ds3UEC8vbe7xIJO0wMNxxX7iAQmWEHE=
github.com/yuriy0803/etchash v0.0.0-20231128170642-42138ef896b6 h1:IKYqIDgCEwpci6iCAABzeVR297AjL/Y/tWiyxYa+S94=
github.com/yuriy0803/etchash v0.0.0-20231128170642-42138ef896b6/go.mod h1:3bPvXxlZEQd6ds3UEC8vbe7xIJO0wMNxxX7iAQmWEHE=
github.com/yvasiyarov/go-metrics v0.0.0-20150112132944-c25f46c4b940 h1:p7OofyZ509h8DmPLh8Hn+EIIZm/xYhdZHJ9GnXHdr6U=
github.com/yvasiyarov/go-metrics v0.0.0-20150112132944-c25f46c4b940/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
github.com/yvasiyarov/gorelic v0.0.7 h1:4DTF1WOM2ZZS/xMOkTFBOcb6XiHu/PKn3rVo6dbewQE=
Expand All @@ -65,6 +73,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All @@ -86,9 +96,12 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
Expand Down
13 changes: 8 additions & 5 deletions proxy/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,24 @@ var (
ecip1099FBlockClassic uint64 = 11700000 // classic mainnet
ecip1099FBlockMordor uint64 = 2520000 // mordor
uip1FEpoch uint64 = 22 // ubiq mainnet
xip5Block uint64 = 0 // expanse rebirth network
hasher *etchash.Etchash = nil
)

func (s *ProxyServer) processShare(login, id, ip string, t *BlockTemplate, params []string, stratum bool) (bool, bool) {

if hasher == nil {
switch s.config.Network {
case "expanse":
hasher = etchash.New(nil, nil, &xip5Block) // expanse rebirth network
case "classic":
hasher = etchash.New(&ecip1099FBlockClassic, nil) // classic mainnet
hasher = etchash.New(&ecip1099FBlockClassic, nil, nil) // classic mainnet
case "mordor":
hasher = etchash.New(&ecip1099FBlockMordor, nil) // mordor
hasher = etchash.New(&ecip1099FBlockMordor, nil, nil) // mordor
case "ubiq":
hasher = etchash.New(nil, &uip1FEpoch) // ubiq mainnet
case "ethereum", "ropsten", "ethereumPow", "ethereumFair", "callisto", "etica", "expanse", "octaspace", "universal", "canxium":
hasher = etchash.New(nil, nil) //ethash
hasher = etchash.New(nil, &uip1FEpoch, nil) // ubiq mainnet
case "ethereum", "ropsten", "ethereumPow", "ethereumFair", "callisto", "etica", "octaspace", "universal", "canxium":
hasher = etchash.New(nil, nil, nil) //ethash
default:
log.Printf("Unknown network configuration %s", s.config.Network)
return false, false
Expand Down

0 comments on commit 0dd343b

Please sign in to comment.