miniZ-miner / miniZ

37 stars 1 forks source link

--write-config/--read-config is broken #30

Open PSLLSP opened 1 year ago

PSLLSP commented 1 year ago
$ ./miniZ --version
miniZ v2.2c @ Sep 19 2023 23:25:44

I have found in FAQ that config file could be created with --write-config. It doesn't work well...

I tried mine BTG at 2miners. miniZ in this case creates config file but it crashes when started with ./miniZ --read-config

$ cat btg-2m-test.sh                                                                                                                                    
#!/bin/sh

WORKER="MINIZ"
WALLET="GdkQGJmbdvx2UBRhomUAXwdUbKJySXzubo"

POOL="btg.2miners.com:4040"
USER="$WALLET.$WORKER"
PASS="x"

./miniZ --url="$WALLET.$WORKER@$POOL" --log --extra "$@"

Write config file, it works:

$ sh btg-2m-test.sh --write-config
************ miniZ v2.2c ************
Number of miniZ CUDA>=[.] using driver CUDA[11.20] devices found: 1
Driver:         460.91
Algo:           EQ[144,5] [smart-pers]
Pool#0:         user[GdkQGJmbdvx2UBRhomUAXwdUbKJySXzubo.MINIZ]
                server[btg.2miners.com] port[4040] ssl[no] pers[BgoldPoW]
Telemetry:      [http://localhost/:20000]
Logging::       file[miniZ.log] period[10] delay[0]
Temp. limit:    [90°C]
[INFO   ] QUIT miniZ

$ ls -l miniZ.conf
-rw-r--r-- 1 root root 1788 Oct 18 02:00 miniZ.conf

Try to run miniZ with config, it crashes:

$ ./miniZ --read-config
************ miniZ v2.2c ************
Number of miniZ CUDA>=[.] using driver CUDA[11.20] devices found: 1
Segmentation fault (core dumped)

When I run miniZ with parameters directly (or sh btg-2m-test.sh), it works:

$ ./miniZ --url=GdkQGJmbdvx2UBRhomUAXwdUbKJySXzubo.MINIZ@btg.2miners.com:4040 --log --extra                                                             
************ miniZ v2.2c ************
Number of miniZ CUDA>=[.] using driver CUDA[11.20] devices found: 1                                                                                                                            
Driver:         460.91
Algo:           EQ[144,5] [smart-pers]
Pool#0:         user[GdkQGJmbdvx2UBRhomUAXwdUbKJySXzubo.MINIZ]
                server[btg.2miners.com] port[4040] ssl[no] pers[BgoldPoW]
Telemetry:      [http://localhost/:20000]
Logging::       file[miniZ.log] period[10] delay[0]
Temp. limit:    [90°C]
[INFO   ] Mining fee set to 2.00%
miniZ<144,5>[10:0:00.0: 3399]: Selecting GPU#0[0] Zotac GeForce GTX 1070
[ 0d 0h 0m08s] S:  0/0/0 0>GTX 1070 ` 100% [72°C/50%] 12.14 I/s 24.21(24.21)Sol/s 101(100.8)W clk=1506MHz mclk=3802MHz Sol/W=0.240 [btg.2miners.com]
[ 0d 0h 0m10s] S:  0/0/0 0>GTX 1070 ` 100% [72°C/50%] 12.13 I/s 24.21(24.21)Sol/s 101(100.8)W clk=1506MHz mclk=3802MHz Sol/W=0.240 [btg.2miners.com]
...

When miniZ is started with combination of --ocX --write-config, config file is not created and miniZ starts to mine...

Demo for UNMINEABLE pool:

$ cat btg-um-test.sh
#!/bin/sh

WORKER="MINIZ"
WALLET="BTC:1CZwzXAuMTXb2MXDTEz4KgFcauo6oVqvuv"
REF="gudm-88g0"

POOL="zhash.unmineable.com:3333"
USER="$WALLET.$WORKER#$REF"
PASS="x"

./miniZ --par 144,5 --pers BgoldPoW --url="$WALLET.$WORKER#$REF@$POOL" --log --extra "$@"

No config is written, miniZ starts to mine:

$ sh btg-um-test.sh --ocX --write-config

Config is created in this case:

$ sh btg-um-test.sh --write-config
************ miniZ v2.2c ************
Number of miniZ CUDA>=[.] using driver CUDA[11.20] devices found: 1                                                                                                                            
Driver:         460.91
Algo:           EQ[144,5] [smart-pers]
Pool#0:         user[BTC:1CZwzXAuMTXb2MXDTEz4KgFcauo6oVqvuv.MINIZ#gudm-88g0]
                server[zhash.unmineable.com] port[3333] ssl[no] pers[BgoldPoW]
Telemetry:      [http://localhost/:20000]
Logging::       file[miniZ.log] period[10] delay[0]
Temp. limit:    [90°C]
[INFO   ] QUIT miniZ

miniZ.conf is valid JSON file but miniZ cannot read config, it crashes:

$ ls -l miniZ.conf                                                                                                                                      
-rw-r--r-- 1 root root 1807 Oct 18 02:27 miniZ.conf

$ jq -c '.Algorithm' ./miniZ.conf                                                                                                                       
[{"algo":"144,5","smart-pers":1}]

$ ./miniZ --read-config miniZ.conf
************ miniZ v2.2c ************
Number of miniZ CUDA>=[.] using driver CUDA[11.20] devices found: 1
Segmentation fault (core dumped)

BTW, username for mining at UNMINEABLE is more complex, it has format COIN:WALLET.WORKER#REFERENCE, for example BTC:1CZwzXAuMTXb2MXDTEz4KgFcauo6oVqvuv.miniz#gudm-88g0

miniZ-miner commented 3 months ago

Hi PSLLSP, Thank you for the feedback! We had a look at this, and there was indeed an issue related to reading the config file. Have you tried the new version v2.4d? Could you try again and let us know if it is running OK for you ? Cheers