Bitcoin Forum
November 09, 2024, 03:29:12 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoind tx management - need help with json-rpc  (Read 1353 times)
kstepyra (OP)
Newbie
*
Offline Offline

Activity: 52
Merit: 0


View Profile
February 17, 2012, 10:58:29 PM
 #1

Hi,

I am building my own web app capable of bitcoin funds management throught Bitcoind json-rpc communication, and i meet some problems with possibilities of functions.
All i can do now is creating new addresses by getnewaddress function, which returns me new address for [user] specified parameter. Thats cool.

However problems persist in: transactions handling:

1. i can't see anywhere TxIn's and TxOuts in any of these functions, and showing addresses from/to will be nice for users instead of "Last payments received for addr XYZ -> 1. FROM Huh TO XYZ". How i should handle transactions properly to let users see all information about them - from/to addresses and amounts?
2. gettransaction returns only info about tx for addresses that i own in wallet.. why?? getblock lets me receive all blocks but can't get every single transaction?

So how is blockchain.info or blockexplorer.com functioning without these possibilities? they made own parser for file where block chain is stored or is here other app allowing me to get that info?

I will really appreciate any info because i need to build my app soon.
koin
Legendary
*
Offline Offline

Activity: 873
Merit: 1000


View Profile
February 17, 2012, 11:12:47 PM
 #2

perhaps what you are trying to figure out can be learned from abe?   http://bitcointalk.org/index.php?topic=22785.0;all
kstepyra (OP)
Newbie
*
Offline Offline

Activity: 52
Merit: 0


View Profile
February 18, 2012, 03:25:48 AM
 #3

ty honestly for reply, you saved my life : o  that was that thing i was looking for!
libcoin
Newbie
*
Offline Offline

Activity: 26
Merit: 24



View Profile WWW
February 20, 2012, 08:35:24 AM
 #4

I can also recommend you have a look at libcoin: https://github.com/ceptacle/libcoin/wiki

libcoin is a radical refactoring of bitcoin, turning all the basic stuff into a chain agnostic library. All the global variables are gone and so is the untraditional multithreading stuff and the strong coupling to a specific chain (aka bitcoin). It is highly modular, and you can easily build extensions - like e.g. run with two wallets.

libcoin comes with two applications:
* bitcoind - which is a 100% bitcoind compatible clone - just based on libcoin - it can be up to 3.5 times faster in initial chain download and is much faster and reliable when it comes to serving RPC.
* coinexplorer - a block explorer running on your machine - this enables you to query transactions that are not in you wallet, and to query addresses and see their entire history - just like blockexplorer.org.

There are also a handful of examples e.g. the simple client - write a full bitcoin client in 20 lines of code - see below.

I should note that libcoin is production quality software - I have heavily loaded servers running rock stable for weeks.

Cheers,

Michael

int main(int argc, char* argv[])
{   
    Node node; // deafult chain is bitcoin
   
    Wallet wallet(node); // add the wallet
   
    thread nodeThread(&Node::run, &node); // run this as a background thread
   
    Server server;
   
    // Register Server methods.
    server.registerMethod(method_ptr(new Stop(server)));
   
    // Register Node methods.
    server.registerMethod(method_ptr(new GetBlockCount(node)));
    server.registerMethod(method_ptr(new GetConnectionCount(node)));
    server.registerMethod(method_ptr(new GetDifficulty(node)));
    server.registerMethod(method_ptr(new GetInfo(node)));
   
    // Register Wallet methods. - note that we don't have any auth, so anyone (on localhost) can read your balance!
    server.registerMethod(method_ptr(new GetBalance(wallet)));
    server.registerMethod(method_ptr(new SendToAddress(wallet)), Auth("username","password"));

    server.run();

    node.shutdown();
    nodeThread.join();
}
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!