blinkhash / foundation-v2-zcash

A scalable stratum pool for ZCash that interfaces with other modules in the Foundation project
GNU General Public License v3.0
1 stars 2 forks source link

Testing Zcash configs on ARRR #1

Open 49handyman opened 2 years ago

49handyman commented 2 years ago

So far I cant get z15 miners to connect. I have the modified config and zcash.js files setup I think properly.

Has it been tested on Pirate-Chain at all?

Do you have any more detailed logging than "debug", not sure if im connecting to node wallet.

Let me know if you have any ideas for me to try or fix.

btw, stratum-ping seems to work fine.

//Coin Configuration
config.primary.coin = {};
config.primary.coin.name = 'Pirate';
config.primary.coin.symbol = 'ARRR';
config.primary.coin.algorithm = 'equihash';

Miners just keep trying to connect withour success.

[nodemon] restarting due to changes...
[nodemon] starting `node ./index.js`
[11/24/2022, 9:48:04 PM] [LOG] (Schema) foundation:database - Validated the zcash schema, initializing stratum ...
[11/24/2022, 9:48:04 PM] [LOG] (Website) foundation:server - Validated the API configuration, initializing server on 192.168.2.242:3040 ...
------------------------------------------------------------------------------------------------------------------------------------------------------------------
[11/24/2022, 9:48:05 PM] [DEBUG] (zcash) foundation:pool - (1) Successfully validated primary daemons ...
[11/24/2022, 9:48:05 PM] [DEBUG] (zcash) foundation:pool - (2) Finished setting up stratum ports: 3040 ...
[11/24/2022, 9:48:05 PM] [DEBUG] (zcash) foundation:pool - (3) Successfully generated settings configuration  ...
[11/24/2022, 9:48:05 PM] [DEBUG] (zcash) foundation:pool - (4) Finished setting up specified recipients for block rewards ...
[11/24/2022, 9:48:05 PM] [DEBUG] (zcash) foundation:pool - (5) Finished setting up stratum job manager ...
[11/24/2022, 9:48:05 PM] [DEBUG] (zcash) foundation:pool - (6) Finished setting up connection to primary blockchain ...
[11/24/2022, 9:48:05 PM] [DEBUG] (zcash) foundation:pool - (6b) Finished setting up connection to auxiliary blockchain ...
[11/24/2022, 9:48:05 PM] [DEBUG] (Workers) foundation:builder - Started 1 pool(s) on 4 thread(s)

Tcpdump

E..<..@.@................S........r..?.........
..5.........
21:58:29.859312 IP 192.168.2.236.39954 > 192.168.2.242.3040: Flags [S], seq 413913061, win 29200, options [mss 1460,sackOK,TS val 538508 ecr 0,nop,wscale 5], length 0
E..<.i@.@..#......................r............
..7.........
49handyman commented 2 years ago

Moved over to another machine and reinstalled everything and used same configs.

at least its trying to connect. I need some debug info though to get it figured out.

I use a heavily modified version of knomp, its poolworker.js uses the following (should be original code):

        var authorizeFN = function(ip, port, workerName, password, callback) {
            handlers.auth(port, workerName, password, function(authorized) {
                var authString = authorized ? 'Authorized' : 'Unauthorized ';
                logger.debug('AUTH>TRUE> authstr '+ authString +' ip '+   functions.anonymizeIP(ip));
                callback({
                    error: null,
                    authorized: authorized,
                    disconnect: false
                });
            });
        };

and in node stratum.js

    function handleAuthorize(message) {

        _this.workerName = getSafeWorkerString(message.params[0]);
        _this.workerPass = getSafeString(message.params[1]);

        var addr = _this.workerName.split(".")[0];

        options.authorizeFn(_this.remoteAddress, options.socket.localPort, addr, _this.workerPass, function(result) {
            _this.authorized = (!result.error && result.authorized);

            sendJson({
                id     : message.id,
                result : _this.authorized,
                error  : result.error
            });

            // If the authorizer wants us to close the socket lets do it.
            if (result.disconnect === true) {
                options.socket.destroy();
            }
        });
    }

On yours i see this:

  // Establish New Stratum Client
    socket.setKeepAlive(true);
    const subscriptionId = uuid.v4();
    const client = new Client(_this.config, socket, subscriptionId, authorizeFn);
    _this.clients[subscriptionId] = client;
    _this.emit('client.connected', client);

and in client.js

here is the dump with bad request

23:48:47.817722 IP 192.168.2.231.3040 > 76.92.241.147.50896: Flags [F.], seq 48, ack 101, win 64, options [nop,nop,TS val 235530851 ecr 34182393], length 0
E..4..@.@..q....L\.........;..[....@.......
.       .c.     ..
23:48:47.820687 IP 76.92.241.147.42482 > 192.168.2.231.3040: Flags [.], ack 1, win 913, options [nop,nop,TS val 34182399 ecr 235530805], length 0
E..4x.@.1..5L\..............F
......U......
.       ...     .5
23:48:47.820687 IP 76.92.241.147.42482 > 192.168.2.231.3040: Flags [P.], seq 1:102, ack 1, win 913, options [nop,nop,TS val 34182399 ecr 235530805], length 101
E...x.@.1...L\..............F
.............
.       ...     .5{"id":1255, "method":"mining.subscribe", "params":["cgminer/4.9.0", null, "136.37.103.232", "3040"]}

23:48:47.820769 IP 192.168.2.231.3040 > 76.92.241.147.42482: Flags [.], ack 102, win 64, options [nop,nop,TS val 235530854 ecr 34182399], length 0
E..4..@.@.+r....L\......F
.....]...@.......
.       .f.     ..
23:48:47.821861 IP 192.168.2.231.3040 > 76.92.241.147.42482: Flags [P.], seq 1:48, ack 102, win 64, options [nop,nop,TS val 235530856 ecr 34182399], length 47
E..c..@.@.+B....L\......F
.....]...@.......
.       .h.     ..HTTP/1.1 400 Bad Request
Connection: close