mirror of
https://github.com/8lecramm/derohe-proxy.git
synced 2025-01-10 13:57:56 +00:00
fixed broken repo
This commit is contained in:
parent
7d88c5ac2c
commit
b586355300
@ -4,12 +4,13 @@ var command_line string = `derohe-proxy
|
||||
Proxy to combine all miners and to reduce network load
|
||||
|
||||
Usage:
|
||||
derohe-proxy [--listen-address=<127.0.0.1:10100>] [--log-interval=<60>] --daemon-address=<1.2.3.4:10100>
|
||||
derohe-proxy [--listen-address=<127.0.0.1:10100>] [--log-interval=<60>] [--minimal-jobs] --daemon-address=<1.2.3.4:10100>
|
||||
|
||||
Options:
|
||||
--listen-address=<127.0.0.1:10100> bind to specific address:port, default is 0.0.0.0:10200
|
||||
--daemon-address=<1.2.3.4:10100> connect to this daemon
|
||||
--log-interval=<60> set logging interval in seconds (range 60 - 3600), default is 60 seconds
|
||||
--minimal-jobs forward only 2 jobs per block (1 for miniblocks and 1 for final miniblock), by default all jobs are forwarded
|
||||
|
||||
Example Mainnet: ./derohe-proxy --daemon-address=minernode1.dero.io:10100
|
||||
`
|
||||
@ -22,3 +23,6 @@ var daemon_address string = "minernode1.dero.io:10100"
|
||||
|
||||
// logging interval in seconds
|
||||
var log_intervall int = 60
|
||||
|
||||
// send only 2 jobs per block
|
||||
var minimal = false
|
||||
|
BIN
derohe-proxy
Normal file
BIN
derohe-proxy
Normal file
Binary file not shown.
@ -51,6 +51,11 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
if Arguments["--minimal-jobs"] != nil {
|
||||
minimal = true
|
||||
fmt.Printf("Forward 2 jobs per block\n")
|
||||
}
|
||||
|
||||
fmt.Printf("Logging every %d seconds\n", log_intervall)
|
||||
|
||||
go proxy.Start_server(listen_addr)
|
||||
@ -59,7 +64,7 @@ func main() {
|
||||
for proxy.CountMiners() < 1 {
|
||||
time.Sleep(time.Second * 1)
|
||||
}
|
||||
go proxy.Start_client(daemon_address, proxy.Address)
|
||||
go proxy.Start_client(daemon_address, proxy.Address, minimal)
|
||||
|
||||
for {
|
||||
time.Sleep(time.Second * time.Duration(log_intervall))
|
||||
|
@ -18,8 +18,10 @@ var Minis uint64
|
||||
var Rejected uint64
|
||||
|
||||
// proxy-client
|
||||
func Start_client(v string, w string) {
|
||||
func Start_client(v string, w string, min_jobs bool) {
|
||||
var err error
|
||||
var last_diff uint64
|
||||
var last_height uint64
|
||||
|
||||
rand.Seed(time.Now().UnixMilli())
|
||||
|
||||
@ -60,7 +62,15 @@ func Start_client(v string, w string) {
|
||||
Minis = params.MiniBlocks
|
||||
Rejected = params.Rejected
|
||||
|
||||
go SendTemplateToNodes(recv_data)
|
||||
if min_jobs {
|
||||
if params.Height != last_height || params.Difficultyuint64 != last_diff {
|
||||
last_height = params.Height
|
||||
last_diff = params.Difficultyuint64
|
||||
go SendTemplateToNodes(recv_data)
|
||||
}
|
||||
} else {
|
||||
go SendTemplateToNodes(recv_data)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user