Closed halfn0rmal closed 6 years ago
I have tried it with my credentials, everything worked out fine:
curl -v -u kyon:lolcat --data '{"version": "1.1", "method": "getinfo", "params": [], "id": 1}' -H 'content-
type: text/plain;' http://localhost:20102
* Rebuilt URL to: http://localhost:20102/
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 20102 (#0)
* Server auth using Basic with user 'kyon'
> POST / HTTP/1.1
> Host: localhost:20102
> Authorization: Basic a3lvbjpsb2xjYXQ=
> User-Agent: curl/7.54.0
> Accept: */*
> content-type: text/plain;
> Content-Length: 62
>
* upload completely sent off: 62 out of 62 bytes
< HTTP/1.1 200 OK
< Date: Fri, 11 May 2018 18:48:01 +0000
< Connection: keep-alive
< Content-Length: 611
< Content-Type: application/json
< Server: VERGE-json-rpc/v4.0.2.0-80de5df-funky-beta
<
{"result":{ ... },"error":null,"id":1}
* Connection #0 to host localhost left intact
maybe you can have a try with my VERGE.conf
rpcuser=kyon
rpcpassword=lolcat
rpcport=20102
port=21102
server=1
daemon=1
rpcallowip=127.0.0.1
Just to eliminate Tor as a potential cause, you could try downloading the clearnet
git clone https://github.com/vergecurrency/VERGE.git
cd VERGE
git checkout 4.0clearnet
./autogen.sh
./configure
make
delete old peers.dat
I would think for what you are trying to do -- clearnet would be the way to go anyways. Unless you REALLY want it to be through Tor. We tell all the mining pools to use the clearnet branch.
It should work either way though.. so just for troubleshooting to eliminate other factors.
@marpme tried your VERGE.conf but still no luck. will try your suggestion @jrsikors and post back
@jrsikors Your suggestion got it working, so the issue is with my tor setup? If you think I do not need to run tor then I will keep it as is and consider it solved. Thanks for your help! Could update the VERGE-PYTHON docs to suggest this way for people in the future?
The only thing I could find was: https://tor.stackexchange.com/questions/16095/405-method-connection-mark-unattached-ap
"The HTTPTunnelPort is an HTTP CONNECT proxy, so it only accepts the CONNECT method. It seems the app is using CONNECT for HTTPS and another method for HTTP?"
It must not like your HTTPTunnelPort localhost:20102 ?
Yea must be, how would I set up if I did want to use tor? Strange that worked on my windows 10 machine.
May 11 23:06:19.365 [notice] Read configuration file "/home/user/.VERGE/tor/torrc".
Did you manually create it? Or were those lines and torrc already there when you compiled it?
HTTPTunnelPort localhost:20102
SOCKSPort localhost:20101
SOCKSPort 0 ## Default: Bind to localhost:9050 for local connections.
SOCKSPort 192.168.0.1:9100 # Bind to this address:port too.
Basically either delete the torrc file, or put a # in front of HTTPTunnelPort localhost:20102
You have a chance to play around with it yet?
I manually created the torrc file, when I run without the httpTunnelPort I get a return that says: This is a SOCKs proxy, not an HTTP proxy. It appears you have configured your web browser to use this Tor port as an HTTP proxy.
This is not correct: This port is configured as a SOCKS proxy, not an HTTP proxy. If you need an HTTP proxy tunnel, use the HTTPTunnelPort configuration option in place of, or in addition to, SOCKSPort. Please configure your client accordingly.
See https://www.torproject.org/documentation.html for more information
After I initially got that message I added the torrc with the httpTunnelPort. The weird thing is this setup worked on my windows machine but not on Ubuntu.
@marpme — were you using clearnet? Or did you have a custom torrc? Or did your test just work?
On May 16, 2018, at 1:37 PM, halfn0rmal notifications@github.com wrote:
I manually created the torrc file, when I run without the httpTunnelPort I get a return that says: This is a SOCKs proxy, not an HTTP proxy. It appears you have configured your web browser to use this Tor port as an HTTP proxy.
This is not correct: This port is configured as a SOCKS proxy, not an HTTP proxy. If you need an HTTP proxy tunnel, use the HTTPTunnelPort configuration option in place of, or in addition to, SOCKSPort. Please configure your client accordingly.
See https://www.torproject.org/documentation.html for more information
After I initially got that message I added the torrc with the httpTunnelPort. The weird thing is this setup worked on my windows machine but not on Ubuntu.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Looking at it from minor details between you and @marpme , gunna throw them all out there even though some don't make sense: 1) He was using curl 7.54 , you were using curl 7.58 2) His "accept" was / where yours was just / 3) He got a HTTP 1.1 response, you got an HTTP 1.0 response
It still doesn't make much sense to me why this isn't working "out of the box" for you though... unless @marpme was using Clearnet for his test.
So again from Ubuntu 16.04. (the closest I could actually test)
curl -v -u vergetestuser:testing --data '{ "version": "1.1", "method": "getinfo", "params": [], "id": 1 }' -H 'content-type: text/plain;' http://localhost:20102
* Rebuilt URL to: http://localhost:20102/
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 20102 (#0)
* Server auth using Basic with user 'vergetestuser'
> POST / HTTP/1.1
> Host: localhost:20102
> Authorization: Basic dmVyZ2V0ZXN0dXNlcjp0ZXN0aW5n
> User-Agent: curl/7.47.0
> Accept: */*
> content-type: text/plain;
> Content-Length: 64
>
* upload completely sent off: 64 out of 64 bytes
< HTTP/1.1 200 OK
< Date: Fri, 25 May 2018 22:13:32 +0000
< Connection: keep-alive
< Content-Length: 582
< Content-Type: application/json
< Server: VERGE-json-rpc/v4.0.2.0-e1b8fd8-funky-beta
<
{"result":{"version":"v4.0.2.0-e1b8fd8-funky-beta","protocolversion":90001,"walletversion":60000, ....},"error":null,"id":1}
* Connection #0 to host localhost left intact
VERGE version v4.0.2.0-e1b8fd8-funky-beta (2018-04-16 21:59:28 +0200)
Using OpenSSL version OpenSSL 1.0.2g 1 Mar 2016
Startup time: 05/25/18 22:16:59
Default data directory /home/kyon/.VERGE
Default mining hash algorithm: scrypt
Used data directory /home/kyon/.VERGE
scrypt: using scrypt-sse2 as built.
dbenv.open LogDir=/home/kyon/.VERGE/database ErrorFile=/home/kyon/.VERGE/db.log
Bound to 127.0.0.1:21102
TOR thread started.
AddLocal(6wmrllg42oylrbva.onion:21102,4)
Loading block index...
Opening LevelDB in /home/kyon/.VERGE/txleveldb
No OBFS4 found, not using it.
May 26 00:16:59.074 [notice] Tor 0.3.2.8-rc-dev running on Linux with Libevent 2.0.21-stable, OpenSSL 1.0.2g, Zlib 1.2.8, Liblzma N/A, and Libzstd N/A.
May 26 00:16:59.074 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
May 26 00:16:59.074 [notice] Configuration file "/home/kyon/.VERGE/tor/torrc" not present, using reasonable defaults.
May 26 00:16:59.076 [notice] Scheduler type KIST has been enabled.
May 26 00:16:59.076 [notice] Opening Socks listener on 127.0.0.1:9089
Transaction index version is 70509
Opened LevelDB successfully
Loading block index 14% ...
Loading block index 28% ...
Loading block index 43% ...
Loading block index 57% ...
Loading block index 71% ...
Loading block index 85% ...
Loading block index 100% ...
LoadBlockIndex(): hashBestChain=00000000028545ad96770ceaeb302d639c50100148fa9cd72327be245a49207d height=7031 trust=7032 date=10/14/14 13:47:19
LoadBlockIndex(): synchronized checkpoint 00000fc63692467faeb20cdb3b53200dc601d75bdfa1001463304cc790d77278
Verifying last 2500 blocks at level 1
block index 2681ms
Loading wallet...
nFileVersion = 4000200
wallet 163ms
Loading addresses...
Loaded 7 addresses from peers.dat 0ms
mapBlockIndex.size() = 7032
nBestHeight = 7031
setKeyPool.size() = 101
mapWallet.size() = 0
mapAddressBook.size() = 1
Done loading
ThreadRPCServer started
ThreadSocketHandler started
Loading addresses from .onion seeds
ThreadMessageHandler started
7 addresses found from .onion seeds
ThreadOnionSeed exited
Flushed 7 addresses to peers.dat 3ms
trying connection plxs66tqlzbnh3ua.onion:21102 lastseen=73.5hrs
SOCKS5 connecting plxs66tqlzbnh3ua.onion
ThreadRPCServer method=getinfo
rpcuser=vergetestuser
rpcpassword=testing
deamon=1
server=1
Freshly compiled on current master f8ca082 (so not clearnet) and nothing else is set up. Just the default config and I also removed the .VERGE folder before running the newly compiled wallet.
If you are still interested in testing @halfn0rmal -- I would completely delete the torrc , or rename it to torrcOLD or something... and then try @marpme 's steps / configs... and try with only those 4 lines in the VERGE.conf
We want to see something like this in the tor log.
May 26 00:16:59.074 [notice] Configuration file "/home/kyon/.VERGE/tor/torrc" not present, using reasonable defaults.
May 26 00:16:59.076 [notice] Scheduler type KIST has been enabled.
May 26 00:16:59.076 [notice] Opening Socks listener on 127.0.0.1:9089
Otherwise if you are done messing with it for now, you are good to just use the clearnet option we talked about earlier
Just tried it with php-verge. Working perfectly. OS: Ubuntu 16.04 64bit
VERGE.conf
rpcuser=vergerpcuser
rpcpassword=rpcpassword
rpcport=20102
port=21102
server=1
listen=1
daemon=1
Sorry for the delay, tried on production environment running CentOS, works perfectly first time without needing clearnet. Aside from updating the boost libraries it installed without any issue.
weird -- i'm glad it's working. Keep an eye out for major updates coming with new codebase. No ETA !
Cheers !
I am trying to use the VERGE-PYTHON module to integrate verge payments onto a website. I have had this working on windows and have moved to ubuntu to test before going to a production environment. No matter what I have tried the VERGEd RPC commands will not work, I need some help with what I am doing wrong here. I have set everything up exactly as the documentation specifies but I only get 405 errors when trying to send RPC commands via cURL and empty responses from the VERGE-PYTHON module. Even if i try sudo VERGEd getinfo from the terminal I get a 405 from server. Any help would be greatly appreciated!
Prerequisites
User Story:
Your Environment
Any extra information that might be useful in the debugging process.
My VERGE.conf: rpcuser=testuser rpcpassword=testing rpcport=20102 port=21102 daemon=1 server=1 algo=groestl
My torrc:
Tor opens a SOCKS proxy on port 9050 by default -- even if you don't
configure one below. Set "SOCKSPort 0" if you plan to run Tor only
as a relay, and not make any local application connections yourself.
HTTPTunnelPort localhost:20102
SOCKSPort localhost:20101
SOCKSPort 0 ## Default: Bind to localhost:9050 for local connections.
SOCKSPort 192.168.0.1:9100 # Bind to this address:port too.
cURL: curl -v -u testuser:testing --data '{"version": "1.1", "method": "getinfo", "params": [], "id": 1}' -H 'content-type: text/plain;' http://localhost:20102
With VERGE-PYTHON: Internal Server Error: /home/ Traceback (most recent call last): File "/home/user/env/test/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/home/user/env/test/lib/python3.6/site-packages/django/core/handlers/base.py", line 128, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/user/env/test/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "/home/user/env/test//views.py", line 56, in index print(conn.getinfo()) File "/home/user/env/test/vergerpc/connection.py", line 132, in getinfo return ServerInfo(self.proxy.getinfo()) File "/home/user/env/test/vergerpc/proxy.py", line 126, in call resp = json.loads(resp, parse_float=decimal.Decimal) File "/usr/lib/python3.6/json/init.py", line 367, in loads return cls(**kw).decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
From Terminal: sudo VERGEd getinfo error: server returned HTTP error 405
tor.log: May 11 23:06:19.000 [notice] Tor 0.3.2.8-rc-dev opening log file. May 11 23:06:19.365 [notice] Tor 0.3.2.8-rc-dev running on Linux with Libevent 2.1.8-stable, OpenSSL 1.1.0g, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A. May 11 23:06:19.365 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning May 11 23:06:19.365 [notice] Read configuration file "/home/user/.VERGE/tor/torrc". May 11 23:06:19.369 [notice] Scheduler type KIST has been enabled. May 11 23:06:19.369 [notice] Opening Socks listener on 127.0.0.1:9089 May 11 23:06:19.369 [notice] Opening HTTP tunnel listener on 127.0.0.1:20102 May 11 23:06:19.000 [notice] Parsing GEOIP IPv4 file /usr/local/share/tor/geoip. May 11 23:06:19.000 [notice] Parsing GEOIP IPv6 file /usr/local/share/tor/geoip6. May 11 23:06:19.000 [warn] You are running Tor as root. You don't need to, and you probably shouldn't. May 11 23:06:19.000 [notice] Bootstrapped 0%: Starting May 11 23:06:19.000 [notice] Starting with guard context "default" May 11 23:06:19.000 [notice] Bootstrapped 80%: Connecting to the Tor network May 11 23:06:20.000 [notice] Bootstrapped 85%: Finishing handshake with first hop May 11 23:06:22.000 [notice] Bootstrapped 90%: Establishing a Tor circuit May 11 23:06:23.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working. May 11 23:06:23.000 [notice] Bootstrapped 100%: Done May 11 23:11:18.000 [warn] Saying "HTTP/1.0 405 Method Not Allowed\r\n\r\n" May 11 23:11:18.000 [warn] connection_mark_unattachedap(): Bug: stream (marked at src/or/connection_edge.c:2544) sending two socks replies? (on Tor 0.3.2.8-rc-dev 9ef97a268b06fed7) May 11 23:12:19.000 [warn] Saying "HTTP/1.0 405 Method Not Allowed\r\n\r\n" May 11 23:12:19.000 [warn] connection_mark_unattachedap(): Bug: stream (marked at src/or/connection_edge.c:2544) sending two socks replies? (on Tor 0.3.2.8-rc-dev 9ef97a268b06fed7) May 11 23:15:45.000 [warn] Fetching v2 rendezvous descriptor failed. Retrying at another directory. May 11 23:15:52.000 [warn] Fetching v2 rendezvous descriptor failed. Retrying at another directory. May 11 23:16:28.000 [warn] Fetching v2 rendezvous descriptor failed. Retrying at another directory. May 11 23:16:30.000 [notice] Closing stream for '[scrubbed].onion': hidden service is unavailable (try again later). May 11 23:17:52.000 [notice] Closing stream for '[scrubbed].onion': hidden service is unavailable (try again later). May 11 23:18:28.000 [notice] Closing stream for '[scrubbed].onion': hidden service is unavailable (try again later). May 11 23:18:51.000 [warn] Fetching v2 rendezvous descriptor failed. Retrying at another directory. May 11 23:18:54.000 [warn] Fetching v2 rendezvous descriptor failed. Retrying at another directory. May 11 23:18:55.000 [notice] Closing stream for '[scrubbed].onion': hidden service is unavailable (try again later). May 11 23:19:07.000 [warn] Saying "HTTP/1.0 405 Method Not Allowed\r\n\r\n" May 11 23:19:07.000 [warn] connection_mark_unattachedap(): Bug: stream (marked at src/or/connection_edge.c:2544) sending two socks replies? (on Tor 0.3.2.8-rc-dev 9ef97a268b06fed7)