Hello steemians,
Here is my homework for SLC22 Week 1, with the corresponding tasks assigned by @alejos7ven!
What is your understanding about RPC Nodes?
My understanding is that RPC nodes, which stand for Remote Procedure Call Contracts, are basic interfaces that allow developers to interact with the Steem blockchain remotely. These nodes act as primary access points to the network, providing an organized way to perform specific functions without the node’s infrastructure needing to be managed by developers.
As for reading data, RPC nodes provide access to various and detailed information, such as account balances, transaction records, block details, publications or even votes recorded on the network, as for sending transactions, it allows developers to modify data on the blockchain by performing actions such as publishing content, transferring funds or voting on posts and comments.
Each RPC node is made up of a set of plugins that define the functionality available to developers, and the "condenser_api" plugin is among the most used, as it contains many common methods used to interact with the Steem network, whether To retrieve information or write new data, these nodes are often managed by witnesses, who act as validators on the network, or by other trusted parties such as Steemit Inc. For example, one of the RPC nodes The most popular ones available is provided by Steemit Inc via "https://api.steemit.com", a public interface that allows developers to send HTTP POST requests using JSON formatted data, however, this address does not is not a traditional website, but rather a dedicated interface for communicating with the Steem blockchain.
Therefore, I understand that RPC nodes are of fundamental importance in the accessibility of the Steem blockchain for developers, since they provide an efficient, integrated and reliable method for interacting with this technology, whether by reading precise information or executing complex transactions, while allowing smooth and adaptable integration into a variety of development environments, without requiring the establishment of heavy or complicated technical infrastructure.
Explore the Steem Developers Portal (https://developers.steem.io) and fetch data using JavaScript or Python from at least 3 methods of condenser_api plugin (Don't use get_block method)
To interact with the Steem API and retrieve information, I was able to explore the Steem developer portal and retrieve useful and diverse data, the three methods, get_accounts
, get_dynamic_global_properties
, and get_discussions_by_created
, helped me allows you to efficiently interact with the blockchain, view information about a specific account, monitor overall network properties, and review the most recent discussions.
This method allows you to retrieve detailed information about a specific account on the Steem blockchain. In this example, I used my account name kouba01.
This method provides global information about the current state of the blockchain. This information includes:
This is a useful method for monitoring the health and activity of the blockchain.
This method lists the recently created posts on the Steem blockchain. It takes as parameter an object containing options, such as limit, which specifies the number of posts to retrieve.
Get the information of a random block between 1,000,000 and 1,500,000 and write a program that shows who created that block and the date it was created.
This program uses the Node.js fetch
library to interact with the Steem API via the condenser_api
plugin. The main customApi
function allows you to send HTTP POST requests to the Steem API by taking as parameters the address of the RPC node, the name of the method called and the parameters needed for this method. In this case, the method used is condenser_api.get_block
, which retrieves the information of a given block.
A random block is generated in the specified range using the mathematical formula Math.floor(Math.random() * (1500000 - 1000000 + 1)) + 1000000
, thus ensuring that each execution of the program queries a different block.
When executed, the program displays a message such as:
Best Regards,
@kouba01