Bitcoin Forum
May 14, 2024, 07:25:57 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3]  All
  Print  
Author Topic: Command Line and JSON-RPC  (Read 34284 times)
galaxyAbstractor
Full Member
***
Offline Offline

Activity: 147
Merit: 100



View Profile WWW
June 27, 2011, 12:16:26 PM
 #41

Look at rpc.cpp for the list of commands.

Seriously?  So, everyone knows C++ but me?  I don't understand where this list of commands is in this file.  *sigh* I have tried to understand C++ for years, things just are not clicking in my head for some reason.  Do you mean this stuff?
Code:
        //
        // Special case non-string parameter types
        //
        if (strMethod == "setgenerate"            && n > 0) ConvertTo<bool>(params[0]);
        if (strMethod == "setgenerate"            && n > 1) ConvertTo<boost::int64_t>(params[1]);
        if (strMethod == "sendtoaddress"          && n > 1) ConvertTo<double>(params[1]);
        if (strMethod == "settxfee"               && n > 0) ConvertTo<double>(params[0]);
        if (strMethod == "getamountreceived"      && n > 1) ConvertTo<boost::int64_t>(params[1]); // deprecated
        if (strMethod == "getreceivedbyaddress"   && n > 1) ConvertTo<boost::int64_t>(params[1]);
        if (strMethod == "getreceivedbyaccount"   && n > 1) ConvertTo<boost::int64_t>(params[1]);
        if (strMethod == "getreceivedbylabel"     && n > 1) ConvertTo<boost::int64_t>(params[1]); // deprecated
        if (strMethod == "getallreceived"         && n > 0) ConvertTo<boost::int64_t>(params[0]); // deprecated
        if (strMethod == "getallreceived"         && n > 1) ConvertTo<bool>(params[1]);
        if (strMethod == "listreceivedbyaddress"  && n > 0) ConvertTo<boost::int64_t>(params[0]);
        if (strMethod == "listreceivedbyaddress"  && n > 1) ConvertTo<bool>(params[1]);
        if (strMethod == "listreceivedbyaccount"  && n > 0) ConvertTo<boost::int64_t>(params[0]);
        if (strMethod == "listreceivedbyaccount"  && n > 1) ConvertTo<bool>(params[1]);
        if (strMethod == "listreceivedbylabel"    && n > 0) ConvertTo<boost::int64_t>(params[0]); // deprecated
        if (strMethod == "listreceivedbylabel"    && n > 1) ConvertTo<bool>(params[1]); // deprecated
        if (strMethod == "getbalance"             && n > 1) ConvertTo<boost::int64_t>(params[1]);
        if (strMethod == "move"                   && n > 2) ConvertTo<double>(params[2]);
        if (strMethod == "move"                   && n > 3) ConvertTo<boost::int64_t>(params[3]);
        if (strMethod == "sendfrom"               && n > 2) ConvertTo<double>(params[2]);
        if (strMethod == "sendfrom"               && n > 3) ConvertTo<boost::int64_t>(params[3]);
        if (strMethod == "listtransactions"       && n > 1) ConvertTo<boost::int64_t>(params[1]);
        if (strMethod == "listtransactions"       && n > 2) ConvertTo<boost::int64_t>(params[2]);
        if (strMethod == "listaccounts"           && n > 0) ConvertTo<boost::int64_t>(params[0]);
        if (strMethod == "sendmany"               && n > 1)
        {
            string s = params[1].get_str();
            Value v;
            if (!read_string(s, v) || v.type() != obj_type)
                throw runtime_error("type mismatch");
            params[1] = v.get_obj();
        }
        if (strMethod == "sendmany"                && n > 2) ConvertTo<boost::int64_t>(params[2]);

Well, there are comments throughout, so that's good, I really get annoyed by spaghetti code.

Are you looking for this list? https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

1gaLaxy9csuBTvNLJYoUy6sengQbh1TpV
Pyramining - Invest in mining!
1715671557
Hero Member
*
Offline Offline

Posts: 1715671557

View Profile Personal Message (Offline)

Ignore
1715671557
Reply with quote  #2

1715671557
Report to moderator
Be very wary of relying on JavaScript for security on crypto sites. The site can change the JavaScript at any time unless you take unusual precautions, and browsers are not generally known for their airtight security.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
krepta3000
Member
**
Offline Offline

Activity: 92
Merit: 10


View Profile
June 29, 2011, 07:53:48 PM
 #42


Yay, thanks. Smiley  Now I just need to figure out how to dump my broken wallet, and import only the good stuff into a new wallet.  Grrr!
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
June 29, 2011, 11:12:38 PM
 #43

bitcointools has a fixwallet.py that can often fix broken wallet.dat files.
  https://github.com/gavinandresen/bitcointools/

How often do you get the chance to work on a potentially world-changing project?
krepta3000
Member
**
Offline Offline

Activity: 92
Merit: 10


View Profile
June 30, 2011, 06:29:31 PM
Last edit: June 30, 2011, 07:31:20 PM by krepta3000
 #44

bitcointools has a fixwallet.py that can often fix broken wallet.dat files.
  https://github.com/gavinandresen/bitcointools/


If that works, I'll be very very happy, OMG!!  You're the best Gavin. Smiley

I finally managed to figure out how to run it, and then it spouted an error I don't understand.  Here is the text:

Code:
C:\Program Files\Bitcoin\bitcointools>fixwallet.py --datadir=m:\bitcoin --out=walletFixed.dat
Unknown key type: bestblock

Well, it didn't fix the wallet the way I wanted it to, it still had the hung transactions on it.  I want to Remove those hung transactions, and fix whatever caused them, Or fix whatever is causing it so that they will stop being hung. 
joan
Jr. Member
*
Offline Offline

Activity: 56
Merit: 1



View Profile
June 30, 2011, 10:21:26 PM
Last edit: June 30, 2011, 10:38:36 PM by joan
 #45

Unknown key type: bestblock
This error is not related to your problem. It's just that the wallet contain a new type of data that the bitcointools is not aware of. (namely, the most recent block that this wallet was synchronized with)

Do you have a thread where you describe the scenario that led to hung transactions ?
edit: I assume this is the one. My advice would be to wait a bit for the import/export private keys feature to be formally released in an official version. Then you can dump your keys to a text file and import back the relevant ones to a fresh wallet.
krepta3000
Member
**
Offline Offline

Activity: 92
Merit: 10


View Profile
July 01, 2011, 06:53:33 AM
 #46

Unknown key type: bestblock
This error is not related to your problem. It's just that the wallet contain a new type of data that the bitcointools is not aware of. (namely, the most recent block that this wallet was synchronized with)

Do you have a thread where you describe the scenario that led to hung transactions ?
edit: I assume this is the one. My advice would be to wait a bit for the import/export private keys feature to be formally released in an official version. Then you can dump your keys to a text file and import back the relevant ones to a fresh wallet.

Yup, that's the one, and yes, those are the features I need.  I found the github branch with a download of stuff that supposedly patches those RPC commands into bitcoin, but, after extracting it nothing was installed or patched, and I don't know what to do.  I want to dump my wallet, and only have the stuff I want, not the hung or damaged stuff, and then import the good stuff into a new wallet, a fresh start.  Please please please, someone put it into the main branch so it gets included in the next official release!
Pages: « 1 2 [3]  All
  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!