Table of Contents
Prerequisites
Before you start with this tutorial, make sure you have:- A working chain project. This tutorial wonβt cover the steps of creating a new chain/module.
- Familiarity with the Cosmos SDK. If youβre not, we suggest you start with Cosmos SDK Tutorials, as ABCI++ is considered an advanced topic.
- Read and understood What is an Oracle?. This provides necessary background information for understanding the Oracle module.
- Basic understanding of Go programming language.
What are Vote extensions?
Vote extensions are arbitrary information that can be inserted into a block. This feature is part of ABCI 2.0, which is available for use in the SDK 0.50 release and part of the 0.38 CometBFT release. More information about vote extensions can be seen here.Overview of the project
Weβll go through the creation of a simple price oracle module, focusing on the vote extensions implementation and ignoring the details inside the price oracle itself. Weβll go through the implementation of:ExtendVoteto get information from external price APIs.VerifyVoteExtensionto check that the format of the provided votes is correct.PrepareProposalto process the vote extensions from the previous block and include them into the proposal as a transaction.ProcessProposalto check that the first transaction in the proposal is actually a βspecial txβ that contains the price information.PreBlockerto make price information available during FinalizeBlock.