-
Notifications
You must be signed in to change notification settings - Fork 119
Implement JSON-RPC interface instead of CLI. #141
Conversation
(moving this comment to #137 ) |
Read the code, looks pretty good. I will try to test soon. Eventually run a long-running yield generator with it. |
ACK - FYI, no problems here during testing of wallet-tool, ob-watcher, sendpayment, patientsendpayment (see 147), and yield-generator. I did not test tumbler, yet. |
Tumbler will almost certainly work if the others do. Did you try getting a coinjoin as well with yield generator? I have testnet coins if you need them |
I've received successful orders as a maker using yield-generator with this commit, but I have seen this now several times in the console (doesn't show in logs):
This seems to result in the balances for available mix levels not being updated on the orderbook until another fill request is made. |
Good find. That's definitely a bug with this. |
Yes, the jsonrpc call returns something like:
while the command line simply returns the bare string (result value from above). I'm sure it's probably a relatively easy fix, but I don't know exactly how to do it myself for certain. |
@CohibAA Thanks for testing! This result of the JSON-RPC call is expected, that's how JSON-RPC works. It should be handled correctly by my code (picking out the Is there a chance you can send me the full log without censored tx privately? E. g., by email with GPG or private message on Bitcointalk? |
@domob1812 sure, whats your id on bct, send me a pm? me@bct |
Sent you a PM; I'm "domob" there. I've now also started my own yield-generator with the patch applied, maybe I can see the problem live for myself. |
Was the decoding error fixed by ad749d7? I've rebased my patch now. I've been running a yield generator for some time now with JSON-RPC, and it seems to work fine. The only thing I see from time to time as the "utxo already spent" issue ad749d7. This may occur more often now due to the longer confirmation times in the Bitcoin network recently. |
I'm going to start running my yield generator with this. |
I had to edit some stuff to make it work for me. I think we might be using different python versions that handle encoding slightly differently. I made it check whether the string is unicode and cast it back to an ascii string. My yield generator is running with this now, I'll check for that issue of balances not being updated. Don't worry about trying to copy this, I can include it when I merge (?)
|
I've been using this the last few days and it seems to work really well. Anyone else apart from @domob1812 tried it? One issue is people have to update their joinmarket.cfg, but hopefully there's not too many lazy people using JoinMarket right now. I'm thinking of merging this soon. |
I've been thinking, when people upgrade to this it will break their configuration. I don't want that to happen because it discourages regular updating by people. Everyone should have to update very soon because of the bip66 signature fix (I will send an alert about this.) And I wouldn't want people to update then find they have to mess around with configuration before it works again. So a way around this problem is to make it configurable which kind of json-rpc to use. In the .cfg file add an extra option
We'll update the wiki so new people use json-rpc-socket (or another name if you can think of something better than -socket) So this PR would require a small rewrite. And ideally another PR created when bitcoin-cli is phased out so it can be readily merged. |
Make the use of the new JSON-RPC interface optional. The legacy interface via the CLI binary is still possible. See the discussion in: JoinMarket-Org#141 To use the new interface, set: blockchain_source = json-rpc-socket
I've implemented the |
Make the use of the new JSON-RPC interface optional. The legacy interface via the CLI binary is still possible. See the discussion in: JoinMarket-Org#141 To use the new interface, set: blockchain_source = json-rpc-socket
My blockchain is corrupted so I have to redownload. I'll test this. |
I have not seen the encoding issue since ad749d7.
|
I have been successfully using this with no issues on yield-generator and sendpayment for 3 days. |
Replace the connection to Bitcoin Core via bitcoin-cli by a connection through its JSON-RPC interface. This is cleaner, as it does not require to convert everything to/from strings. It is also able to handle error codes.
Make the use of the new JSON-RPC interface optional. The legacy interface via the CLI binary is still possible. See the discussion in: JoinMarket-Org#141 To use the new interface, set: blockchain_source = json-rpc-socket
Make the use of the new JSON-RPC interface optional. The legacy interface via the CLI binary is still possible. See the discussion in: JoinMarket-Org#141 To use the new interface, set: blockchain_source = json-rpc-socket
Make the use of the new JSON-RPC interface optional. The legacy interface via the CLI binary is still possible. See the discussion in: JoinMarket-Org#141 To use the new interface, set: blockchain_source = json-rpc-socket
Make the use of the new JSON-RPC interface optional. The legacy interface via the CLI binary is still possible. See the discussion in: JoinMarket-Org#141 To use the new interface, set: blockchain_source = json-rpc-socket [gitreformat yapf-ify (github/ghtdak) on Fri Dec 4 04:51:03 2015] [from commit: ba07d06]
Replace the connection to Bitcoin Core via bitcoin-cli by a connection through its JSON-RPC interface. This is cleaner, as it does not require to convert everything to/from strings. It is also able to handle error codes.
See #137.
I have tested that it works successfully for a
sendpayment.py
order. More testing would probably be good, though.