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. 2
      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 @@ @@ -2,7 +2,7 @@
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)
**Stratum feature list:**
@ -44,7 +44,7 @@ Install Golang and required packages: @@ -44,7 +44,7 @@ Install Golang and required packages:
Clone stratum:
git clone https://github.com/sammy007/monero-stratum.git
git clone https://github.com/kevacoin-project/keva-stratum.git
cd monero-stratum
Build stratum:
@ -70,7 +70,7 @@ Install Golang and required packages: @@ -70,7 +70,7 @@ Install Golang and required packages:
Clone stratum:
git clone https://github.com/sammy007/monero-stratum.git
git clone https://github.com/kevacoin-project/keva-stratum.git
cd monero-stratum
Build stratum:

10
build/env.sh

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

4
main.go

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

2
pool/pool.go

@ -36,6 +36,8 @@ type Upstream struct { @@ -36,6 +36,8 @@ type Upstream struct {
Host string `json:"host"`
Port int `json:"port"`
Timeout string `json:"timeout"`
User string `json:"user"`
Password string `json:"password"`
}
type Frontend struct {

7
rpc/rpc.go

@ -11,7 +11,7 @@ import ( @@ -11,7 +11,7 @@ import (
"sync/atomic"
"time"
"github.com/sammy007/monero-stratum/pool"
"github.com/kevacoin-project/keva-stratum/pool"
)
type RPCClient struct {
@ -54,12 +54,13 @@ type JSONRpcResp struct { @@ -54,12 +54,13 @@ type JSONRpcResp struct {
}
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)
if err != nil {
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)
rpcClient.client = &http.Client{
Timeout: timeout,

4
stratum/api.go

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

2
stratum/blocks.go

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

2
stratum/handlers.go

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

4
stratum/miner.go

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

6
stratum/stratum.go

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

2
util/util.go

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

Loading…
Cancel
Save