mirror of
https://github.com/kvazar-network/keva-stratum.git
synced 2025-01-26 23:04:42 +00:00
Fixed cmake build.
This commit is contained in:
parent
f26802a26c
commit
55a7110af2
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,6 +12,7 @@ Makefile
|
||||
*.a
|
||||
*.so
|
||||
*.dylib
|
||||
keva-stratum
|
||||
|
||||
# Configs
|
||||
config.json
|
||||
|
17
.vscode/launch.json
vendored
Normal file
17
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "exec",
|
||||
"program": "${workspaceFolder}/build/bin/keva-stratum",
|
||||
"env": {},
|
||||
"args": []
|
||||
}
|
||||
]
|
||||
}
|
@ -1,11 +1,6 @@
|
||||
cmake_minimum_required (VERSION 2.8.11)
|
||||
project(pool)
|
||||
|
||||
project(keva-stratum)
|
||||
|
||||
add_subdirectory(cnutil)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT build/bin
|
||||
COMMAND build/env.sh go get -v ./...
|
||||
)
|
||||
|
||||
add_custom_target(build ALL DEPENDS cnutil ${CMAKE_CURRENT_BINARY_DIR}/build/bin)
|
||||
|
32
build/env.sh
32
build/env.sh
@ -1,32 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -f "build/env.sh" ]; then
|
||||
echo "$0 must be run from the root of the repository."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Create fake Go workspace if it doesn't exist yet.
|
||||
workspace="$PWD/build/_workspace"
|
||||
root="$PWD"
|
||||
ethdir="$workspace/src/github.com/kevacoin-project"
|
||||
if [ ! -L "$ethdir/keva-stratum" ]; then
|
||||
mkdir -p "$ethdir"
|
||||
cd "$ethdir"
|
||||
ln -s ../../../../../. keva-stratum
|
||||
cd "$root"
|
||||
fi
|
||||
|
||||
# Set up the environment to use the workspace.
|
||||
# Also add Godeps workspace so we build using canned dependencies.
|
||||
GOPATH="$workspace"
|
||||
GOBIN="$PWD/build/bin"
|
||||
export GOPATH GOBIN
|
||||
|
||||
# Run the command inside the workspace.
|
||||
cd "$ethdir/keva-stratum"
|
||||
PWD="$ethdir/keva-stratum"
|
||||
|
||||
# Launch the arguments with the configured environment.
|
||||
exec "$@"
|
@ -1,7 +1,7 @@
|
||||
package cnutil
|
||||
|
||||
// #cgo CFLAGS: -std=c11 -D_GNU_SOURCE
|
||||
// #cgo LDFLAGS: -L${SRCDIR} -lcnutil -Wl,-rpath ${SRCDIR} -lstdc++
|
||||
// #cgo LDFLAGS: -L${SRCDIR} -Wl,-rpath=\$ORIGIN/cnutil -lcnutil -Wl,-rpath ${SRCDIR} -lstdc++
|
||||
// #include <stdlib.h>
|
||||
// #include "src/cnutil.h"
|
||||
import "C"
|
||||
|
4
main.go
4
main.go
@ -10,8 +10,8 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/kevacoin-project/keva-stratum/pool"
|
||||
"github.com/kevacoin-project/keva-stratum/stratum"
|
||||
"./pool"
|
||||
"./stratum"
|
||||
|
||||
"github.com/goji/httpauth"
|
||||
"github.com/gorilla/mux"
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/kevacoin-project/keva-stratum/pool"
|
||||
"../pool"
|
||||
)
|
||||
|
||||
type RPCClient struct {
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/kevacoin-project/keva-stratum/rpc"
|
||||
"github.com/kevacoin-project/keva-stratum/util"
|
||||
"../rpc"
|
||||
"../util"
|
||||
)
|
||||
|
||||
func (s *StratumServer) StatsIndex(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"log"
|
||||
"math/big"
|
||||
|
||||
"github.com/kevacoin-project/keva-stratum/cnutil"
|
||||
"../cnutil"
|
||||
)
|
||||
|
||||
type BlockTemplate struct {
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/kevacoin-project/keva-stratum/util"
|
||||
"../util"
|
||||
)
|
||||
|
||||
var noncePattern *regexp.Regexp
|
||||
|
@ -10,8 +10,8 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/kevacoin-project/keva-stratum/cnutil"
|
||||
"github.com/kevacoin-project/keva-stratum/util"
|
||||
"../cnutil"
|
||||
"../util"
|
||||
)
|
||||
|
||||
type Job struct {
|
||||
|
@ -13,9 +13,9 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/kevacoin-project/keva-stratum/pool"
|
||||
"github.com/kevacoin-project/keva-stratum/rpc"
|
||||
"github.com/kevacoin-project/keva-stratum/util"
|
||||
"../pool"
|
||||
"../rpc"
|
||||
"../util"
|
||||
)
|
||||
|
||||
type StratumServer struct {
|
||||
@ -53,11 +53,11 @@ type Endpoint struct {
|
||||
type Session struct {
|
||||
lastBlockHeight int64
|
||||
sync.Mutex
|
||||
conn *net.TCPConn
|
||||
enc *json.Encoder
|
||||
ip string
|
||||
endpoint *Endpoint
|
||||
validJobs []*Job
|
||||
conn *net.TCPConn
|
||||
enc *json.Encoder
|
||||
ip string
|
||||
endpoint *Endpoint
|
||||
validJobs []*Job
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/kevacoin-project/keva-stratum/cnutil"
|
||||
"../cnutil"
|
||||
)
|
||||
|
||||
var Diff1 = StringToBig("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")
|
||||
|
Loading…
x
Reference in New Issue
Block a user