Skip to content
This repository was archived by the owner on Apr 3, 2022. It is now read-only.

Commit 0f2e589

Browse files
committed
DERO AstroBWT CPU miner more optimizations 2
1 parent 450d42b commit 0f2e589

4 files changed

Lines changed: 42 additions & 6 deletions

File tree

astrobwt/astrobwt_optimized.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ type Data struct {
2929
var pool = sync.Pool{New: func() interface{} { return &Data{} }}
3030

3131
func POW_optimized_v1(inputdata []byte, max_limit int) (outputhash [32]byte, success bool) {
32+
data := pool.Get().(*Data)
33+
outputhash, success = POW_optimized_v2(inputdata,max_limit,data)
34+
pool.Put(data)
35+
return
36+
}
37+
func POW_optimized_v2(inputdata []byte, max_limit int, data *Data) (outputhash [32]byte, success bool) {
3238

3339
var counter [16]byte
3440

35-
data := pool.Get().(*Data)
41+
3642
for i := range data.stage1 {
3743
data.stage1[i] = 0
3844
}
@@ -66,7 +72,6 @@ func POW_optimized_v1(inputdata []byte, max_limit int) (outputhash [32]byte, suc
6672
}
6773

6874
copy(outputhash[:], key[:])
69-
pool.Put(data)
7075
success = true
7176
return
7277
}

build/Readme.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
1] ### DERO Installation, https://github.com/deroproject/wiki/wiki#dero-installation
2+
3+
DERO is written in golang and very easy to install both from source and binary.
4+
Installation From Source:
5+
Install Golang, minimum Golang 1.10.3 required.
6+
In go workspace: go get -u github.com/deroproject/derosuite/...
7+
Check go workspace bin folder for binaries.
8+
For example on Linux machine following binaries will be created:
9+
derod-linux-amd64 -> DERO daemon.
10+
dero-wallet-cli-linux-amd64 -> DERO cmdline wallet.
11+
explorer-linux-amd64 -> DERO Explorer. Yes, DERO has prebuilt personal explorer also for advance privacy users.
12+
13+
Installation From Binary
14+
Download DERO binaries for ARM, INTEL, MAC platform and Windows, Mac, FreeBSD, OpenBSD, Linux etc. operating systems.
15+
https://github.com/deroproject/derosuite/releases
16+
17+
2] ### Running DERO Daemon
18+
./derod-linux-amd64
19+
20+
3] ### Running DERO Wallet (Use local or remote daemon)
21+
./dero-wallet-cli-linux-amd64 --remote
22+
https://wallet.dero.io [Web wallet]
23+
24+
4] ### DERO Mining Quickstart
25+
Run miner with wallet address and no. of threads based on your CPU.
26+
./dero-miner --mining-threads 4 --daemon-rpc-address=http://explorer.dero.io:20206 --wallet-address dERoXHjNHFBabzBCQbBDSqbkLURQyzmPRCLfeFtzRQA3NgVfU4HDbRpZQUKBzq59QU2QLcoAviYQ59FG4bu8T9pZ1woERqciSL
27+
28+
NOTE: Miners keep your system clock sync with NTP etc.
29+
Eg on linux machine: ntpdate pool.ntp.org
30+
For details visit http://wiki.dero.io

cmd/dero-miner/miner.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var job structures.GetBlockTemplate_Result
4040
var maxdelay int = 10000
4141
var threads int
4242
var iterations int = 100
43-
var max_pow_size int = astrobwt.MAX_LENGTH
43+
var max_pow_size int = 819200 //astrobwt.MAX_LENGTH
4444
var wallet_address string
4545
var daemon_rpc_address string
4646

@@ -365,7 +365,7 @@ func main() {
365365
fallthrough
366366
case strings.ToLower(line) == "quit":
367367
close(Exit_In_Progress)
368-
os.Exit(0)
368+
os.Exit(0)
369369
case line == "":
370370
default:
371371
log.Println("you said:", strconv.Quote(line))
@@ -470,6 +470,7 @@ func mineblock() {
470470

471471
iterations_per_loop := uint32(31.0 * float32(astrobwt.MAX_LENGTH) / float32(max_pow_size))
472472

473+
var data astrobwt.Data
473474
for {
474475
mutex.RLock()
475476
myjob := job
@@ -519,7 +520,7 @@ func mineblock() {
519520
for i := uint32(0); i < iterations_per_loop; i++ {
520521
binary.BigEndian.PutUint32(nonce_buf, i)
521522
//pow := astrobwt.POW_0alloc(work[:])
522-
pow, success := astrobwt.POW_optimized_v1(work[:],max_pow_size)
523+
pow, success := astrobwt.POW_optimized_v2(work[:],max_pow_size,&data)
523524
if !success {
524525
continue
525526
}

config/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ import "github.com/blang/semver"
2020

2121
// right now it has to be manually changed
2222
// do we need to include git commitsha??
23-
var Version = semver.MustParse("2.2.0-4.Atlantis.Astrobwt+05032020")
23+
var Version = semver.MustParse("2.2.0-5.Atlantis.Astrobwt+07032020")

0 commit comments

Comments
 (0)