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

SafeCash (Testnet) Support Added #12

Merged
merged 8 commits into from
Sep 22, 2018
Merged

SafeCash (Testnet) Support Added #12

merged 8 commits into from
Sep 22, 2018

Conversation

hashtobewild
Copy link
Contributor

This commit adds SafeCash (Testnet) support, has some minor changes to messages to make debugging easier and also updates the "getinfo" API usage to the newer calls.

@GaryChicago
Copy link
Contributor

@hashtobewild Confirming you tested this on safecash and a non-safecash? Just want to be sure. Then I'll approve. If you need someone to test this pr on a different coin let me know. I'll do it or find someone that can quickly.

Copy link
Member

@egyptianbman egyptianbman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing the work to add this!

This will require a wide range of testing:

  • Safecash
  • Zencash
  • Zcash or XSG
  • One of the other coins

Let's wait until the changes I requested are satisfied before testing to ensure we're testing final code.

@@ -39,6 +39,16 @@ var BlockTemplate = module.exports = function BlockTemplate(
if (coin.payFoundersReward === true) {
if (!this.rpcData.founders || this.rpcData.founders.length <= 0) {
console.log('Error, founders reward missing for block template!');
} else if (this.rpcData.infrastructure && this.rpcData.infrastructure > 0){
// SafeCash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the alignment in this block?

Also, I'm uncomfortable with this setting blockReward to an object but the else setting it to an integer. The variable should either be one or the other. If need-be, we can pass another variable for this coin.

Lastly, can you remove all the wrapping ()? They're not necessary; thanks!

lib/pool.js Outdated
@@ -374,7 +374,8 @@ var pool = module.exports = function pool(options, authorizeFn) {
var batchRpcCalls = [
['validateaddress', [options.address]],
['getdifficulty', []],
['getinfo', []],
['getblockchaininfo', []],
['getnetworkinfo', []],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the alignment in this line?

lib/pool.js Outdated
@@ -420,12 +421,12 @@ var pool = module.exports = function pool(options, authorizeFn) {
return util.addressToScript(rpcResults.validateaddress.address);
})();

options.testnet = rpcResults.getinfo.testnet;
options.protocolVersion = rpcResults.getinfo.protocolversion;
options.testnet = (rpcResults.getblockchaininfo.chain === "test");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parenthesis here aren't necessary.

lib/pool.js Outdated
@@ -597,6 +598,14 @@ var pool = module.exports = function pool(options, authorizeFn) {

result.response.securenodes = (subsidy.securenodes || 0);
result.response.supernodes = (subsidy.supernodes || 0);
// SafeCash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the alignment here?

@@ -127,6 +127,40 @@ exports.createGeneration = (blockHeight, blockReward, feeReward, recipients, poo
scriptFoundersCompile(foundersAddrHash),
Math.round(blockReward * (coin.percentTreasuryReward / 100))
)
} else if (coin.payAllFounders === true){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the alignment here? I'm also seeing some lines mixing spaces and tabs. We use 4 spaces for each tab.

@GaryChicago
Copy link
Contributor

Safecash tested and working. Still need to test other coins.

@zhq1
Copy link

zhq1 commented Sep 14, 2018

Hello, can you provide a list of all the lib files that you finally fixed? I am testing a new coin now and I have a problem.

2018-09-14 04:50:39 [Payments] [rco] Could not parse rpc data from daemon instance 0
Request Data: {"method":"validateaddress","params":["6KupB26Th9GJAW9GUW2F8EdgLywJScma5H"],"id":1536900638824}
Reponse Data:
2018-09-14 04:50:39 [Payments] [rco] Could not parse rpc data from daemon instance 0
Request Data: {"method":"validateaddress","params":["6T8Ryua1TvAuRKA7cdPkx4EJ27jHJCTTV3"],"id":1536900638838}
Reponse Data:
2018-09-14 04:50:39 [Website] [rco] Could not parse rpc data from daemon instance 0
Request Data: {"method":"dumpprivkey","params":["6KupB26Th9GJAW9GUW2F8EdgLywJScma5H"],"id":1536900638973}
Reponse Data:
2018-09-14 04:50:39 [Pool] [rco] (Thread 1) Could not parse rpc data from daemon instance 0
Request Data: {"method":"getpeerinfo","params":[],"id":1536900639023}
Reponse Data:
2018-09-14 04:50:40 [Payments] [rco] Could not parse rpc data from daemon instance 0
Request Data: {"method":"getbalance","params":[],"id":1536900638836}

@zhq1
Copy link

zhq1 commented Sep 14, 2018

@hashtobewild

@GaryChicago
Copy link
Contributor

@egyptianbman zen, zero, and genesis all tested and working. Finding blocks on testnet. Will be testing xsg here soon.

@GaryChicago
Copy link
Contributor

@egyptianbman xsg testnet okay. found blocks.

Copy link
Contributor

@GaryChicago GaryChicago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been tested and is working. Approving.

xsg tested. zen tested. zero tested. Genesis tested.

GaryChicago
GaryChicago previously approved these changes Sep 19, 2018
Copy link
Member

@egyptianbman egyptianbman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So sorry for the delay. Everything looks good but one minor potential bug.

lib/pool.js Outdated Show resolved Hide resolved
@egyptianbman egyptianbman merged commit 54e99cd into s-nomp:master Sep 22, 2018
egyptianbman pushed a commit to 1ds/node-stratum-pool that referenced this pull request Sep 25, 2018
This commit adds SafeCash support, has some minor changes to messages to make debugging easier and also updates the "getinfo" API usage to the newer calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants