*** tpb has joined #pettycoin | 00:00 | |
rusty | arhuaco: I just sent you 12345 (petty)bits. It's still pending... | 01:07 |
---|---|---|
arhuaco | rusty: Thanks. "./dumbwallet balance" is stuck. "write(3, "{ \"method\" : \"listtransactions\","..., 101) = 101" and now it is waiting for a fread(3). | 01:46 |
rusty | arhuaco: I think this is the same as but #22 | 01:47 |
rusty | arhuaco: bug #22 | 01:47 |
rusty | tbp: help | 01:48 |
rusty | arhuaco: I'm seeing similar things, where I/O isn't being processed. Debugging now... | 01:48 |
arhuaco | rusty: Good. I'll be back soon. | 01:52 |
arhuaco | rusty: Back. I'll be around tonight. I'll try to help. I don't know how yet, but I guess I'll find out. | 02:50 |
rusty | arhuaco: cool... my bug turned out to be different, am chasing now. | 02:50 |
rusty | arhuaco: well, hopefully fixing now. | 02:50 |
rusty | arhuaco: might be work make distclean though? | 02:51 |
arhuaco | rusty: Testing. | 02:52 |
arhuaco | rusty: Ah, adding distclean? I am not very good with autotools but I can try. Looking... | 02:55 |
rusty | arhuaco: no, I have disclean alreeady. | 02:55 |
rusty | arhuaco: if you grab latest, I rewrote Makefiles a bit. But they still don't do auto dependencies, so make distclean && ./configure && make | 02:56 |
arhuaco | rusty: Ah, sorry. Got it. I did it twice and I did not notice it worked the first time. And obviously the second time it did not. | 02:56 |
rusty | arhuaco: ah, the first time it deleted the Makefile :) | 02:56 |
arhuaco | It got stuck in the same place. I did not notice new commits to try. But with clean build the result is the same. | 02:58 |
arhuaco | rusty: I'm looking at dumballet.c. It would be nice to (try to) connect to the server from Python. I think it would help me learn a lot about how the keys are being managed and about the protocol. And I guess I could use that to do stress testing . | 03:05 |
rusty | arhuaco: hmm, great you can reproduce! I'll try to do the same here. What are the steps? | 03:06 |
rusty | arhuaco: did you restart pettycoin BTW? | 03:07 |
rusty | arhuaco: the API is JSON, but it's very incomplete. I'm adding it as we go, so feel free to ask for more :) | 03:07 |
rusty | arhuaco: where it make sense, I'm using the bitcoind commands. | 03:07 |
rusty | brb, grabbing food.... | 03:07 |
arhuaco | rusty: distclean, then build, then start the server "./pettycoin --reward-address=P-mmXqi49TyZFSZCKkCDZm4nVWynDck8nGan --log-level=info", then "./dumbwallet balance". With strace I notice it gets stuck waiting for a reply after invoking RPC with "listtransactions". | 03:09 |
arhuaco | rusty: Yes. | 03:09 |
arhuaco | rusty: I will have some free time this month and I'd like to learn and contribute a bit. I think that if I start working with the RPC (starting with the python client) I'll understand things and eventually I will be able to contribute in the C world later, when I understand more. | 03:14 |
rusty | arhuaco: weird.. works fine here. | 03:23 |
arhuaco | rusty: I see. I started the server with debug logleve to see if I can see more. | 03:26 |
rusty | arhuaco: OTOH, it says I have 0 balance, which is wrong too. Will fix that, then see if I can reproduce. | 03:26 |
arhuaco | rusty: Good. Mine get stuck and I am sure I have a clean build. | 03:27 |
rusty | arhuaco: I like bugs which happen every single time :) | 03:27 |
rusty | arhuaco: oh, wait, it's correct. Horizon on test network is 12 hours, so no surprise my pettycoin are "gone". | 03:33 |
arhuaco | rusty: :-) | 03:34 |
arhuaco | rusty: They do not get returned to a gateway yet, right? | 03:34 |
rusty | arhuaco: exactly! | 03:34 |
rusty | arhuaco: I forgot how short the horizon was on the test network! | 03:34 |
rusty | arhuaco: actually, comment is wrong, it's 120 hours. Let me fix that comment, too. | 03:36 |
githubby | [pettycoin] rustyrussell pushed 5 new commits to master: http://git.io/OwU6wQ | 03:40 |
githubby | pettycoin/master 97d1853 Rusty Russell: json_add_tx: separate JSON printing of a TX into its own file.... | 03:40 |
githubby | pettycoin/master 2df86f2 Rusty Russell: gettransaction: new JSON command.... | 03:40 |
githubby | pettycoin/master 4cb6d34 Rusty Russell: getinfo, dev-listtodo: beef up output.... | 03:40 |
*** arhuaco has quit IRC | 03:57 | |
*** arhuaco has joined #pettycoin | 04:11 | |
arhuaco | rusty: This might help. The first two times or so I get the output I sent you, and then it cannot connect. http://pastebin.com/4atCqZiZ | 04:11 |
tpb | Title: So, it starts like this. I can Ctrl+C a few times with the same result. The fir - Pastebin.com (at pastebin.com) | 04:11 |
rusty | arhuaco: strace -p `pidof pettycoin` might be useful, to see what it's doing... | 04:12 |
arhuaco | rusty: OK. | 04:12 |
arhuaco | rusty: It seems the pool call doesn't accept the new connection. It's stuck with this: poll([{fd=5, events=POLLIN}, {fd=6, events=POLLOUT}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=7, events=POLLIN}], 5, -1) = 3 ([{fd=6, revents=POLLOUT}, {fd=8, revents=POLLIN|POLLHUP}, {fd=7, revents=POLLIN|POLLERR|POLLHUP}]) | 04:20 |
arhuaco | write(6, "@E\4\0\4\0\0\0\34\225\254`:\4\370k\304\262\374j\322Z\303C\222\326\16\244\370V\365\350"..., 279872 | 04:20 |
arhuaco | rusty: So if the backlog is small that would explain why the behavior changes. | 04:20 |
arhuaco | (poll I mean..) | 04:20 |
rusty | arhuaco: I'm seeing the same thing... massive delays on that write! | 04:20 |
rusty | arhuaco: what's weird is that poll() said it was ready. | 04:21 |
rusty | arhuaco: for example: | 04:24 |
rusty | 04:17:40 poll([{fd=5, events=POLLIN}, {fd=19, events=POLLIN}, {fd=6, events=POLL | 04:24 |
rusty | IN}, {fd=15, events=POLLIN}, {fd=8, events=POLLIN}, {fd=-11}, {fd=7, events=POLL | 04:24 |
rusty | OUT}], 7, -1) = 1 ([{fd=7, revents=POLLOUT}]) <0.000014> | 04:24 |
rusty | 04:17:40 write(7, "\224]\4\0\4\0\0\0\200\203\16\234\v\262\276\321h\357\217Y\0\204\21\31\253\304#U\0206}\20"..., 286100) = 159280 <98.894019> | 04:24 |
rusty | 0 | 04:24 |
rusty | That write takes 98 seconds! | 04:24 |
arhuaco | Oh, so it eventually finishes. I guess you're reaching a timeout. | 04:26 |
arhuaco | rusty:I'll try not canceling the command to see if it finishes. | 04:27 |
arhuaco | rusty: Waiting for peer... | 04:31 |
rusty | arhuaco: Hmm, let me leave the fd in non-blocking mode and see if that helps. It shouldn't, but... | 04:32 |
arhuaco | rusty:I It behaves in a different way when there are no connected peers. | 04:48 |
rusty | arhuaco: I think so... it's that massive write blocking. | 04:49 |
rusty | arhuaco: I plan on changing the sync protocol so the write isn't as big, but also it shouldn't be doing that anyway. | 04:49 |
rusty | arhuaco: hmm, making the sockets nonblocking seems to have fixed it. I'm surprised... | 05:06 |
arhuaco | rusty: :-) | 05:06 |
rusty | arhuaco: I will commit that now. | 05:06 |
rusty | arhuaco: pushed! | 05:36 |
arhuaco | rusty: Testing... | 05:37 |
arhuaco | rusty: Not pushed yet... | 05:38 |
rusty | arhuaco: sorry! One sec... | 05:38 |
rusty | arhuaco: ok, this time for sure! | 05:42 |
githubby | [pettycoin] rustyrussell pushed 2 new commits to master: http://git.io/9TkzIQ | 05:42 |
githubby | pettycoin/master ae6afdf Rusty Russell: gettransaction: fix tests.... | 05:42 |
githubby | pettycoin/master 5a4c143 Rusty Russell: ccan: update (non-blocking I/O working)... | 05:42 |
arhuaco | 0.00 bits. | 05:44 |
rusty | arhuaco: I guess that's progress, in a way :) | 05:50 |
arhuaco | rusty: :-) | 05:50 |
*** rusty has quit IRC | 06:00 | |
*** rusty has joined #pettycoin | 06:12 | |
*** rusty has quit IRC | 06:21 | |
*** rusty has joined #pettycoin | 06:33 | |
*** rusty has quit IRC | 07:13 | |
*** rusty has joined #pettycoin | 07:20 | |
*** rusty has quit IRC | 07:26 | |
*** rusty has joined #pettycoin | 11:19 | |
*** rusty has joined #pettycoin | 11:20 | |
arhuaco | rusty: Hello there. I noticed that reading the JSON call form pettycoin is funny because you have to count {} to see when the reply ends (and use non-blocking I/O). I am writing some code that does that, but I am also checking if an existing library works. There are not many examples for UNIX sockets and JSON/RPC. | 11:32 |
arhuaco | rusty: (Or even socket transport, in Python...) | 11:32 |
rusty | arhuaco: yes, it's weird. The C/jsmn library works because it will tell your if the JSON is partial, and you can read more :) | 11:33 |
rusty | arhuaco: I did think about the socket thing, too. bitcoind uses a TCP socket for JSON commands, which is weird, but I guess more portable? | 11:33 |
arhuaco | rusty: Well, for Windows :-) I don't know other OSs.. Mostly linux and a bit of other popular UNIXes. | 11:36 |
rusty | arhuaco: well, we could have a oneshot mode where we ask pettycoin to close the socket after the response? | 11:36 |
arhuaco | rusty: That would make things simpler. I don't think the current way is too problematic, (I'm close to finish the parsing), but that is a bit advaced... With the oneshot it will be easier to implement clients. | 11:38 |
arhuaco | rusty: I was thinking that when I finish the reader, then I can do a pettycoin-rpc to HTTP+rest-RPC proxy. It could be useful. | 11:40 |
rusty | arhuaco: or perhaps rewrite the pettycoin-rpc to be rest-er? :) | 11:41 |
arhuaco | rusty: :-) Well, the current way of calling pettycoin-rpc is a bit weird. People might get discouraged to write clients. Thinking. | 11:43 |
arhuaco | rusty: The issue is that you might not know the length of the response in advance. So I do not know how clients deal with this. Checking... Most documentation for JSON-RPC deals with HTTP so that's why I'm a bit confused (Cannot find examples for the libraries available in latest Ubuntu). | 11:46 |
arhuaco | rusty: rpc = jsonrpclib.Server('unix:/pettycoin-rpc'). This one gets accepted but I do not know how to proceed form there. Checking... | 11:48 |
arhuaco | rusty: the 'unix:' prefix is accepted, so I guess it is supported. I wonder if it does the partial-reading thing correctly... | 11:50 |
arhuaco | rusty: closing the connection makes things easier with this. But I wonder whether it will make things inefficient. | 11:52 |
arhuaco | rusty: I better finish the reader. It is more efficient this way. But if you think I can help with the RPC interface let me know. | 11:58 |
rusty | arhuaco: I stole the interface from bitcoind; suggestions welcome! | 11:58 |
arhuaco | rusty: Yeah, I guess that's why they did this. It is weird (compared with HTTP), but efficient.... so I guess it is OK. I'll finish what I was doing. I was just a bit worried of reinventing the wheel. | 12:00 |
rusty | arhuaco: OK. I'm extending the horizon on the test network to 3 days, BTW. 12 hours is too short :) | 12:06 |
arhuaco | rusty: :-) I'm gathering testnet bitcoins. BTW, it seems bitcoind uses HTTP! | 12:07 |
rusty | arhuaco: yes, it's JSON over https. That seemed like a security nightmare to me; I'd prefer a proxy for that! | 12:08 |
arhuaco | rusty: Well, I'll finish the reader. More efficient. I can write the proxy then to make things easier for others. | 12:08 |
* arhuaco will get grab breakfast. B.B. soon. | 12:18 | |
* arhuaco will grab breakfast. B.B. soon. | 12:19 | |
*** rusty has quit IRC | 12:59 | |
*** rusty has joined #pettycoin | 22:47 |
Generated by irclog2html.py 2.12.1 by Marius Gedminas - find it at mg.pov.lt!