windpath (OP)
Legendary
Offline
Activity: 1258
Merit: 1027
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 02:04:13 AM Last edit: July 10, 2015, 07:06:45 PM by windpath |
|
Originally planned on holding off on releasing this until all the API commands were integrated, but with the recent large increase in transaction volume, an Alpha release with what is ready seemed appropriate. In particular estimatefee and getmempoolinfo are now publicly available through your browser, along with 25 other API commands. When all the Bitcoin Core 0.10.2 commands are complete the whole thing will be released on GitHub as open source. So without further ado, http://ChainQuery.com/bitcoin-apiCurrently supported commands: Built for the average Joe to explore Bitcoin's core API and to serve as the foundation for PHP web applications to easily communicate with bitcoin core. I hope you like it so far, any questions or feedback are welcome and appreciated.
|
|
|
|
achow101
Staff
Legendary
Offline
Activity: 3486
Merit: 6824
Just writing some code
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 02:12:32 AM |
|
Seems good. I think you should have the outputs in a way to have everything broken down and apart instead of just returning the JSON object.
Also, maybe have each command in a drop down list and the user selects which command. Then the page has a description of the command and some text boxes to enter the parameters and such instead of having to enter the command as if it were the console. This would make it much more user friendly, especially to those who aren't familiar with using Bitcoin's console.
BTW, this belongs in project development.
|
|
|
|
batesresearch
Legendary
Offline
Activity: 2424
Merit: 1148
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 10:49:21 AM |
|
Wow, I like it. Could come in very useful for a service me and a friend are looking at starting in the future. Great work
|
Visit Satoshi's Place, a Bitcoin Hub based in Bury, Manchester, UK. Website: https://satoshisplace.co.ukGoals: Educate & Onboard users in to Bitcoin. Lightning network⚡️
|
|
|
DarkHyudrA
Legendary
Offline
Activity: 1386
Merit: 1000
English <-> Portuguese translations
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 11:03:34 AM |
|
I played around your site a bit, and it's pretty nice to test things since I don't have anymore the daemon on my PC.
|
English <-> Brazilian Portuguese translations
|
|
|
okae
Legendary
Offline
Activity: 1401
Merit: 1008
northern exposure
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 11:11:19 AM |
|
ohh looks pretty cool and seems to work pretty faster, i just try your online version, but i will try to downlod it and try by myselft ( when you release it ofc ). is a relly good job man, ty for release it, im waiting for the GitHub link ![Wink](https://bitcointalk.org/Smileys/default/wink.gif)
|
|
|
|
jonnybravo0311
Legendary
Offline
Activity: 1344
Merit: 1024
Mine at Jonny's Pool
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 03:19:43 PM |
|
Nice job windpath! I actually started my own Java project very similar to this... I wrote some code to do some data mining on empty blocks (see my thread here: https://bitcointalk.org/index.php?topic=1085800.0). Mostly I wrote the code for fun, but realized that I could expand it to provide a nice object-oriented view into the core APIs. That expansion has been started, but is nowhere near completed at this point, and I haven't put anything up on github yet. I know there are a number of available libraries already out there (like BitcoinJ), but being who I am, I wanted to figure things out on my own ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) . I'm looking forward to your progress with this project.
|
Jonny's Pool - Mine with us and help us grow! Support a pool that supports Bitcoin, not a hardware manufacturer's pockets! No SPV cheats. No empty blocks.
|
|
|
windpath (OP)
Legendary
Offline
Activity: 1258
Merit: 1027
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 03:22:54 PM |
|
Thanks folks! Regarding adding more accurate descriptions, each command links to it's bitcoin.org documentation with the (?) icon, and where a command has available parameters a form is generated and shown with a description of the fields, for example: http://chainquery.com/bitcoin-api/getnetworkhashpsOnce the raw JSON API is up I might break down the individual HTML result sets to make them more user friendly, the priority now is to get all the commands done and get it up on GitHub, this way maybe some others will join in and help ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif)
|
|
|
|
windpath (OP)
Legendary
Offline
Activity: 1258
Merit: 1027
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 03:24:10 PM |
|
Nice job windpath! I actually started my own Java project very similar to this... I wrote some code to do some data mining on empty blocks (see my thread here: https://bitcointalk.org/index.php?topic=1085800.0). Mostly I wrote the code for fun, but realized that I could expand it to provide a nice object-oriented view into the core APIs. That expansion has been started, but is nowhere near completed at this point, and I haven't put anything up on github yet. I know there are a number of available libraries already out there (like BitcoinJ), but being who I am, I wanted to figure things out on my own ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) . I'm looking forward to your progress with this project. Thanks JB! Getting intimate with the API was certainly a motivation of mine as well ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) Edit: That's some great data you have there, did not expect the empty block count to be nearly that high, great work!
|
|
|
|
jonnybravo0311
Legendary
Offline
Activity: 1344
Merit: 1024
Mine at Jonny's Pool
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 03:38:14 PM |
|
I expected quite a large set of the initial blocks to be empty - after all, a tiny subset of people even knew what Bitcoin was. However, the thing that really grates on me is how many empty blocks there are when there are most certainly transactions waiting to be included and confirmed. For example, we've been having our fun little stress tests recently, yet AntPool has continued to mine empty blocks. At one point I noticed nearly 20k transactions, but AntPool happily submitted a block with not a single one of them. Oh well... separate debate for another thread ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif)
|
Jonny's Pool - Mine with us and help us grow! Support a pool that supports Bitcoin, not a hardware manufacturer's pockets! No SPV cheats. No empty blocks.
|
|
|
unamis76
Legendary
Offline
Activity: 1512
Merit: 1012
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 03:40:10 PM |
|
New services are always welcome and yours seems a job pretty well done... But what could be the case uses for such a service? I think websites would probably need the wallet component of the Bitcoin Core client and not other API commands as much...
|
|
|
|
jonnybravo0311
Legendary
Offline
Activity: 1344
Merit: 1024
Mine at Jonny's Pool
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 03:46:35 PM |
|
New services are always welcome and yours seems a job pretty well done... But what could be the case uses for such a service? I think websites would probably need the wallet component of the Bitcoin Core client and not other API commands as much...
The use case would be to have a nicely packaged API library that you can just drop into your site without having to write it from scratch. Why pay some developer to write the interactions with your wallet, when you can just grab an open source library that already does it? ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif)
|
Jonny's Pool - Mine with us and help us grow! Support a pool that supports Bitcoin, not a hardware manufacturer's pockets! No SPV cheats. No empty blocks.
|
|
|
unamis76
Legendary
Offline
Activity: 1512
Merit: 1012
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 03:50:36 PM |
|
New services are always welcome and yours seems a job pretty well done... But what could be the case uses for such a service? I think websites would probably need the wallet component of the Bitcoin Core client and not other API commands as much...
Why pay some developer to write the interactions with your wallet, when you can just grab an open source library that already does it? ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) Yes... I guess that's right ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif)
|
|
|
|
windpath (OP)
Legendary
Offline
Activity: 1258
Merit: 1027
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 09, 2015, 03:52:58 PM |
|
New services are always welcome and yours seems a job pretty well done... But what could be the case uses for such a service? I think websites would probably need the wallet component of the Bitcoin Core client and not other API commands as much...
Agreed, actually most of the wallet functions are done and when the test-net version is live you will be able to play with them on the site. Also, this: Built for the average Joe to explore Bitcoin's core API and to serve as the foundation for PHP web applications to easily communicate with bitcoin core.
The API does handle sanitizing and validating all inputs, but as far as running the wallet functions on main-net: securing the API is currently not in the scope of the project, and a developer would need to create their own login system and security rules to keep it locked down.
|
|
|
|
|
shorena
Copper Member
Legendary
Offline
Activity: 1498
Merit: 1530
No I dont escrow anymore.
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 09, 2015, 08:12:42 PM |
|
I just tried to add the verifymessage of your site to my guide[1]. Since brainwallet is no longer operational and coinig[2] seems to be bugged when trying to verify message that have a linebreak. However your site seems to be affected by the same bug. I tried to verify the following two messages that verify just fine with bitcoin core 0.11. The first however does not verify. I added the return message directly below the message used. -----BEGIN BITCOIN SIGNED MESSAGE----- a line followed by a linebreak this is shorena from bitcointalk.org, today is 2015.08.09 and this is a test for chainquery.com -----BEGIN SIGNATURE----- 18uTXyQubfaYrkbQDdaXhzd2ALEY5YN77B IG5WyElz95PZmiW47KV12iQd5Xnu4SkrkxJTkdaaqa0vav4tdDCTg1kVyqJ58inkDMrdoDCLAkKi4cwTAhGZmQ0= -----END BITCOIN SIGNED MESSAGE-----
{ "result": false, "error": null, "id": null }
-----BEGIN BITCOIN SIGNED MESSAGE----- this is shorena from bitcointalk.org, today is 2015.08.09 and this is a another test for chainquery.com -----BEGIN SIGNATURE----- 18uTXyQubfaYrkbQDdaXhzd2ALEY5YN77B ID1SO2KVw8Tv6XowUkrtdQRhuB+sQVyi7jb549ZfZzpMMJ+9rRGx4ZvYyVgXsGPJe6Ds/3B5yYR70jtpJfLJ/gg= -----END BITCOIN SIGNED MESSAGE-----
{ "result": true, "error": null, "id": null }
[1] https://bitcointalk.org/index.php?topic=990345.0[2] https://bitcointalk.org/index.php?topic=990345.msg12097780#msg12097780
|
Im not really here, its just your imagination.
|
|
|
windpath (OP)
Legendary
Offline
Activity: 1258
Merit: 1027
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 09, 2015, 09:06:49 PM |
|
I just tried to add the verifymessage of your site to my guide[1]. Since brainwallet is no longer operational and coinig[2] seems to be bugged when trying to verify message that have a linebreak. However your site seems to be affected by the same bug. I tried to verify the following two messages that verify just fine with bitcoin core 0.11. The first however does not verify. I added the return message directly below the message used. -----BEGIN BITCOIN SIGNED MESSAGE----- a line followed by a linebreak this is shorena from bitcointalk.org, today is 2015.08.09 and this is a test for chainquery.com -----BEGIN SIGNATURE----- 18uTXyQubfaYrkbQDdaXhzd2ALEY5YN77B IG5WyElz95PZmiW47KV12iQd5Xnu4SkrkxJTkdaaqa0vav4tdDCTg1kVyqJ58inkDMrdoDCLAkKi4cwTAhGZmQ0= -----END BITCOIN SIGNED MESSAGE-----
{ "result": false, "error": null, "id": null }
-----BEGIN BITCOIN SIGNED MESSAGE----- this is shorena from bitcointalk.org, today is 2015.08.09 and this is a another test for chainquery.com -----BEGIN SIGNATURE----- 18uTXyQubfaYrkbQDdaXhzd2ALEY5YN77B ID1SO2KVw8Tv6XowUkrtdQRhuB+sQVyi7jb549ZfZzpMMJ+9rRGx4ZvYyVgXsGPJe6Ds/3B5yYR70jtpJfLJ/gg= -----END BITCOIN SIGNED MESSAGE-----
{ "result": true, "error": null, "id": null }
[1] https://bitcointalk.org/index.php?topic=990345.0[2] https://bitcointalk.org/index.php?topic=990345.msg12097780#msg12097780Interesting, I'll look into it on Monday, what OS are you running bitcoin core on? I'll have to dig into how core handles hard returns on various OS's and have the app mimic that.
|
|
|
|
shorena
Copper Member
Legendary
Offline
Activity: 1498
Merit: 1530
No I dont escrow anymore.
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 09, 2015, 09:26:31 PM |
|
-snip- Interesting, I'll look into it on Monday, what OS are you running bitcoin core on? I'll have to dig into how core handles hard returns on various OS's and have the app mimic that.
Thanks. Its Win7, but I can set it up on other systems if that helps you. Win 8.1 Pro and Ubuntu 14.04.2 would be the easiest as I already have VMs for those.
|
Im not really here, its just your imagination.
|
|
|
windpath (OP)
Legendary
Offline
Activity: 1258
Merit: 1027
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 09, 2015, 09:29:48 PM |
|
-snip- Interesting, I'll look into it on Monday, what OS are you running bitcoin core on? I'll have to dig into how core handles hard returns on various OS's and have the app mimic that.
Thanks. Its Win7, but I can set it up on other systems if that helps you. Win 8.1 Pro and Ubuntu 14.04.2 would be the easiest as I already have VMs for those. It may just be how HTTP post handles hard returns, I'll post back tomorrow after I've have a chance to dig around a little.
|
|
|
|
windpath (OP)
Legendary
Offline
Activity: 1258
Merit: 1027
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 11, 2015, 12:49:55 AM |
|
I just tried to add the verifymessage of your site to my guide[1]. Since brainwallet is no longer operational and coinig[2] seems to be bugged when trying to verify message that have a linebreak. However your site seems to be affected by the same bug. I tried to verify the following two messages that verify just fine with bitcoin core 0.11. The first however does not verify. I added the return message directly below the message used. -----BEGIN BITCOIN SIGNED MESSAGE----- a line followed by a linebreak this is shorena from bitcointalk.org, today is 2015.08.09 and this is a test for chainquery.com -----BEGIN SIGNATURE----- 18uTXyQubfaYrkbQDdaXhzd2ALEY5YN77B IG5WyElz95PZmiW47KV12iQd5Xnu4SkrkxJTkdaaqa0vav4tdDCTg1kVyqJ58inkDMrdoDCLAkKi4cwTAhGZmQ0= -----END BITCOIN SIGNED MESSAGE-----
Thanks again for the bug report, this was challenging as we want Chain Query to be platform independent when released (we are getting very close)... That means that not only do we have to support various platforms and browsers submitting the form, but also various platforms that bitcoind may be run on to process it. Typically this is not a huge deal, but as we are verifying a signed message, the message must match the signature exactly or the result will be false. There is really no standardization around end of line characters: \n is a linux/unix line break \r is a classic mac line break [OS X uses the above unix \n] \r\n is a windows line break
And that does not take into account how various browsers handle the post data. Surprisingly in PHP we were able to put together a rather elegant and efficient solution for OS independent end of line characters (after lots of trial and error): Pseudo code: $newLineChars = array("\r\n","\r","\n"); $fixedMessage = str_replace($newLineChars, PHP_EOL, $message);
The array of various new line characters looks for any variation of the newline and replaces it with the PHP_EOL constant in the signed $message. PHP_EOL is a constant holding the line break character(s) used by the platform the app and bitcoind are running on. This has been tested with your signed message (including the line break) browsing from OSx with Firefox, Chrome and Safari both in my dev environment, OSx, and on the beta server, Ubuntu 14.04, both with Bitcoin core 0.11.0. It should also work just fine on your windows machine (fingers crossed)... Again, thanks for the report and for considering Chain Query for your tutorial.
|
|
|
|
shorena
Copper Member
Legendary
Offline
Activity: 1498
Merit: 1530
No I dont escrow anymore.
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 11, 2015, 07:11:53 PM |
|
I just tried to add the verifymessage of your site to my guide[1]. Since brainwallet is no longer operational and coinig[2] seems to be bugged when trying to verify message that have a linebreak. However your site seems to be affected by the same bug. I tried to verify the following two messages that verify just fine with bitcoin core 0.11. The first however does not verify. I added the return message directly below the message used. -----BEGIN BITCOIN SIGNED MESSAGE----- a line followed by a linebreak this is shorena from bitcointalk.org, today is 2015.08.09 and this is a test for chainquery.com -----BEGIN SIGNATURE----- 18uTXyQubfaYrkbQDdaXhzd2ALEY5YN77B IG5WyElz95PZmiW47KV12iQd5Xnu4SkrkxJTkdaaqa0vav4tdDCTg1kVyqJ58inkDMrdoDCLAkKi4cwTAhGZmQ0= -----END BITCOIN SIGNED MESSAGE-----
Thanks again for the bug report, this was challenging as we want Chain Query to be platform independent when released (we are getting very close)... That means that not only do we have to support various platforms and browsers submitting the form, but also various platforms that bitcoind may be run on to process it. Typically this is not a huge deal, but as we are verifying a signed message, the message must match the signature exactly or the result will be false. There is really no standardization around end of line characters: \n is a linux/unix line break \r is a classic mac line break [OS X uses the above unix \n] \r\n is a windows line break
And that does not take into account how various browsers handle the post data. Surprisingly in PHP we were able to put together a rather elegant and efficient solution for OS independent end of line characters (after lots of trial and error): Pseudo code: $newLineChars = array("\r\n","\r","\n"); $fixedMessage = str_replace($newLineChars, PHP_EOL, $message);
The array of various new line characters looks for any variation of the newline and replaces it with the PHP_EOL constant in the signed $message. PHP_EOL is a constant holding the line break character(s) used by the platform the app and bitcoind are running on. This has been tested with your signed message (including the line break) browsing from OSx with Firefox, Chrome and Safari both in my dev environment, OSx, and on the beta server, Ubuntu 14.04, both with Bitcoin core 0.11.0. It should also work just fine on your windows machine (fingers crossed)... Again, thanks for the report and for considering Chain Query for your tutorial. Thanks for the fast solution, messages verify just fine on Win7 and Win8.1. I will add the site over the next days.
|
Im not really here, its just your imagination.
|
|
|
|