openvcash / vcash

A decentralized currency for the internet.
https://vcash.info
GNU Affero General Public License v3.0
36 stars 35 forks source link

pool question #36

Closed chuanwc closed 6 years ago

chuanwc commented 6 years ago

Please fill in all relevant items:

Vcash version/branch+revision:
Operating system and version:
Expected behavior:
Actual behavior:
Steps to reproduce the behavior:
Relevant log file output:
chuanwc commented 6 years ago

i want to run a pool for vcash.but after i used the xCoreDev/node-open-mining-portal#upgrade it cant work. when i try to start the pool.just get

/node-open-mining-portal-upgrade/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require('hoek');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/src/node-open-mining-portal-upgrade/node_modules/request/node_modules/hawk/lib/index.js:5:33)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

any ideas?

sum01 commented 6 years ago

What version of Nodejs are you using? That error seems to be related to older versions based on my quick search.

chuanwc commented 6 years ago

thx for your reply.i use the 0.10.44 version of node.js by "nvm use 0.10.44" i also test a unomp&officical nomp on the same vps and it runs well.my guess there is somethings wrong with the xCoreDev's vcash nomp code.

sum01 commented 6 years ago

Use the --harmony flag when launching node, for example node --harmony main.js

https://stackoverflow.com/a/23151062

chuanwc commented 6 years ago

I use " node --harmony init.js" to start the pool.Here is the result:

/home/src/node-open-mining-portal-upgrade/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js:371
exports.unique = (array, key) => {
                               ^
SyntaxError: Unexpected token >
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/src/node-open-mining-portal-upgrade/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
sum01 commented 6 years ago

~Looks like the source of the issue is a node dependency.~

~My guess is that since there's not a package-lock type file, an incompatible change has into the modules from the ranges being used. Probably some dependency that introduced a breaking change in a non-major version.~

~I can try to figure it out, but a quick & simple fix would be to edit the package.json to just use the versions provided, without the ^ that makes it accept a range of versions. Note that doing that may (probably) introduce security vulnerabilities into your pool, since you'd be using out-of-date stuff.~ Ignore me, forgot your issue is when running node 🦆

chuanwc commented 6 years ago

Ok i will give a try.thx a lot.hope that will be helpful.

chuanwc commented 6 years ago

If you have any progress pls let me know.best wishes. : )

chuanwc commented 6 years ago

eeeeeeeee~~~~which version of node are you useing?could you showme the command you install the node ?thx a lot.LOL

sum01 commented 6 years ago

So I quickly skimmed the setup (so I'm sure I'm missing something) and when I run node init.js I get [Payments] [vcash] Daemon does not own pool address - payment processing can not be done with this daemon, {"isvalid":false} which is an error another user ran into a little while ago. I'd have to look up what he did to fix it though..

chuanwc commented 6 years ago

I know that error.just to nano the nomp/pools_config/vcash.json-- "address": "Pool_XVC_Address" to his own wallet's address.

sum01 commented 6 years ago

Still not getting the error you're getting, just running into different errors lol [Payments] [vcash] Error detecting number of satoshis in a coin, cannot do payment processing. Tried parsing: {"jsonrpc":"2.0","result":0,"id":"1510628692284"}

If you're curious, I'm on node -v v8.8.1

chuanwc commented 6 years ago

ok.i think the payment error canbe fix with the mpos.

sum01 commented 6 years ago

I looked at where it's failing, and it's just running getbalance via RPC, but this specific wallet is empty so it fails to parse meaningful output. I do have coins, but I'm running a test wallet at the moment & it's kind of annoying to switch.

chuanwc commented 6 years ago

so.with out modify this branch of nomp sill can not be used…………lol

sum01 commented 6 years ago

Well I assume it wouldn't fail trying to get the number of satoshis if I actually had coins in this wallet, but I don't really feel like trying that at the moment.

chuanwc commented 6 years ago

thanks anyway. : )

chuanwc commented 6 years ago

I use node version 8.8.1 and meet the new question: after i use node init.js to start the pool it returns:

2017-11-14 22:13:21 [Master]    [PoolSpawner] Fork 1 died, spawning replacement worker...
2017-11-14 22:13:24 [Switching] [Setup] (Thread 1) Loading last proxy state from redis
2017-11-14 22:13:25 [Pool]      [vcash] (Thread 1) Share processing setup with redis (127.0.0.1:6379)
2017-11-14 22:13:25 [Switching] [Setup] (Thread 2) Loading last proxy state from redis
2017-11-14 22:13:25 [Pool]      [vcash] (Thread 2) Share processing setup with redis (127.0.0.1:6379)
Invalid pubkey: 04c2236b78c3bc3be104e1065ae4f795593c00fa21bfd091a48254ccf519f8668b31378e0034aa55cfd4db23d174fbfbee9280986c70d68fef95fcb60aeda328e2
/home/src……/srcmp1de_modules/stratum-poolb/util.js:223

it seems the problem with the wallet's address&i try to use my raspberry pi 2 to run it.the result are same.

sum01 commented 6 years ago

That's the same issue the guy ran into before as well. It's from this code

/*
 For POS coins - used to format wallet address for use in generation transaction's output
 */
exports.pubkeyToScript = function(key){
    if (key.length !== 66) {
        console.error('Invalid pubkey: ' + key);
        throw new Error();
    }
    var pubkey = Buffer.alloc(35);
    pubkey[0] = 0x21;
    pubkey[34] = 0xac;
    Buffer.from(key, 'hex').copy(pubkey, 1);
    return pubkey;
};

it fails on the key.length !== 66 because Vcash uses longer keys, but they can be compressed. The problem is I'm not sure how to force compression to make it compatible. I know that when compressed it should work though.

There's probably a way to get the address to compress, but if not, a patch could be made to allow for the larger key I guess..


By the way, when posting logs/code, surround them in back-ticks, like this. `` logs/code here \``` or for one-liners, do \code here`

Just helps with readability.

chuanwc commented 6 years ago

thx for your help

chuanwc commented 6 years ago

default I delet “if (key.length !== 66) { console.error('Invalid pubkey: ' + key); throw new Error(); }” from the util.js-----------seems it can be worked&accept the shares.

sum01 commented 6 years ago

Interesting, but I probably wouldn't outright delete it. Might cause issues elsewhere.

I haven't gotten to look into it yet, but my guess is it used the PoW validation that's right below that chunk of code you deleted, and that must've worked.

sum01 commented 6 years ago

Anyone interested in running a pool should read both this issue and this wiki guide on runnning a pool.

Closing.