Hello. So you are back. Well that is nice. If you are new. Please check the first part here
Well now that we have got that out of the way.
Today we will begin where we left off. The last time we got the global properties from the blockchain. This time we will first see how to get one block from the chain and analyze what the data means.
Step 1
open postman. Well that was simple. Go on, pat yourself on the back. Have a snack.
Step 2
Make the global properties request again. We will use the last_irreversible_block_num from it. You can also use the head_block_num if you wish to. The names are self explanatory.
Request result
Helpful tip: you can save your requests in the cloud using postman by making a free account, or by just saving them to your disk. Just press CTR+S in windows. I think it should be the same in other operating systems. Make a request folder in the prompt , add a name and keep saving all your requests. You will not lose your work.
Step 3
Now we will make the request body.
This time the method name will be call.
The params field will not be blank. Duh. We have to send the block number.
A quick explanation of an object and an array.
An object is donated by
{
"hispeedimagins":"smart"
}
hehe, just as before. An object begins and closes with curly brackets. We can supply names. The left hand side is the name, the right is the value.
An array starts and ends with square brackets.
[
"hispeedimagins","smart"
]
You only supply values in an array. Separate them with commas . In this "hispeedimagins" and "smart" are both values.
This will all come in useful later on.
For our field params we will supply and array, and inside of that another array.
["database_api","get_block",["20557408"]]
The first value is the function to call within the method. The second is the sub function. The third is the value. Our irreversible block number, we got from before.
The full request body is this.
{
"id":"40",
"jsonrpc":"2.0",
"method":"call",
"params":["database_api","get_block",["20557408"]]
}
Result is
A small explanation of the result is in order.
- Number 4 is the last block id. It is a block chain.
Number 6 is the witness who processed it. It is @aggroed. This was totally coincidental. Yay.
If you have not voted for witnesses, please go ahead and do it now. Let us not elect idiots like we have IRL.
Number 10 is an array of transactions held by this block. Did you think each transaction gets its own block? What are you, the queen of England?
Numbers 12 and 13 refer to previous block id's and numbers. We will learn how to calculate them later. Relax you did not miss anything. The are important because they refer to previous blocks, so if a fork happens the transactions are not repeated.
Number 15 is an array of operations. Yes you can send multiple operations in a single transaction. This one is for a vote.
The permlink is what comes at the end of the url. It is made from the title of the post. Write funny titles so devs can laugh when they are banging their heads when something is not working.Number 22 is the weight field. This is the vote percent. Yes it is 3300, your eyes are not that weak, or you are not that drunk. Regardless eat your green vegetables and drink less.
The weight seen by the blockchain ranges from 1 to 10000. So the percentage of this vote is 3300/10000 * 100. Which is 33%.
Give your 100% vote here, full 10000. hehehhe.
the signatures field is calculated, which we will cover after sometime.
Did you read the whole thing. Congratulations. You are a nerd. Or have no life. Or possibly both , like me. Yay.
Have any questions? Well don't keep them to yourself. You are reading a tutorial . Ask them in the comments.
Have a good day. or night.
Sneaky Ninja Attack! You have just been defended with a 11.35% upvote!
I was summoned by hispeedimagins. I have done their bidding and now I will vanish…
woosh
P.S. If you or anyone you know has been a victim of @grumpycat please know that he has been harming people throughout Sōsharumedia (ソーシャルメディア). Stealing the service that I (and other bots) have provided them and hiding behind a facade of stopping bid bot abuse which he clearly has no interest in.
Sneaky Ninja is a very responsible bot, working directly with steemcleaners, actively pursuing spam and abuse on our platform. If you would like to see what steps Sneaky Ninja has taken to fight bid bot abuse see this post and this post. Also know that I am working daily on other solutions.
If you would like to know my personal take on bid bot abuse and why I do not agree with the 3.5 day rule, see this post
Grumpycat is a villain that must be stopped to protect our freedoms here on steemit!
There is a resistance that has formed to counter his tyranny.
If you would like to take an active role in stopping this menace and helping other victims like yourself...
Learn More Here
I have also summoned my love, Kusari to offer some limited help to victims like you.
See Here
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit