Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pool question #36

Closed
1 task done
chuanwc opened this issue Nov 13, 2017 · 23 comments
Closed
1 task done

pool question #36

chuanwc opened this issue Nov 13, 2017 · 23 comments

Comments

@chuanwc
Copy link

chuanwc commented Nov 13, 2017

Please fill in all relevant items:

  • I have tried with the latest version and I still can reproduce the issue.
Vcash version/branch+revision:
Operating system and version:
Expected behavior:
Actual behavior:
Steps to reproduce the behavior:
Relevant log file output:
@chuanwc
Copy link
Author

chuanwc commented Nov 13, 2017

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 sum01 added the question label Nov 13, 2017
@sum01
Copy link
Contributor

sum01 commented Nov 13, 2017

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

@chuanwc
Copy link
Author

chuanwc commented Nov 14, 2017

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
Copy link
Contributor

sum01 commented Nov 14, 2017

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

https://stackoverflow.com/a/23151062

@chuanwc
Copy link
Author

chuanwc commented Nov 14, 2017

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
Copy link
Contributor

sum01 commented Nov 14, 2017

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
Copy link
Author

chuanwc commented Nov 14, 2017

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

@chuanwc
Copy link
Author

chuanwc commented Nov 14, 2017

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

@chuanwc
Copy link
Author

chuanwc commented Nov 14, 2017

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

@sum01
Copy link
Contributor

sum01 commented Nov 14, 2017

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
Copy link
Author

chuanwc commented Nov 14, 2017

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

@sum01
Copy link
Contributor

sum01 commented Nov 14, 2017

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
Copy link
Author

chuanwc commented Nov 14, 2017

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

@sum01
Copy link
Contributor

sum01 commented Nov 14, 2017

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
Copy link
Author

chuanwc commented Nov 14, 2017

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

@sum01
Copy link
Contributor

sum01 commented Nov 14, 2017

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
Copy link
Author

chuanwc commented Nov 14, 2017

thanks anyway. : )

@chuanwc
Copy link
Author

chuanwc commented Nov 14, 2017

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
Copy link
Contributor

sum01 commented Nov 14, 2017

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
Copy link
Author

chuanwc commented Nov 15, 2017

thx for your help

@chuanwc
Copy link
Author

chuanwc commented Nov 15, 2017

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
Copy link
Contributor

sum01 commented Nov 15, 2017

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 sum01 added the pool label Jan 21, 2018
sum01 added a commit to sum01/node-stratum-pool that referenced this issue Jan 31, 2018
Vcash uses uncompressed keys that are longer than 66, so until I find a way to compress manually this fixes the pool...
sum01 added a commit to sum01/node-stratum-pool that referenced this issue Jan 31, 2018
Vcash uses uncompressed keys that are longer than 66, so until I find a way to compress manually this fixes the pool...
sum01 added a commit to sum01/node-stratum-pool that referenced this issue Jan 31, 2018
Vcash uses uncompressed keys that are longer than 66, so until I find a way to compress manually this fixes the pool...
@sum01
Copy link
Contributor

sum01 commented Feb 4, 2018

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

Closing.

@sum01 sum01 closed this as completed Feb 4, 2018
sum01 added a commit to sum01/node-stratum-pool that referenced this issue Feb 7, 2018
Because the rpc call 'getdifficulty' contains the word 'proof-of-stake', it defaults to PoS, which breaks NOMP.
This forces PoW if the coin name is 'vcash'.

Revert "Force POW"
This reverts commit 2bb5a89.

This workaround isn't needed since we "correctly" force PoW on Vcash.

Revert "Workaround for openvcash/vcash#36 (comment)"
This reverts commit f88686b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants