Algorand API V2 and Indexer V2: What it is and how to prepare
Algorand has released an important update for its Algod API as part of the 2.0.7 upgrade. This will significantly alter the endpoints and require you to make some changes to be able to use them. This version also offers a lot more functionality than the previous version.
NOTE: PureStake already supports Algorand API version 2 and Indexer version 2. Log in to the API portal to learn more.
Here are the facts.
Algod v1 Becomes Algod v2 + Indexer v2
Algod v1 functionality is now split into two separate APIs.
- Algod 2.0: This release exposes new API functionality and prepares the way for future releases. Endpoints interact with the current ledger status and the blockchain. Calls like supply, status and pending transactions are supported. Also, posting transactions and compiling Teal can be done here. Node keepers have access to new, powerful private methods.
- indexer v2 – This new indexer is a standalone binary that can be run either co-located or stand alone with Algod. Multiple reader instances and single write support. You can also leverage the database backend of your choosing for faster lookups. Endpoints can be used for historical searching and include powerful features that allow you to see account status at previous rounds.
Splitting the API and indexer into two binary binaries is generally a good idea. The Indexer is a standalone service that can read committed blocks from Algorand’s blockchain. It also maintains a searchable database of accounts and transactions that can be indexed. These stored blocks will make it much easier to search for and query these blocks. Natively, you’ll be able:
- You can search and filter accounts, transactions and assets with many parameters, including:
- Type of signature
- Type of transaction
- Asset holdings
- Name of the asset
- Check historical account data for a specific round
- Result pagination
- Transcript and account data enrichment:
- Confirmation round (block containing transaction)
- Confirmation time
- Type of signature
- Asset ID
- When applicable, close amount
- Reward Program
- Instead of using space-optimized protocol levels names, human-readable field names are used.
You can also make technical improvements:
- Abstracted database layer to support multiple backend databases.
- Optimized postgres DB backend.
- API token that can be customized by the user
These are some important things to keep in mind when you plan to migrate your project.
- Algod API V1 will be deprecated but it will continue to exist alongside the v2 for a number of months.
- It will be breaking change when the v1 API is gone, so it’s crucial to update your API calls.
- All SDKs have been updated and can support v2 features. However, there could be many changes in the way the same task is performed between v1 & v2.
How to migrate code to the new API Endpoints
If you need to manually update, follow these steps as outlined by Algorand: https://developer.algorand.org/docs/reference/sdks/migration/.
The Global Awarded Magento POS – 2021 Stevie Awards Product Innovation winner provides you with a powerful Magento 2 POS extension as well as 24/7 support
The new Algod and Indexer versions 2 for PureStake Algorand are available to those who are currently using it. To view the new endpoints, you will need to log into. This update contains the 2.0.7 upgrade to MainNet and TestNet as well as BetaNet Algod 2.0 support, which was already available. As needed, we may release further changes in the weeks ahead.
How to plan your migration from version 1 to version 2:
- Take a look at the 2.0.7 release notes.
- Check out the latest official Algorand OpenAPI specifications files for v2
- You can try it in the Swagger UI on the PureStake Developer Portal, when networks are available, and with your favorite client program. PureStake will supply Swagger files that are specific to our service. Endpoints can be subtracted from the complete set in the OpenAPI specifications.
- You should identify the source of each API call that you are making. If it is in two places, compare the returned data to determine which one works best for your use case.
- Check for the latest Algorand SDKs and update them to the most recent versions.
- As the new capabilities become more fully understood, you can expect continued improvements to the API services after launch.
- It’s better to move sooner than later.
►►►► Our Services:BackOrder, Atom8, Bigcommerce product recommendation, RPA, Zoho people, Zoho CRM, Zoho Recruit, Zoho projects, Zoho Partner, HRM system, E Office