Bitcoin Forum
June 27, 2024, 02:09:33 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: rpc.blockchain.info help rpc calls  (Read 1107 times)
dan123 (OP)
Jr. Member
*
Offline Offline

Activity: 55
Merit: 1


View Profile WWW
May 23, 2014, 11:10:53 PM
 #1

I just wanna do a get info

sorry this is c# wrapper, but
                        string host = "rpc.blockchain.info";
                        string port = "443";
                        string user = "xxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx";
                        string pwd = "myPasswordForBlockChain";

                    BitnetClient bc = new BitnetClient("https://" + host + ":" + port);
                    bc.Credentials = new NetworkCredential(user, pwd);
                    var jj = bc.GetInfo();

This is with the wrapper suggested, I also tried it without the wrapper and my own web request and it failed.

this is the response i get back:
{"error":{"message":"JSON-RPC method [getinfo] with 0 parameters not found.","code":-32601},"jsonrpc":"2.0"}

I really just want to use the verifymessage call, but I couldn't find a public API that did this.
And I don't want to run bitcoinqt or whatever on my machine.
Dare
Hero Member
*****
Offline Offline

Activity: 508
Merit: 500


Techwolf on #bitcoin and Reddit


View Profile WWW
May 23, 2014, 11:20:26 PM
 #2

I just wanna do a get info

sorry this is c# wrapper, but
                        string host = "rpc.blockchain.info";
                        string port = "443";
                        string user = "xxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx";
                        string pwd = "myPasswordForBlockChain";

                    BitnetClient bc = new BitnetClient("https://" + host + ":" + port);
                    bc.Credentials = new NetworkCredential(user, pwd);
                    var jj = bc.GetInfo();

This is with the wrapper suggested, I also tried it without the wrapper and my own web request and it failed.

this is the response i get back:
{"error":{"message":"JSON-RPC method [getinfo] with 0 parameters not found.","code":-32601},"jsonrpc":"2.0"}

I really just want to use the verifymessage call, but I couldn't find a public API that did this.
And I don't want to run bitcoinqt or whatever on my machine.

Have you tried the getinfo command from a bitcoind instance to make sure it isn't an issue with your wrapper?

From blockchain.info's RPC API documentation:
Quote
$ ./bitcoind -rpcconnect=rpc.blockchain.info -rpcport=443 -rpcssl -rpcuser=YourWalletIdentifier -rpcpassword=YourPassword getinfo

BTC: 1M8oUcBnkRDEhWWgV8ZXLTB6p1mgnejVbX
How Forum Activity Works
Bitcointalk Forum Rules
|
|
|
Firstbits (lucky vanitygen): 1WoLfRUGDx1
How Forum Trust Works
Bitcoin Source Code
dan123 (OP)
Jr. Member
*
Offline Offline

Activity: 55
Merit: 1


View Profile WWW
May 24, 2014, 04:30:15 AM
 #3

Ok, that worked in dos, but I think where i'm getting confused is do I have to run bitcoind on my computer?
I thought this would be like a webapi call, not needing my computer.

Basically I want to verify a message using the verifymessage command.  But I want to do this in javascript in a web api call.  But this isn't a webapi call I guess? I'm guess that I'll need to run this on command line.

I've been using blockchain's api, but they don't have verifymessage in the web api commands.  Are there any free apis that have this?
Dare
Hero Member
*****
Offline Offline

Activity: 508
Merit: 500


Techwolf on #bitcoin and Reddit


View Profile WWW
May 25, 2014, 01:56:19 AM
 #4

You don't need bitcoind for blocchain.info's RPC API, that was just to verify that everything (aside from your code) works. Something about the wrapper or the way you're performing the web request is causing your problem.

Their API does support the "verifymessage" command, scroll down to the bottom of the documentation page for the info:
Quote

    Method: verifymessage
    Parameters: (String bitcoinaddress, String signature, String message)
    Description: Verifies the signature and message matches the bitcoin address provided (See signmessage)
    Returns: Boolean


Also, you may want to take a look at this thread for verifying messages offline (without bitcoind), with libraries for several different languages: https://bitcointalk.org/index.php?topic=222992.0

BTC: 1M8oUcBnkRDEhWWgV8ZXLTB6p1mgnejVbX
How Forum Activity Works
Bitcointalk Forum Rules
|
|
|
Firstbits (lucky vanitygen): 1WoLfRUGDx1
How Forum Trust Works
Bitcoin Source Code
dan123 (OP)
Jr. Member
*
Offline Offline

Activity: 55
Merit: 1


View Profile WWW
May 25, 2014, 03:54:57 AM
 #5

You don't need bitcoind for blocchain.info's RPC API, that was just to verify that everything (aside from your code) works. Something about the wrapper or the way you're performing the web request is causing your problem.

Their API does support the "verifymessage" command, scroll down to the bottom of the documentation page for the info:
Quote

    Method: verifymessage
    Parameters: (String bitcoinaddress, String signature, String message)
    Description: Verifies the signature and message matches the bitcoin address provided (See signmessage)
    Returns: Boolean


Also, you may want to take a look at this thread for verifying messages offline (without bitcoind), with libraries for several different languages: https://bitcointalk.org/index.php?topic=222992.0

Thanks, but there's a difference between blockchain's rpc API and regular api
var json = client.DownloadString("http://blockchain.info/address/" + address + "?format=json");
That one always works


Dare
Hero Member
*****
Offline Offline

Activity: 508
Merit: 500


Techwolf on #bitcoin and Reddit


View Profile WWW
May 25, 2014, 04:53:37 AM
 #6

The regular API is simpler than the RPC API, but it only allows you to download blockchain data in a different format. Verifying a message is a bit more complicated and requires input (the message and signature), so it isn't available in that API. I suspect that there's an issue with the way you integrated the C# wrapper (which is for RPC), and I don't think the RPC API is accessible via web at all, though I may be mistaken on that count.

From looking at the documentation for Bitnet (which seems a bit old, using RPC version 1.0, though I may not have found the right one), I'm not sure it supports SSL, or the verifymessage command. Have you tried using "http://" and port 80 to see if it works without SSL?

BTC: 1M8oUcBnkRDEhWWgV8ZXLTB6p1mgnejVbX
How Forum Activity Works
Bitcointalk Forum Rules
|
|
|
Firstbits (lucky vanitygen): 1WoLfRUGDx1
How Forum Trust Works
Bitcoin Source Code
dan123 (OP)
Jr. Member
*
Offline Offline

Activity: 55
Merit: 1


View Profile WWW
May 26, 2014, 04:35:20 PM
 #7

The regular API is simpler than the RPC API, but it only allows you to download blockchain data in a different format. Verifying a message is a bit more complicated and requires input (the message and signature), so it isn't available in that API. I suspect that there's an issue with the way you integrated the C# wrapper (which is for RPC), and I don't think the RPC API is accessible via web at all, though I may be mistaken on that count.

From looking at the documentation for Bitnet (which seems a bit old, using RPC version 1.0, though I may not have found the right one), I'm not sure it supports SSL, or the verifymessage command. Have you tried using "http://" and port 80 to see if it works without SSL?

Well I'm trying to do this all online, not running bitcoind on my computer, and I think that's where the problem is.  I've also tried it without bitnet.

If I have to do it running bitcoind on my computer, then I'll have to approach things differently (which is fine).
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!