Get Forged Blocks JSON
-
Hi guys!
I'm trying to construct a simple web request to get the forged blocks for an account. I understand the basic syntax and what not, just not how to construct this particular request. For example:
https://wallet.burst-team.us:8125/burst?requestType=getAccount&account=BURST-KCV3-49WG-ZD2B-A2FHS
Returns JSON with info on my account. That's great, but I want to return the last forged block instead (and when it was forged).
I see the getBlocks method in the API, but I'm not sure how to get the correct parms because it wants firstIndex, lastIndex, etc.
Essentially, I want to get the forged block info shown here in a JSON format: http://burstcoin.biz/address/13668371040637458609
-
Take this:
https://wallet.burst-team.us:8125/burst?requestType=getAccountBlocks&account=BURST-KCV3-49WG-ZD2B-A2FHS
then take blockReward and height, for request you only need the RS/ID.
-
Thanks @MrWho! Wow, I was so close it could've bit me. :)
-
@MrWho One more question. :) I run the following to get my last forged block:
https://wallet.burst-team.us:8125/burst?requestType=getAccountBlocks&account=BURST-KCV3-49WG-ZD2B-A2FHS&lastIndex=0It gives me a timestamp value of 83879302, which is apparently the number of seconds since the genesis block... is there an easy way to turn that timestamp into a human readable time in say... ISO8601 format? I suppose the timestamp for the genesis block is 0, so how do I determine when mine was forged?
-
https://nxtwiki.org/wiki/The_Nxt_API#Get_Block According to this, timestamp (N) is the timestamp (in seconds since the genesis block) of the block. That's great, but that means it's impossible to get a real-world time value from the blockchain?
https://en.bitcoin.it/wiki/Block_timestamp According to this, it is a Unix time timestamp. Well, I can tell you it's not that.
-
@sevencardz http://localhost:8125/burst?requestType=getTime will give you the current time in that format - you can then calculate any other time as an offset from that.
-
Ahh OK, so I can then use the current time and subtract from that. Thanks @haitch!
