NOMP mining pool fork for ZCash Stratum Protocol and ZCash block template

I’ve started working on adapting NOMP (node-open-mining-portal), node-stratum-pool and node-multi-hashing to support ZCash.

Working on adapting the miner/pool messages, 32 byte nonce, block header and block template format changes, address length change, etc.

Welcome to submit pull requests. Not sure how long it will take me to get it modified and working.

3 Likes

I started working on this as well if you are interested in continuing. I tried putting your updates into unomp which appears to run on much of the same code base. Editing their merged-pooler which is the same as zcash-stratum pooler results in a type error on L22 of jobmanager.js

Buffer.write(util.packUInt32BE(Math.abs(counter++)));

This happens after the pool server is already connected to the zcash daemon and I try to connect a miner to the local server.

Investigating and will open a pr/issue with my findings but I have never looked at NOMP before and still figuring out how it works.

EDIT: It looks like Buffer class with compare/write/…etc is only implemented in node v12 or higher and nomp needs node v10 to compile the C crypto bindings. Looking at work arounds…

This seems to work, just using the native uint 32 Big Endian buffer write that unomp was already using in its util module. A pr has been submitted as well.

-       var extraNonce = Buffer(32);
-       Buffer.write(util.packUInt32BE(Math.abs(counter++)));
-       return extraNonce.toString('hex');

+       var buff = new Buffer(32);
+       buff.writeUInt32BE(Math.abs(counter++), 0);
+       return buff.toString('hex')

I could use some help setting up a zcash.json and respective blake2b implementation in multi-hashing I suspect is needed as well. I am again still learning nomp :slight_smile:

Cheers!

2 Likes

Here are my edits to UNOMP including edits to stratum-pool

The pool accepts shares currently but im not 100% convinced that this is accurate. Currently it says that the shares are low difficulty from SA. I will continue studying the pool set up of NOMP and check for correctness over the next few days. Any help there would be greatly appreciated.

2 Likes

Hi @voxelot I´ve been reading your commits and are pretty well. I am also working on understand the NOMP functionality, if I make any improve i will make a pull request. Anyway great job dude.
Regards

1 Like

Awesome! I should have time this weekend to put some time into getting this working. I also found unomp and it seems it is a bit newer/has some fixes for issues in nomp.

1 Like

Share submit causes pool worker fork to die

[2016-11-27 18:29:04.362] [DEBUG] [default] - Payments zcash Finished
interval - time spent: 60335ms total, 2ms redis, 331ms daemon RPC
/root/unomp/node_modules/stratum-pool/node_modules/bignum/index.js:312

if (buf.length % size !== 0) {

^

TypeError: Cannot read property ‘length’ of undefined

at Function.BigNum.fromBuffer (/root/unomp/node_modules/stratum-pool/node_modules/bignum/index.js:312:10)

at JobManager.processShare (/root/unomp/node_modules/stratum-pool/lib/jobManager.js:233:35)

at null. (/root/unomp/node_modules/stratum-pool/lib/pool.js:497:46)

at EventEmitter.emit (events.js:98:17)

at handleSubmit (/root/unomp/node_modules/stratum-pool/lib/stratum.js:167:15)

at handleMessage (/root/unomp/node_modules/stratum-pool/lib/stratum.js:72:17)

at /root/unomp/node_modules/stratum-pool/lib/stratum.js:240:25

at Array.forEach (native)

at Socket. (/root/unomp/node_modules/stratum-pool/lib/stratum.js:226:26)

at Socket.EventEmitter.emit (events.js:95:17)

[2016-11-27 18:29:19.199] [ERROR] [default] - Master PoolSpawner Fork 1 died, spawning replacement worker…

any news ?
I’m more than interested in my own pool

I’m using it for solo. Works great!

Edit: Actually, I’m using this repo from joshuayabut:

I’m using hellcatz fork now. Some of the statistics seem to be working better. https://github.com/hellcatz/z-nomp

Are the stats the only difference? When someone does a repo fork, it would be nice if they’d explain what’s unique about their fork. The CHANGELOG.md is no different than the original Z-NOMP repo.

I think they rolled it back into the main branch. Not sure - I am going to set up a second server so I have two url’s to point my miners at. The main datacenter I use had a power outage so I need a backup one.

1 Like

still mining solo on zclassic? Finding any blocks? I’m having a tough few days…even at 22k. Finding one a day.

Yep, still going. Today is day 40, and thus far my average blocks per day is 21.5 with 54K. My lowest day was 8 blocks, and my highest day was 34. Variance is something you just have to surrender to. After all, the whole blockchain is simply following the natural laws of the universe, that is: mathematics.

Well, I agree with that. Except I had 3 days in a row of zero. That was at about 16K. I am up to 24K now, and I rebuilt the z-nomp with the latest version tonight. I should be at 30k by next week.

Definitely hoping to see some improvement on the performance.

well, I just opened my zclassic wallet, instead of relying on the web stats.

looks like I was averaging 5 blocks, with the lowest day 3 blocks. That’s actually consistent with what you are getting. OK! I’ll keep going on it then.

Well, you’re running your own node, so you can always see the blockchain. Just:

tail -f .zclassic/debug.log | grep “AddToWallet”

You’ll see the node log entry as soon as you mine a block. I turned the webui component of Z-NOMP off. There’s really nothing that you can’t find out via the node, Z-NOMP, and miner logs; “tail -f xxx | grep pattern” is your friend :slight_smile:

Edit: You can also use "zcash-cli listtransactions “*” " to list all the transactions for your default address. To list just the last “n” transactions, just put “n” as the final parameter.

Thanks! I’ll just login and do a cat | grep “AddToWallet” every once in a while then. I did not know about the AddToWallet (don’t see it very often :slight_smile:

Edit: Although on my ubuntu PC I am lazy and use the GUI wallet. I just need to look at it more often.

Do you have the “tac” command installed? It’s the same as “cat”, but starts at the end of the file. The node log will get big over time, so “cat” will become quite expensive to use for searching. If you use:

tac logfile | grep -m X /pattern/

you’ll search from the latest log entry, backward, and quit after matching the pattern X times. Much lighter weight than cat’ing from the start of the file every blessed time you want to check for a new block found.

that’s cool! Been using linux off and on for over a decade and did not know about tac. Always something new to learn - thanks!

Here’s my monitoring stuff:

2 Likes