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

Commit

Permalink
DERO AstroBWT CPU miner more optimizations 2
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainDero committed Mar 7, 2020
1 parent 450d42b commit 0f2e589
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
9 changes: 7 additions & 2 deletions astrobwt/astrobwt_optimized.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ type Data struct {
var pool = sync.Pool{New: func() interface{} { return &Data{} }}

func POW_optimized_v1(inputdata []byte, max_limit int) (outputhash [32]byte, success bool) {
data := pool.Get().(*Data)
outputhash, success = POW_optimized_v2(inputdata,max_limit,data)
pool.Put(data)
return
}
func POW_optimized_v2(inputdata []byte, max_limit int, data *Data) (outputhash [32]byte, success bool) {

var counter [16]byte

data := pool.Get().(*Data)

for i := range data.stage1 {
data.stage1[i] = 0
}
Expand Down Expand Up @@ -66,7 +72,6 @@ func POW_optimized_v1(inputdata []byte, max_limit int) (outputhash [32]byte, suc
}

copy(outputhash[:], key[:])
pool.Put(data)
success = true
return
}
Expand Down
30 changes: 30 additions & 0 deletions build/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
1] ### DERO Installation, https://github.com/deroproject/wiki/wiki#dero-installation

DERO is written in golang and very easy to install both from source and binary.
Installation From Source:
Install Golang, minimum Golang 1.10.3 required.
In go workspace: go get -u github.com/deroproject/derosuite/...
Check go workspace bin folder for binaries.
For example on Linux machine following binaries will be created:
derod-linux-amd64 -> DERO daemon.
dero-wallet-cli-linux-amd64 -> DERO cmdline wallet.
explorer-linux-amd64 -> DERO Explorer. Yes, DERO has prebuilt personal explorer also for advance privacy users.

Installation From Binary
Download DERO binaries for ARM, INTEL, MAC platform and Windows, Mac, FreeBSD, OpenBSD, Linux etc. operating systems.
https://github.com/deroproject/derosuite/releases

2] ### Running DERO Daemon
./derod-linux-amd64

3] ### Running DERO Wallet (Use local or remote daemon)
./dero-wallet-cli-linux-amd64 --remote
https://wallet.dero.io [Web wallet]

4] ### DERO Mining Quickstart
Run miner with wallet address and no. of threads based on your CPU.
./dero-miner --mining-threads 4 --daemon-rpc-address=http://explorer.dero.io:20206 --wallet-address dERoXHjNHFBabzBCQbBDSqbkLURQyzmPRCLfeFtzRQA3NgVfU4HDbRpZQUKBzq59QU2QLcoAviYQ59FG4bu8T9pZ1woERqciSL

NOTE: Miners keep your system clock sync with NTP etc.
Eg on linux machine: ntpdate pool.ntp.org
For details visit http://wiki.dero.io
7 changes: 4 additions & 3 deletions cmd/dero-miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var job structures.GetBlockTemplate_Result
var maxdelay int = 10000
var threads int
var iterations int = 100
var max_pow_size int = astrobwt.MAX_LENGTH
var max_pow_size int = 819200 //astrobwt.MAX_LENGTH
var wallet_address string
var daemon_rpc_address string

Expand Down Expand Up @@ -365,7 +365,7 @@ func main() {
fallthrough
case strings.ToLower(line) == "quit":
close(Exit_In_Progress)
os.Exit(0)
os.Exit(0)
case line == "":
default:
log.Println("you said:", strconv.Quote(line))
Expand Down Expand Up @@ -470,6 +470,7 @@ func mineblock() {

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

var data astrobwt.Data
for {
mutex.RLock()
myjob := job
Expand Down Expand Up @@ -519,7 +520,7 @@ func mineblock() {
for i := uint32(0); i < iterations_per_loop; i++ {
binary.BigEndian.PutUint32(nonce_buf, i)
//pow := astrobwt.POW_0alloc(work[:])
pow, success := astrobwt.POW_optimized_v1(work[:],max_pow_size)
pow, success := astrobwt.POW_optimized_v2(work[:],max_pow_size,&data)
if !success {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion config/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ import "github.com/blang/semver"

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

0 comments on commit 0f2e589

Please sign in to comment.