Query the ledger
In this guide, you will learn how to query an Ethereum-based ledger using the MARCO Explorer plugin.
Prerequisites
To complete this guide, you need to have our Postman collection set up.
Configure the environment
To configure your Postman environment to query the Ethereum-based ledger, follow these steps:
Choose a ledger you want to get information from the DLTs list and copy its explorer URL. In this guide, we will use Finboot's Ethereum network explorer
https://api-marco.finboot.com/resource-proxy/PLG-e336dc31463
.noteExplorers are not included in the Core API. Instead, they are distributed as plugins because each ledger has its own implementation published at a unique URL. Nevertheless, all explorers adhere to the same API contract, meaning that you can use the same code to query different ledgers.
In Postman, open the Environment tab and choose MARCO Environment.
Set the variable
baseUrl
to the explorer URL you have choosen.Make sure that the other variables are set to the values you have obtained in Get your API tokens.
Save your changes with Ctrl + S.
Set MARCO Environment as the default environment.
Select the MARCO APIs collection, and make sure the Authorization Type is set to
Bearer
and Token to{{accessToken}}
.
Get a transaction status
To get the status of a transaction, follow these steps:
On Postman, open the MARCO APIs collection.
Navigate to the endpoint MARCO Explorer API Library > transaction > get Transaction By Locator.
On the Params tab, configure the parameters as shown in the image below:
This will retrieve the status of the transaction with locator ID
0x3647379f63fc5a6833a0fe6ac7e08e33eaeffa5d84404a977f41fd22da1c3bad
.Before making an API call, set
ApplicationToken
to{{applicationToken}}
on the Headers tab.Click the Send button to send the request. You will see the response under the Body tab.
{
"locator": "0x3647379f63fc5a6833a0fe6ac7e08e33eaeffa5d84404a977f41fd22da1c3bad",
"status": true,
}This means, that the transaction with locator ID
0x3647379f63fc5a6833a0fe6ac7e08e33eaeffa5d84404a977f41fd22da1c3bad
has been successfully executed.tipAlternatively, you can send the same request using cURL from the command line:
curl --location -g 'https://api-marco.finboot.com/resource-proxy/PLG-e336dc31463/transaction?locator=0x3647379f63fc5a6833a0fe6ac7e08e33eaeffa5d84404a977f41fd22da1c3bad' \
--header 'Accept: application/json' \
--header 'ApplicationToken: <APPLICATION_TOKEN>' \
--header 'Authorization: Bearer <ACCESS_TOKEN>'
Get transaction details
To get additional information about a transaction, follow these steps:
On Postman, open the MARCO API collection.
Navigate to the endpoint MARCO Explorer API Library > transaction > get Receipt For Transaction By Locator
On the Params tab, configure the parameters as shown in the image below:
This will retrieve information of the transaction with hash
0x3647379f63fc5a6833a0fe6ac7e08e33eaeffa5d84404a977f41fd22da1c3bad
.Before making an API call, set
ApplicationToken
to{{applicationToken}}
on the Headers tab.Click the Send button to send the request. You will see the response under the Body tab.
{
"locator": "0x974e4965d2637489378faa4211f9a9305b2a5f041e31eeb08d3cd37fc9491a73",
"smartContractAddress": null,
"status": "succeeded"
}tipAlternatively, you can send the same request using cURL from the command line:
curl --location -g 'https://api-marco.finboot.com/resource-proxy/PLG-e336dc31463/transaction/receipt?locator=0x3647379f63fc5a6833a0fe6ac7e08e33eaeffa5d84404a977f41fd22da1c3bad' \
--header 'Accept: application/json' \
--header 'ApplicationToken: <APPLICATION_TOKEN>' \
--header 'Authorization: Bearer <ACCESS_TOKEN>'
Get block details
This is a brand new set of endpoints, docs will be available shortly!
Get account details
This is a brand new set of endpoints, docs will be available shortly!
Next steps
Congratulations! You now have a basic understanding of how to interact with MARCO APIs. To further enhance your knowledge, take a look at the following documentation:
- Concepts: Gain a deeper understanding of MARCO's architecture and main features.
- Guides: Learn how to use the MARCO Platform to build blockchain applications.
- Clients: Interact with MARCO APIs using your preferred programming language.
- References: Discover the REST APIs that allow you to integrate MARCO into your own applications and services.