Integrate the Alliance module
Alliance can be integrated into both new and existing blockchains. It is an isolated module that doesn’t modify any existing CosmosSDK code. New blockchains can simply import the module and existing chains can perform a software upgrade.
Chains that want to create an Alliance must enable the following modules:
- x/auth: retrieve information about internal blockchain accounts
- x/bank: mint, burn or send coins
- x/staking: bond, unbond, delegate tokens and hooks
- x/distribution: withdraw rewards
- x/gov: create Alliances through governance
The Alliance module leverages the IBC module x/ibc to bridge foreign tokens. Alliance allows any ADR 024 compliant token to be staked as long as it has been whitelisted.
Follow all of the steps in this guide carefully.
The Alliance Module requires:
- Cosmos SDK v0.46.x or greater
- The following fully-operational modules:
Configuring and Adding Alliance to a Cosmos SDK Chain
Refer to the example pull request for an implementation of the following steps.
- Add the Alliance package to the
go.modfile with the latest released version and install it.
- Add the following modules to
- Register the AllianceKeeper in
- Add the Alliance module into the BasicManager instantiation.
- Add the Alliance module to the app. The Alliance module needs to be specified after the
- Add the Alliance staking hooks to
- Add the requisite Alliance module types to the module account permissions.
- Add the alliance storekey to the KVStore.
- Add the Alliance module to the app manager and simulation manager instantiations.
- Add the module as the final element to the following:
- Add the Alliance proposal handler route to the governance module.
- Add the governance proposal handlers.
- Block the module account address.
- Add the init params keepers.
Configuring the Bank Module
Make sure all three of the following steps are implemented.
Because the Alliance module mints and burns native staking tokens when rebalancing reward power, a chain's Total Supply API needs to be updated to return accurate results. This custom wrapper only affects the following APIs:
/cosmos/bank/v1beta1/supply/by_denom. Follow these instructions to update your API for supply accuracy.
- Update the imports to use a custom wrapper over the Bank module.
- Add a line to register the keepers that the custom Bank module needs.
- Add the following keeper to allow the Alliance module access to transfer tokens directly to accounts.