Browse Source

Changed package name.

pool
Jianping Wu 6 years ago
parent
commit
cc1c9054ec
  1. 6
      README.md
  2. 10
      build/env.sh
  3. 4
      main.go
  4. 10
      pool/pool.go
  5. 7
      rpc/rpc.go
  6. 4
      stratum/api.go
  7. 2
      stratum/blocks.go
  8. 2
      stratum/handlers.go
  9. 4
      stratum/miner.go
  10. 6
      stratum/stratum.go
  11. 2
      util/util.go

6
README.md

@ -2,7 +2,7 @@
High performance CryptoNote mining stratum with Web-interface written in Golang. High performance CryptoNote mining stratum with Web-interface written in Golang.
[![Go Report Card](https://goreportcard.com/badge/github.com/sammy007/monero-stratum)](https://goreportcard.com/report/github.com/sammy007/monero-stratum) [![Go Report Card](https://goreportcard.com/badge/github.com/kevacoin-project/keva-stratum)](https://goreportcard.com/report/github.com/kevacoin-project/keva-stratum)
[![CircleCI](https://circleci.com/gh/sammy007/monero-stratum.svg?style=svg)](https://circleci.com/gh/sammy007/monero-stratum) [![CircleCI](https://circleci.com/gh/sammy007/monero-stratum.svg?style=svg)](https://circleci.com/gh/sammy007/monero-stratum)
**Stratum feature list:** **Stratum feature list:**
@ -44,7 +44,7 @@ Install Golang and required packages:
Clone stratum: Clone stratum:
git clone https://github.com/sammy007/monero-stratum.git git clone https://github.com/kevacoin-project/keva-stratum.git
cd monero-stratum cd monero-stratum
Build stratum: Build stratum:
@ -70,7 +70,7 @@ Install Golang and required packages:
Clone stratum: Clone stratum:
git clone https://github.com/sammy007/monero-stratum.git git clone https://github.com/kevacoin-project/keva-stratum.git
cd monero-stratum cd monero-stratum
Build stratum: Build stratum:

10
build/env.sh

@ -10,11 +10,11 @@ fi
# Create fake Go workspace if it doesn't exist yet. # Create fake Go workspace if it doesn't exist yet.
workspace="$PWD/build/_workspace" workspace="$PWD/build/_workspace"
root="$PWD" root="$PWD"
ethdir="$workspace/src/github.com/sammy007" ethdir="$workspace/src/github.com/kevacoin-project"
if [ ! -L "$ethdir/monero-stratum" ]; then if [ ! -L "$ethdir/keva-stratum" ]; then
mkdir -p "$ethdir" mkdir -p "$ethdir"
cd "$ethdir" cd "$ethdir"
ln -s ../../../../../. monero-stratum ln -s ../../../../../. keva-stratum
cd "$root" cd "$root"
fi fi
@ -25,8 +25,8 @@ GOBIN="$PWD/build/bin"
export GOPATH GOBIN export GOPATH GOBIN
# Run the command inside the workspace. # Run the command inside the workspace.
cd "$ethdir/monero-stratum" cd "$ethdir/keva-stratum"
PWD="$ethdir/monero-stratum" PWD="$ethdir/keva-stratum"
# Launch the arguments with the configured environment. # Launch the arguments with the configured environment.
exec "$@" exec "$@"

4
main.go

@ -10,8 +10,8 @@ import (
"runtime" "runtime"
"time" "time"
"github.com/sammy007/monero-stratum/pool" "github.com/kevacoin-project/keva-stratum/pool"
"github.com/sammy007/monero-stratum/stratum" "github.com/kevacoin-project/keva-stratum/stratum"
"github.com/goji/httpauth" "github.com/goji/httpauth"
"github.com/gorilla/mux" "github.com/gorilla/mux"

10
pool/pool.go

@ -32,10 +32,12 @@ type Port struct {
} }
type Upstream struct { type Upstream struct {
Name string `json:"name"` Name string `json:"name"`
Host string `json:"host"` Host string `json:"host"`
Port int `json:"port"` Port int `json:"port"`
Timeout string `json:"timeout"` Timeout string `json:"timeout"`
User string `json:"user"`
Password string `json:"password"`
} }
type Frontend struct { type Frontend struct {

7
rpc/rpc.go

@ -11,7 +11,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/sammy007/monero-stratum/pool" "github.com/kevacoin-project/keva-stratum/pool"
) )
type RPCClient struct { type RPCClient struct {
@ -54,12 +54,13 @@ type JSONRpcResp struct {
} }
func NewRPCClient(cfg *pool.Upstream) (*RPCClient, error) { func NewRPCClient(cfg *pool.Upstream) (*RPCClient, error) {
rawUrl := fmt.Sprintf("http://%s:%v/json_rpc", cfg.Host, cfg.Port) //rawUrl := fmt.Sprintf("http://%s:%v/json_rpc", cfg.Host, cfg.Port)
rawUrl := fmt.Sprintf("http://%s:%v", cfg.Host, cfg.Port)
url, err := url.Parse(rawUrl) url, err := url.Parse(rawUrl)
if err != nil { if err != nil {
return nil, err return nil, err
} }
rpcClient := &RPCClient{Name: cfg.Name, Url: url} rpcClient := &RPCClient{Name: cfg.Name, Url: url, login: cfg.User, password: cfg.Password}
timeout, _ := time.ParseDuration(cfg.Timeout) timeout, _ := time.ParseDuration(cfg.Timeout)
rpcClient.client = &http.Client{ rpcClient.client = &http.Client{
Timeout: timeout, Timeout: timeout,

4
stratum/api.go

@ -6,8 +6,8 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/sammy007/monero-stratum/rpc" "github.com/kevacoin-project/keva-stratum/rpc"
"github.com/sammy007/monero-stratum/util" "github.com/kevacoin-project/keva-stratum/util"
) )
func (s *StratumServer) StatsIndex(w http.ResponseWriter, r *http.Request) { func (s *StratumServer) StatsIndex(w http.ResponseWriter, r *http.Request) {

2
stratum/blocks.go

@ -7,7 +7,7 @@ import (
"log" "log"
"math/big" "math/big"
"github.com/sammy007/monero-stratum/cnutil" "github.com/kevacoin-project/keva-stratum/cnutil"
) )
type BlockTemplate struct { type BlockTemplate struct {

2
stratum/handlers.go

@ -6,7 +6,7 @@ import (
"strings" "strings"
"sync/atomic" "sync/atomic"
"github.com/sammy007/monero-stratum/util" "github.com/kevacoin-project/keva-stratum/util"
) )
var noncePattern *regexp.Regexp var noncePattern *regexp.Regexp

4
stratum/miner.go

@ -10,8 +10,8 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/sammy007/monero-stratum/cnutil" "github.com/kevacoin-project/keva-stratum/cnutil"
"github.com/sammy007/monero-stratum/util" "github.com/kevacoin-project/keva-stratum/util"
) )
type Job struct { type Job struct {

6
stratum/stratum.go

@ -13,9 +13,9 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/sammy007/monero-stratum/pool" "github.com/kevacoin-project/keva-stratum/pool"
"github.com/sammy007/monero-stratum/rpc" "github.com/kevacoin-project/keva-stratum/rpc"
"github.com/sammy007/monero-stratum/util" "github.com/kevacoin-project/keva-stratum/util"
) )
type StratumServer struct { type StratumServer struct {

2
util/util.go

@ -6,7 +6,7 @@ import (
"time" "time"
"unicode/utf8" "unicode/utf8"
"github.com/sammy007/monero-stratum/cnutil" "github.com/kevacoin-project/keva-stratum/cnutil"
) )
var Diff1 = StringToBig("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") var Diff1 = StringToBig("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")

Loading…
Cancel
Save