Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Authorizing clients with custom user and password #22

Closed
Hippeys opened this issue May 15, 2013 · 6 comments
Closed

Authorizing clients with custom user and password #22

Hippeys opened this issue May 15, 2013 · 6 comments

Comments

@Hippeys
Copy link

Hippeys commented May 15, 2013

Hello!

I use your proxy to connect 7 pc's in one miner, how can i set up your proxy to authorize all connected pc's and submit shares with only one user name and password?

I know -cu and -cp but this credentials used only for submitting shares but how can i use it to authorize clients with this user too no matter with which user client miners are started? (Clients connects with statum cgminer)

Thanks!

@alphaonex86
Copy link

+1

@markudevelop
Copy link

Yeah I need the same thing, I want to be able to control changing of the pool in the stratum-proxy only much easier... editing 10 rigs is time consuming

@MineForeman
Copy link

Some additional debug output on this, sorry I cannot fix it myself my python is shocking! I can put a bounty on it though if you could tell me how much you think it would take.

Startup with;-

./mining_proxy.py -v --host=stratum.bitcoin.cz --port=3333 --custom-user=NRF.DT2 --custom-password=DT2

cgminer 3.2.0 on client configured with;-

{
"pools" : [
{
"url" : "stratum+tcp://satoshimine.com:3333",
"user" : "NRF.LT",
"pass" : "LT"
}
]

Verbose output including startup, 1 share and shutdown;-

2013-06-19 23:07:24,759 DEBUG stats logger.get_logger # Logging initialized
2013-06-19 23:07:24,797 DEBUG protocol logger.get_logger # Logging initialized
2013-06-19 23:07:24,798 DEBUG socket_transport logger.get_logger # Logging initialized
2013-06-19 23:07:24,890 DEBUG proxy logger.get_logger # Logging initialized
2013-06-19 23:07:24,891 DEBUG proxy logger.get_logger # Logging initialized
2013-06-19 23:07:24,893 INFO proxy jobs. # Using C extension for midstate speedup. Good!
2013-06-19 23:07:24,893 DEBUG proxy logger.get_logger # Logging initialized
2013-06-19 23:07:24,894 DEBUG proxy logger.get_logger # Logging initialized
2013-06-19 23:07:24,894 DEBUG proxy logger.get_logger # Logging initialized
2013-06-19 23:07:24,895 DEBUG proxy logger.get_logger # Logging initialized
2013-06-19 23:07:24,895 DEBUG proxy logger.get_logger # Logging initialized
2013-06-19 23:07:24,895 DEBUG proxy logger.get_logger # Logging initialized
2013-06-19 23:07:24,896 WARNING proxy mining_proxy.main # Stratum proxy version: 1.5.2
2013-06-19 23:07:24,900 WARNING proxy mining_proxy.test_update # Checking for updates...
2013-06-19 23:07:24,966 WARNING proxy mining_proxy.main # Trying to connect to Stratum pool at stratum.bitcoin.cz:3333
2013-06-19 23:07:25,055 INFO stats stats.print_stats # 1 peers connected, state changed 1 times
2013-06-19 23:07:25,056 DEBUG protocol protocol.connectionMade # Connected 54.215.3.101
2013-06-19 23:07:25,056 DEBUG protocol protocol.connectionMade # Resuming connection: []
2013-06-19 23:07:25,056 INFO proxy mining_proxy.on_connect # Connected to Stratum pool at stratum.bitcoin.cz:3333
2013-06-19 23:07:25,056 WARNING proxy mining_proxy.on_connect # Authorizing custom user NRF.DT2, password DT2
2013-06-19 23:07:25,057 DEBUG protocol protocol.writeJsonRequest # < {"params": ["NRF.DT2", "DT2"], "id": 1, "method": "mining.authorize"}
2013-06-19 23:07:25,057 INFO proxy mining_proxy.on_connect # Subscribing for mining jobs
2013-06-19 23:07:25,057 DEBUG protocol protocol.writeJsonRequest # < {"params": [], "id": 2, "method": "mining.subscribe"}
2013-06-19 23:07:25,147 DEBUG protocol protocol.lineReceived # > {u'result': True, u'id': 1, u'error': None}
2013-06-19 23:07:25,148 DEBUG protocol protocol.lineReceived # > {u'result': [[[u'mining.set_difficulty', u'b4b6693b72a50c7116db18d6497cac52'], [u'mining.notify', u'ae6812eb4cd7735a302a8a9dd95cf71f']], u'0809982c', 4], u'id': 2, u'error': None}
2013-06-19 23:07:25,151 WARNING proxy mining_proxy.main # -----------------------------------------------------------------------
2013-06-19 23:07:25,151 WARNING proxy mining_proxy.main # PROXY IS LISTENING ON ALL IPs ON PORT 3333 (stratum) AND 8332 (getwork)
2013-06-19 23:07:25,151 WARNING proxy mining_proxy.main # -----------------------------------------------------------------------
2013-06-19 23:07:25,152 DEBUG protocol protocol.lineReceived # > {u'params': [u'5e9d', u'635825264610559c485267e86a0fb41ae8fca78f2a45cae00000007300000000', u'01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2703afb203062f503253482f047e39c25108', u'0d3565396436382f736c7573682f0000000001fc047d98000000001976a9146be318f57ccd5b85d7ee9cc15a3c5da4f98064af88ac00000000', [u'7ed834f5673e312fcb54e036823303e24501ec5ef6fdeed2962b1741f0823baf', u'd791fa698d858b20e25ece459ceccbd3ad2799670c913687c661fe95a47d5e83', u'd6d8fecbe0f979e6757213339258a4799fbfceffffdc292c15b0dca4f4b20950', u'57252beb21cc17977e5543afa75a35bcf1afcfc56e42c25a032c8bee9896b89a', u'9b2076f4f034e577a7569800b1146ee6fa1161dad39371e4c22936371e4b5fc1', u'ce152258fa35aa4f897d40f7b6b48d2fcadd4bb95233787228fa980fbeb8a979', u'8ca5c74e0814944d042e80b149db26bc691db10216e0049f0f3491654dee1480', u'83306e080bcda83e6f1224def03e834eebdf09b3fe15e2a28de83571294f099c'], u'00000002', u'1a00de15', u'51c2397c', True], u'id': None, u'method': u'mining.notify'}
2013-06-19 23:07:25,152 INFO proxy client_service.handle_event # New job 5e9d for prevhash 63582526, clean_jobs=True
2013-06-19 23:07:32,257 INFO stats stats.print_stats # 2 peers connected, state changed 1 times
2013-06-19 23:07:32,258 DEBUG protocol protocol.connectionMade # Connected 203.167.204.11
2013-06-19 23:07:32,487 DEBUG protocol protocol.writeJsonRequest # < {"params": ["NRF.LT", "LT"], "id": 3, "method": "mining.authorize"}
2013-06-19 23:07:32,576 DEBUG protocol protocol.lineReceived # > {u'result': True, u'id': 3, u'error': None}
2013-06-19 23:07:33,876 DEBUG protocol protocol.lineReceived # > {u'params': [u'5e9e', u'635825264610559c485267e86a0fb41ae8fca78f2a45cae00000007300000000', u'01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2703afb203062f503253482f04b539c25108', u'0d3565396565342f736c7573682f0000000001fcd8ad98000000001976a9146be318f57ccd5b85d7ee9cc15a3c5da4f98064af88ac00000000', [u'7ed834f5673e312fcb54e036823303e24501ec5ef6fdeed2962b1741f0823baf', u'd791fa698d858b20e25ece459ceccbd3ad2799670c913687c661fe95a47d5e83', u'a37c655ef38be1e6899c2cc6be7699e1dd53f141dea9d67a85f7747737ed8eb2', u'1f18bb1c4b2d1186f33852092c0e0c353fbf51a8943271ca95523d5383f44371', u'463819d4332d368065409fd9fc4acb8c0eb1003f6ae0d1188188e71670706acd', u'160037bb6c97e24b9898b98b0f9023ce4fc24611a89631a34116212df9586c52', u'59f53175d65c777781a141f9ca9da5d21ac2c6f7773b5f39b68e379e780da3b8', u'8c57a1196dbe40f9a833f26bcc8fa89319660c5f84ec68dfb89dc5649a34c90c'], u'00000002', u'1a00de15', u'51c239b3', False], u'id': None, u'method': u'mining.notify'}
2013-06-19 23:07:33,877 INFO proxy client_service.handle_event # New job 5e9e for prevhash 63582526, clean_jobs=False
2013-06-19 23:08:30,417 DEBUG protocol protocol.lineReceived # > {u'params': [u'5e9f', u'635825264610559c485267e86a0fb41ae8fca78f2a45cae00000007300000000', u'01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2703afb203062f503253482f04ed39c25108', u'0d3565396632612f736c7573682f0000000001bc4cd498000000001976a9146be318f57ccd5b85d7ee9cc15a3c5da4f98064af88ac00000000', [u'7ed834f5673e312fcb54e036823303e24501ec5ef6fdeed2962b1741f0823baf', u'58a30563e5e2b497d657718496d588c1c48644cc07757440b76b980517a97a6c', u'f934b05bd25308e8da9ff06b36574d3636ccba4d2691d9aaf3e076bcaee67c92', u'642f29207e6ef95d985df77bd41f528c1ccf90aa3c0b909d252aff6625179c0a', u'8eaa1e4ba9b7b43f53ad45693a39e50b1c40fa4a39f9299076c79b3ca1292ac9', u'724264d72a463cd672b6cb3e3d6ca16ae73c8dc4d78dd8365906885155fc6e1a', u'e3cce62bf68087123767f1cf8cd71af6f65cd666e04f484a35fc6c9394a98b51', u'7370c0bffbaa385572fbba01cf877005b56ddde842151a03066307e75d8ae57c'], u'00000002', u'1a00de15', u'51c239eb', False], u'id': None, u'method': u'mining.notify'}
2013-06-19 23:08:30,417 INFO proxy client_service.handle_event # New job 5e9f for prevhash 63582526, clean_jobs=False
2013-06-19 23:09:25,351 DEBUG protocol protocol.lineReceived # > {u'params': [u'5ea0', u'635825264610559c485267e86a0fb41ae8fca78f2a45cae00000007300000000', u'01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2703afb203062f503253482f04243ac25108', u'0d3565613037312f736c7573682f00000000011c7c0899000000001976a9146be318f57ccd5b85d7ee9cc15a3c5da4f98064af88ac00000000', [u'7ed834f5673e312fcb54e036823303e24501ec5ef6fdeed2962b1741f0823baf', u'58a30563e5e2b497d657718496d588c1c48644cc07757440b76b980517a97a6c', u'1eac3ff0b53873cc24a92337df5290ce3718d997e800b95ee77de9ffbfcba024', u'510487c831a54937f0865424cb3b5c75b61c12a94a4371208408f653e92d85cf', u'3c3b7a1296f9ec349bf93404da57a22a4be784e4abbcb63f87a1b5c27e28d34a', u'a433328cddd8a6bdd1f2db9785c4aae6b63598bf4d78ee220786a214201ea75f', u'619459850c4f429ea20f615a04d4416f3993f1063c53021742920f2cf23ed45a', u'761e6678ab725fcb8686d6f980b45f5e5097b2404a18fe3f02d2a1de25e20a12', u'21a10163eebe14dc3c67cdc925764814c6a1ed8dc6a50a7ec1277fd769468d11'], u'00000002', u'1a00de15', u'51c23a22', False], u'id': None, u'method': u'mining.notify'}
2013-06-19 23:09:25,352 INFO proxy client_service.handle_event # New job 5ea0 for prevhash 63582526, clean_jobs=False
2013-06-19 23:10:02,088 DEBUG protocol protocol.writeJsonRequest # < {"params": ["NRF.LT", "5ea0", "010a0000", "51c23a22", "4a06e485"], "id": 4, "method": "mining.submit"}
2013-06-19 23:10:02,179 DEBUG protocol protocol.lineReceived # > {u'result': True, u'id': 4, u'error': None}
2013-06-19 23:10:02,180 INFO proxy stratum_listener.submit # [92ms] Share from 'NRF.LT' accepted, diff 1
2013-06-19 23:10:05,198 INFO stats stats.print_stats # 1 peers connected, state changed 1 times
^C2013-06-19 23:10:09,338 INFO proxy mining_proxy.on_shutdown # Shutting down proxy...
2013-06-19 23:10:09,340 INFO proxy mining_proxy.on_disconnect # Disconnected from Stratum pool at stratum.bitcoin.cz:3333
2013-06-19 23:10:09,340 INFO stats stats.print_stats # 0 peers connected, state changed 1 times

Neil

@mooc0w
Copy link

mooc0w commented Jul 22, 2013

Check out my fork:
https://github.com/mooc0w/stratum-mining-proxy/

It overrides all upstream authentication and submits with the custom username & password. Stratum client connections work great, getwork clients should work too but completely untested.

@slush0
Copy link
Owner

slush0 commented Jan 28, 2014

--custom-user has been originally implemented only for getwork interface. Recent commits added support also for stratum miners, feel free to test it!

@slush0 slush0 closed this as completed Jan 28, 2014
@alexsm288
Copy link

Please make changes Windovs version. She still does not authorize clients.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants