I've tried to connect to both:
- wss://live.prohashing.com:443/ws
- wss://prohashing.com:444/ws
Best,
Maznoz
Ok, that sounds good. I am not for sure either because it should be working if the code is the same.Steve Sokolowski wrote:The port 444 one is definitely incorrect and will be removed from the documentation in the next release.
I don't understand what is going on here with the other one. The website has no problems connecting to the server, and that code comes directly from the website. I'm going to ask Chris to look into this and see if he can provide any more information.
Code: Select all
#!/usr/bin/env python3
import ssl
from autobahn.asyncio.wamp import ApplicationSession
from autobahn.asyncio.wamp import ApplicationRunner
from autobahn.wamp import auth
try:
import asyncio
except ImportError:
# Trollius >= 0.3 was renamed
import trollius as asyncio
user = "web"
secret = "wampUser"
class ProhashingComponent(ApplicationSession):
def onConnect(self):
self.join(self.config.realm, [u"wampcra"], user)
def onChallenge(self, challenge):
if challenge.method == u"wampcra":
print("WAMP-CRA challenge received: {}".format(challenge))
if u'salt' in challenge.extra:
# salted secret
key = auth.derive_key(secret,
challenge.extra['salt'],
challenge.extra['iterations'],
challenge.extra['keylen'])
else:
# plain, unsalted secret
key = secret
# compute signature for challenge, using the key
signature = auth.compute_wcs(key, challenge.extra['challenge'])
# return the signature to the router for verification
return signature
else:
raise Exception("Invalid authmethod {}".format(challenge.method))
@asyncio.coroutine
def onJoin(self, details):
def onProfitabilityUpdates(*args):
print("Profitability Updates event received:", args)
try:
yield from self.subscribe(onProfitabilityUpdates, 'profitability_updates')
except Exception as e:
print("Could not subscribe to topic:", e)
def main():
context = ssl.create_default_context()
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
runner = ApplicationRunner(u"wss://live.prohashing.com:443/ws", u"mining", ssl=context)
#runner = ApplicationRunner(u"wss://prohashing.com:444/ws", u"mining", ssl=context)
runner.run(ProhashingComponent)
if __name__ == "__main__":
main()
Maznoz wrote:Hi Chris,
I indeed got a certificate error, but disabled certificate verification while testing. So this issue does not seem to be caused by certificate issues.
My python code, which works for the poloniex wamp api (no authentication needed there), is as follows:
The wampcra imlementation comes straight from the autobahn examples.Code: Select all
#!/usr/bin/env python3 import ssl from autobahn.asyncio.wamp import ApplicationSession from autobahn.asyncio.wamp import ApplicationRunner from autobahn.wamp import auth try: import asyncio except ImportError: # Trollius >= 0.3 was renamed import trollius as asyncio user = "web" secret = "wampUser" class ProhashingComponent(ApplicationSession): def onConnect(self): self.join(self.config.realm, [u"wampcra"], user) def onChallenge(self, challenge): if challenge.method == u"wampcra": print("WAMP-CRA challenge received: {}".format(challenge)) if u'salt' in challenge.extra: # salted secret key = auth.derive_key(secret, challenge.extra['salt'], challenge.extra['iterations'], challenge.extra['keylen']) else: # plain, unsalted secret key = secret # compute signature for challenge, using the key signature = auth.compute_wcs(key, challenge.extra['challenge']) # return the signature to the router for verification return signature else: raise Exception("Invalid authmethod {}".format(challenge.method)) @asyncio.coroutine def onJoin(self, details): def onProfitabilityUpdates(*args): print("Profitability Updates event received:", args) try: yield from self.subscribe(onProfitabilityUpdates, 'profitability_updates') except Exception as e: print("Could not subscribe to topic:", e) def main(): context = ssl.create_default_context() context.check_hostname = False context.verify_mode = ssl.CERT_NONE runner = ApplicationRunner(u"wss://live.prohashing.com:443/ws", u"mining", ssl=context) #runner = ApplicationRunner(u"wss://prohashing.com:444/ws", u"mining", ssl=context) runner.run(ProhashingComponent) if __name__ == "__main__": main()
Hope this helps.
Best,
Maznoz
Hi Steve,Steve Sokolowski wrote:Good morning!
We're proud to finally document our WAMP API, which allows users to obtain live statistics about the status of the pool. In the coming days, we also plan to provide methods that provide insight into users' workers and balances.
The first methods are now available at https://prohashing.com/help.html#api-wamp.
For the first time, these methods make it possible for a user to write a "NiceHash bot." Since NiceHash provides an API with all the necessary properties and methods, a bot can be written to obtain pricing at NiceHash, compare it to profits provided by the WAMP API here, and if profit here is greater, then buy lots of hashrate from NiceHash and direct it here.
If programmed conservatively, this bot should never be at risk of losing money. During times of high profitability, profits here often soar to 33% above NiceHash. That should never happen, because a bot like this can drive a significant portion of NiceHash's hashrate here during those times up to the point that NiceHash's rate equalizes.
Is anyone interested in writing this bot? We aren't asking for any cut of the profits that you earn; we just want someone to write it and run it to make themselves money so that we can take the pool fees. GenTarkin seems to have the expertise to make a lot of profit by doing this.