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

Allow for new AUX POW. #51

Merged
merged 1 commit into from
Apr 17, 2021
Merged

Conversation

rldleblanc
Copy link

getauxblock is being depreciated and replaced by createauxblock and
submitauxblock. This allows for specifying a payment address when asking
for an auxblock instead of getting a wallet address so you don't have to
run a wallet where p2pool has access. Most coins support both methods,
some only support the old method (Terricoin is an example) and some only
support the new method (Myriadcoin is an example). Use --merged for
the old style and --merged_addr for the new style.

getauxblock is being depreciated and replaced by createauxblock and
submitauxblock. This allows for specifying a payment address when asking
for an auxblock instead of getting a wallet address so you don't have to
run a wallet where p2pool has access. Most coins support both methods,
some only support the old method (Terricoin is an example) and some only
support the new method (Myriadcoin is an example). Use `--merged` for
the old style and `--merged_addr` for the new style.
@rldleblanc
Copy link
Author

@jtoomim Since I don't have any hash power at the moment, I couldn't test that the submitting of aux work is working, but I think I should. If you have some testnet with aux, can you double check it?

@jtoomim
Copy link
Owner

jtoomim commented Aug 13, 2020

I've never messed around with the auxpow stuff, unfortunately. Testing this would be harder for me than for you.

Perhaps you could rent some hashpower on nicehash?

@silkroadnomad
Copy link

silkroadnomad commented Sep 27, 2020

@rldleblanc and @jtoomim I've tested p2pool with this pull request on our own altcoin fork on testnet. And I just received blocks on the configured address! Thanks for the good work!

The only thing which seems ugly is the % char between the address and the merged_addr url!. Makes some problems inside systemd for me.

@rldleblanc
Copy link
Author

rldleblanc commented Sep 27, 2020 via email

@jtoomim
Copy link
Owner

jtoomim commented Sep 28, 2020

Thanks for testing it, @inspiraluna. I'm willing to merge this either now or after the % issue has been changed. Do you have a suggestion for what to do instead of the %?

@silkroadnomad
Copy link

Well, I don't know if anything would speak against it;
I'd suggest doing it that way:

Now:
payout%http://ncuser:ncpass@127.0.0.1:port/

Later:
http://ncuser:ncpass@127.0.0.1:port/payout

That would require testing the URL in a different way. I guess it would be not a problem. I am just not a python programmer yet otherwise I could do it by myself quickly. If somebody is faster then me with it, that would be it.

@silkroadnomad
Copy link

@rldleblanc Main blockchain was Bitcoin 0.20. and Aux-Coin was Doichain (DOI)

Doichain is a project which is aiming to record "Double Opt Ins" (DOIs) in order to track unforgeable email permissions on blockchain for preventing spam in email marketing businesses.
Nice project but still long way to go!

@rldleblanc
Copy link
Author

I tried using a delimiter that would not interfere with anything that could be a path (I'm not aware of any coins using a path, but you never know).

I have a shell script that launches p2pool with all the correct parameters and I call that from systemd.

/home/rleblanc/start_p2pool.sh:

#! /bin/sh

export PYTHONPATH=/usr/lib/python2.7/dist-packages/:/usr/local/lib/python2.7/dist-packages/

/usr/bin/pypy /home/rleblanc/p2pool/run_p2pool.py \
        --net litecoin \
        --web-static /home/rleblanc/p2pool-node-status \
        -w :::9327 \
        --address Leoj1iCoJ74Dk2mGDVw9MveW6cbRaYdAJX \
        --merged http://dogecoinrpc:rpc_pass@127.0.0.1:22555/ \
        --merged http://viauser:rpc_pass@127.0.0.1:5222/ \
        --merged http://pesetacoinrpc:rpc_pass@127.0.0.1:16638/ \
        --merged_addr 4skv9S1NYHB7huKUMitebwZWV7pygmsmgW%http://myriadrpc:rpc_pass@127.0.0.1:10889/ \                                                                                                                                    
        --logfile /dev/null

exit 0

/etc/systemd/system/p2pool.service:

[Unit]
Description=Litecoin P2Pool
After=litecoin.service

[Service]
Type=simple
LimutNOFILE=8192
User=rleblanc
WorkingDirectory=/home/rleblanc
Environment="LD_PRELOAD=libjemalloc.so.2"
ExecStart=/home/rleblanc/start_p2pool.sh
Restart=on-abort
#Nice=-10

[Install]
WantedBy=multi-user.target

Probably a lot easier than managing systemd and having to reload on every change.

@silkroadnomad
Copy link

@rldleblanc I ended up doing the same as you. Created another shell script which starts p2pool. But it seemed a bit of pain if you don't calculate with it, since it needs an additional research. What is the problem here with systemd etc? Which solutions are possible? Is it possible to escape the # in the string or not?

Regarding to your worries, that other coins would use a path for constructing the rpc url, I am still thinking about this possibility but generally don't really see it as a scenario since more or less all (well, I don't have the full overview) forked from bitcoin and use this simple rpc url. But if you really think so and other coins would do so, why not embrace this thought and use this:

http://ncuser:ncpass@127.0.0.1:port/?payout_addr=xyz

In such a way such coins (if such coins should exist) could still work and we just append a parameter.

@ikolubr
Copy link

ikolubr commented Feb 6, 2021

I'm getting this error:

Traceback (most recent call last):
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 393, in callback
    self._startRunCallbacks(result)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 501, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 588, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1184, in gotResult
    _inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
  File "/usr/local/lib/pypy2.7/dist-packages/Twisted-15.4.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1128, in _inlineCallbacks
    result = g.send(result)
  File "/opt/p2/p2pool/work.py", line 88, in set_merged_work
    target = auxblock['target'] if 'target' in auxblock else auxblock['_target']
exceptions.KeyError: '_target'

This is the createauxblock output of the bvault daemon:

{
  "hash": "ea8a73072d0dc067e1fb21f1ca6b523b6076173d4469b4e6f86641bd1745b18d",
  "chainid": 1638,
  "previousblockhash": "2022f9a528c1ea7a69e8a835906cd0eaea731a0ec1b73f396aea8464d675a1f5",
  "coinbasevalue": 12500017625,
  "bits": "18066b12",
  "height": 70057
}

So no target or _target

Mining BTC and trying to merge mine BTCV

@jtoomim jtoomim merged commit 0d21dc3 into jtoomim:master Apr 17, 2021
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.

5 participants