README.md with build process for linux/osx, go.mod (#11)

* README.md with build process for linux/osx added, go.mod added

* initialization error logging
This commit is contained in:
ofen 2022-05-08 18:14:01 +03:00 committed by GitHub
parent eddc34c7b7
commit 7840f8cbf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 2 deletions

29
README.md Normal file
View File

@ -0,0 +1,29 @@
## Build
Make sure you hava `go`, `cmake` and `make` installed.
Linux
```sh
git clone https://github.com/cryptonote-social/RandomX.git && \
git clone https://github.com/cryptonote-social/csminer.git && \
mkdir -p RandomX/build && cd RandomX/build/ && \
cmake .. && make && \
cd ../rxlib && ./make.sh && \
cd ../../csminer/ && \
go build linux/csminer.go && ./csminer
```
OSX
```sh
git clone https://github.com/cryptonote-social/RandomX.git && \
git clone https://github.com/cryptonote-social/csminer.git && \
mkdir -p RandomX/build && cd RandomX/build/ && \
cmake .. && make && \
cd ../rxlib && ./make.sh && \
cd ../../csminer/ && \
go build osx/csminer.go && ./csminer
```
Windows
```ps
...
```

9
go.mod Normal file
View File

@ -0,0 +1,9 @@
module github.com/cryptonote-social/csminer
go 1.17
require (
github.com/brunoqc/go-windows-session-notifications v0.0.0-20170424175830-fec440a22328
github.com/godbus/dbus/v5 v5.1.0
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150
)

6
go.sum Normal file
View File

@ -0,0 +1,6 @@
github.com/brunoqc/go-windows-session-notifications v0.0.0-20170424175830-fec440a22328 h1:Nf03efSjxTO1zrg8P2WR3UVXfSNzHXl5F1h7Im4nqtI=
github.com/brunoqc/go-windows-session-notifications v0.0.0-20170424175830-fec440a22328/go.mod h1:WGETPIXmRb9fIUDuJdMnbNfT41loNcP20LZ65ymtk5Q=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

View File

@ -8,7 +8,7 @@ import (
"fmt"
"github.com/cryptonote-social/csminer"
"github.com/cryptonote-social/csminer/crylog"
"github.com/godbus/dbus"
"github.com/godbus/dbus/v5"
)
func main() {

View File

@ -57,8 +57,10 @@ func Mine(c *MinerConfig) error {
ExcludeHourStart: c.ExcludeHrStart,
ExcludeHourEnd: c.ExcludeHrEnd,
})
if imResp.Code < 0 {
return fmt.Errorf("Fatal InitMiner failure: %d", imResp.Code)
crylog.Error("Initialization error:", imResp.Message)
return errors.New("InitMiner failed: " + imResp.Message)
}
if imResp.Code > 2 {
crylog.Error("Bad configuration:", imResp.Message)