Browse Source

Merge pull request #40 from yuriy0803/ubiq-pool

Ubiq-pool golang/go
master
yuriy0803 3 years ago committed by GitHub
parent
commit
b1777fb577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      api.json
  2. 2
      proxy/blocks.go
  3. 28
      proxy/miner.go

8
api.json

@ -1,10 +1,10 @@
{
"threads": 4,
"coin": "etc",
"coin": "ubiq",
"name": "main",
"pplns": 9000,
"network": "classic",
"coin-name":"etc",
"network": "ubiq",
"coin-name":"ubq",
"proxy": {
"enabled": true,
@ -98,7 +98,7 @@
"exchange": {
"enabled": true,
"url": "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=ethereum-classic",
"url": "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=ubiq",
"timeout": "50s",
"refreshInterval": "900s"
},

2
proxy/blocks.go

@ -7,7 +7,7 @@ import (
"strings"
"sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ubiq/go-ubiq/common"
"github.com/yuriy0803/open-etc-pool-friends/rpc"
"github.com/yuriy0803/open-etc-pool-friends/util"
)

28
proxy/miner.go

@ -6,36 +6,14 @@ import (
"strconv"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/yuriy0803/etchash"
"github.com/ubiq/go-ubiq/common"
"github.com/yuriy0803/ubqhash"
)
var (
maxUint256 = new(big.Int).Exp(big.NewInt(2), big.NewInt(256), big.NewInt(0))
ecip1099FBlockClassic uint64 = 11700000 // classic mainnet
ecip1099FBlockMordor uint64 = 2520000 // mordor
uip1FEpoch uint64 = 22 // ubiq mainnet
hasher *etchash.Etchash = nil
)
var hasher = ubqhash.New()
func (s *ProxyServer) processShare(login, id, ip string, t *BlockTemplate, params []string) (bool, bool) {
if hasher == nil {
if s.config.Network == "classic" {
hasher = etchash.New(&ecip1099FBlockClassic, nil)
} else if s.config.Network == "mordor" {
hasher = etchash.New(&ecip1099FBlockMordor, nil)
} else if s.config.Network == "ubiq" {
hasher = etchash.New(nil, &uip1FEpoch)
} else if s.config.Network == "ethereum" || s.config.Network == "ropsten" {
hasher = etchash.New(nil, nil)
} else {
// unknown network
log.Printf("Unknown network configuration %s", s.config.Network)
return false, false
}
}
nonceHex := params[0]
hashNoNonce := params[1]
mixDigest := params[2]

Loading…
Cancel
Save