infrablockchain-js
Account Info
1.) Create a new folder on your computer, I will name mine infrajs-tutorial
.
2.) Navigate into the infrajs-tutorial
folder and initialize the npm project with npm init
. You can enter your information, or simply just press enter for each step. Once done, you should see a package.json
file within the folder
3.) Inside of this folder install eosjs and node-fetch by entering npm install infrablockchain-js node-fetch
. Node-fetch will give us the ability to execute HTTP requests from within our script.
4.) Create the entrypoint file for the project either through the command line or by doing it through your IDE / text editor. The file's name should be getAccount.js
5.) Inside of getAccount.js
insert the following code:
Notes have been included in the file explaining how the code works. The script imports two libraries, fetch
and infrablockchain-js
, sets an InfraBlockchain-Antelope network endpoint, defined a getAccount
routine that takes an account name as an input and executes the get_account
procedure on the endpoint.
6.) Go ahead and run the script from the terminal with the node getAccount.js
command. The result in your terminal should look something like the following (note that captaincrypt
is my account name:
Congratulations, we have proven that your account has been registered by the network. If your results don't look anything like the above then make sure you have already gone through the account activation process, and that the endpoint you used is really online.
Now that we've established that our account is activated, it's time for us to take a closer look into transactions.
Transaction Info
Much the same as our RPC method for getting account info, there also exists an endpoint for getting information about transactions.
Last updated