Bitcoin Forum
October 23, 2017, 07:31:43 PM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: ppcoind: get non wallet transaction  (Read 1018 times)
crazydownloaded
Full Member
***
Offline Offline

Activity: 148

Crazy!


View Profile WWW
May 24, 2013, 07:03:36 PM
 #1

Hello,

I'm looking to retrieve non wallet transactions using the "official" ppcoind client (retrieved from the git repository and compiled under linux x64).
The daemon is running with "-txindex=1".
Using the bitcoind client, I do a "getrawtransaction" and then "decoderawtransaction" to get the details of any transaction. The problem is:

$ ./ppcoind getrawtransaction 26e04d500704b0e2f0aad363a2136c335eba3dc6701a3515a3afdb8219248f0a
error: {"code":-32601,"message":"Method not found"}

$ ./ppcoind gettransaction 26e04d500704b0e2f0aad363a2136c335eba3dc6701a3515a3afdb8219248f0a
error: {"code":-5,"message":"Invalid or non-wallet transaction id"}



Any idea?

Thanks.

PS : I'm not sure if I should post this question to "Alternate cryptocurrencies" or to "Development & Technical Discussion", sorry if I posted to the wrong place.

1508787103
Hero Member
*
Offline Offline

Posts: 1508787103

View Profile Personal Message (Offline)

Ignore
1508787103
Reply with quote  #2

1508787103
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1508787103
Hero Member
*
Offline Offline

Posts: 1508787103

View Profile Personal Message (Offline)

Ignore
1508787103
Reply with quote  #2

1508787103
Report to moderator
1508787103
Hero Member
*
Offline Offline

Posts: 1508787103

View Profile Personal Message (Offline)

Ignore
1508787103
Reply with quote  #2

1508787103
Report to moderator
1508787103
Hero Member
*
Offline Offline

Posts: 1508787103

View Profile Personal Message (Offline)

Ignore
1508787103
Reply with quote  #2

1508787103
Report to moderator
Sunny King
Legendary
*
Offline Offline

Activity: 1203



View Profile WWW
May 24, 2013, 07:50:10 PM
 #2

It is not yet available with ppcoind as it is a new feature on bitcoind. But depending on your need there is a possible workaround if you know the block that carries the transaction, by using 'getblock' with the transaction detail option.

To find out which block contains a specific transaction with ppcoind, this is what I did, by dumping all the blocks in a loop then search for the transaction id:

dump-block.sh (change the max block number to whatever is current)
Code:
#!/bin/bash
for i in {1..49595}
do
  ppcoind getblockhash $i |xargs ppcoind getblock
done
crazydownloaded
Full Member
***
Offline Offline

Activity: 148

Crazy!


View Profile WWW
May 24, 2013, 09:09:59 PM
 #3

Hello Sunny,

Thanks for your answer.
I could potentially work with this workaround, but the transactions details is a total mess (each transaction doesn't even have it's own json object!).
I can't work with that mess, so I guess I won't include PPCoin in my tool... until they release a corrected version of their ppcoind.

$ ./ppcoind getblock 0000000000001624a94a468596e7355574ca832264300e38424d3266511801b9 true
{
    "hash" : "0000000000001624a94a468596e7355574ca832264300e38424d3266511801b9",
    "size" : 496,
    "height" : 49605,
    "version" : 1,
    "merkleroot" : "3c03b93d7b24ff0ae2b52952c683d43aa123c3d2bd9bdbab35cd2e41bc9824a9",
    "time" : "2013-05-24 21:01:19 UTC",
    "nonce" : 2502574474,
    "bits" : "1a2f6f7c",
    "difficulty" : 353679.52289229,
    "mint" : 410.01000000,
    "previousblockhash" : "639e9fff2bdd5c036318e369e70eafb73a5dca9f311f20ed5f3a01e7afd1a702",
    "nextblockhash" : "0000000000001a65680c2648f64e7f807cb4e86c0de8b4b57e2ebbf8f8fae7de",
    "flags" : "proof-of-work",
    "proofhash" : "0000000000001624a94a468596e7355574ca832264300e38424d3266511801b9",
    "entropybit" : 1,
    "modifier" : "d3d1e63bf9843c01",
    "modifierchecksum" : "10f268d2",
    "tx" : [
        "c40821d560b64ca0ed0a622f6e5bfad6021c064973ea94ca750bc9c3fe590d72 base",
        "2013-05-24 20:57:29 UTC",
        " 0000000000000000000000000000000000000000000000000000000000000000 -1",
        " out 410.01 02419fd519 OP_CHECKSIG",
        "a216a8c557e3840aaf4188c1326a8cdac28b4c63157f2dd57c92831de35af757 user",
        "2013-05-24 20:57:27 UTC",
        " 035090054f6de306dfc9a7d943d35defeb30043d607432675f6749108aeec163 0",
        " out 1962.050253 OP_DUP OP_HASH160 af3a2cd6fd OP_EQUALVERIFY OP_CHECKSIG",
        " out 51.316226 OP_DUP OP_HASH160 c1b0f3235e OP_EQUALVERIFY OP_CHECKSIG"
    ]

}

CoinHeavy
Full Member
***
Offline Offline

Activity: 214


View Profile
June 01, 2014, 08:42:43 AM
 #4

Is there still no way to get transaction details for non-wallet transactions via ppcoind?

I am at a crossroads similar to crazydownloaded's situation a year ago.  I would very much like to include peercoin in multiple ongoing projects but I'm having trouble getting transactional data from the daemon.

There is no getrawtransaction call and gettransaction only returns information for in-wallet transactions, even with txindex=1 in .conf and the index properly built.

Is anyone maintaining the peercoin code and if so, is a pull of the getrawtransaction code on the roadmap?

Also, how might current peercoin block explorers be parsing general transaction data?
kactech
Jr. Member
*
Offline Offline

Activity: 52


View Profile
June 02, 2014, 12:16:23 PM
 #5

Is there still no way to get transaction details for non-wallet transactions via ppcoind?

I am at a crossroads similar to crazydownloaded's situation a year ago.  I would very much like to include peercoin in multiple ongoing projects but I'm having trouble getting transactional data from the daemon.

There is no getrawtransaction call and gettransaction only returns information for in-wallet transactions, even with txindex=1 in .conf and the index properly built.

Is anyone maintaining the peercoin code and if so, is a pull of the getrawtransaction code on the roadmap?

Also, how might current peercoin block explorers be parsing general transaction data?


https://bitcointalk.org/index.php?topic=634568.msg7088485#msg7088485
crazydownloaded
Full Member
***
Offline Offline

Activity: 148

Crazy!


View Profile WWW
June 02, 2014, 03:11:19 PM
 #6

Oh this will be great!
I tried this on the latest master, I thought it could work:

./ppcoind getblock d82e9cfea1e6f76d9f314dd2196d9d9dcc8c78663e43865cf48db2e8ad73d8ea
{
    "hash" : "d82e9cfea1e6f76d9f314dd2196d9d9dcc8c78663e43865cf48db2e8ad73d8ea",
    "size" : 1401,
    "height" : 103293,
    "version" : 1,
    "merkleroot" : "2f80469e3d719f06d887ad2727b526287fd9212c93fb643aff76df57065bd0b6",
    "time" : "2014-03-25 16:59:50 UTC",
    "nonce" : 0,
    "bits" : "1c17ac9d",
    "difficulty" : 10.81326212,
    "mint" : 0.42000000,
    "previousblockhash" : "3560e432e99889a8074be488e0b2a74718ffd4afd2d429180689f560cb52971f",
    "nextblockhash" : "71c1c4fc50177516b7232ebb189affd3c5150fce125cdec93d9d8de70cb6d8b3",
    "flags" : "proof-of-stake",
    "proofhash" : "0000021b5d4edb39c69fa00be63b58015d9e37d6c37bb90e3c1ae04ab531c2b5",
    "entropybit" : 0,
    "modifier" : "1169f09dbc6235c6",
    "modifierchecksum" : "228e886b",
    "tx" : [
        "254151c6b0def14948e6c68a0f7f8c461a8cd4fba60e47d84d1d497d7161cd15",
        "d08c7222de6d63bd10409df8cf20b85776eca6c47fdba615541308e2e9edf753",
        "c30ac1d94d0101d97ca0f5d4df8fa8343ff512f2c03bdb91ff98f32fc65ddeca",
        "358821fdfc2a3b7084f2a9993744ae43240465eaaed953b545a5494023b5d63c",
        "affe4571a64b852b97bd1839c95c89bcf36c923010ca626fe41f1c85c9f60079"
    ]
}


./ppcoind gettransaction 358821fdfc2a3b7084f2a9993744ae43240465eaaed953b545a5494023b5d63c
error: {"code":-5,"message":"Invalid or non-wallet transaction id"}


(the daemon is started with -txindex=1 -daemon -server)

Let's wait for the next update, but this is a good move Smiley

kactech
Jr. Member
*
Offline Offline

Activity: 52


View Profile
June 02, 2014, 10:15:45 PM
 #7

crazydownloaded please check previous post, glv created a patch for Peerunity(Peercoin client - community version) with getrawtransaction support.
crazydownloaded
Full Member
***
Offline Offline

Activity: 148

Crazy!


View Profile WWW
June 02, 2014, 11:06:07 PM
 #8

crazydownloaded please check previous post, glv created a patch for Peerunity(Peercoin client - community version) with getrawtransaction support.

Yes but it's not in master yet, that's just what I was saying. Sorry for the confusion.
./ppcoind getrawtransaction 358821fdfc2a3b7084f2a9993744ae43240465eaaed953b545a5494023b5d63c
error: {"code":-32601,"message":"Method not found"}


(In my previous message I was already aware of this, but I thought maybe gettransaction was working with the current master for non wallet tx, which would have allowed me to add PPC to Coinplorer -- but it's not working)

kactech
Jr. Member
*
Offline Offline

Activity: 52


View Profile
June 03, 2014, 12:00:20 AM
 #9

Today we have Peerunity 0.1.0 release
https://www.peercointalk.org/index.php?topic=2902
https://github.com/Peerunity/Peerunity/releases/tag/v0.1.0

Unfortunately getrawtransaction was moved to 0.2, tests and release can take 1-2 months for sure
I don't know what are your security requirements but I use glv patch, daemon run stable, I mint on it too - coins still there
crazydownloaded
Full Member
***
Offline Offline

Activity: 148

Crazy!


View Profile WWW
June 03, 2014, 12:10:37 AM
 #10

Today we have Peerunity 0.1.0 release
https://www.peercointalk.org/index.php?topic=2902
https://github.com/Peerunity/Peerunity/releases/tag/v0.1.0

Unfortunately getrawtransaction was moved to 0.2, tests and release can take 1-2 months for sure
I don't know what are your security requirements but I use glv patch, daemon run stable, I mint on it too - coins still there
OK you win Smiley I'll make an exception for PPC. I don't really care about losing coins because I don't have any on my currencies servers, it's just easier for maintainability (you can't deal with 35 coins the same way you do with 1 or 2, things needs to be automated...).

So be prepared to have PPC on https://coinplorer.com very soon if everything works Smiley

crazydownloaded
Full Member
***
Offline Offline

Activity: 148

Crazy!


View Profile WWW
June 03, 2014, 12:15:41 AM
 #11

"time" : "2012-10-11 17:59:16 UTC",
damn, can't they return a timestamp like everybody else?!

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!