> For the complete documentation index, see [llms.txt](https://docs.landslide.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.landslide.network/integrations/connecting-existing-cosmos-dapps-to-avalanche/abci-calls.md).

# ABCI Calls

### ABCI Calls

The ABCI (Application Blockchain Interface) calls in the Landslide Core repository provide the interface for Cosmos-based dApps to interact with the Avalanche network. Developers can plug their existing Cosmos dApps into the Landslide Core by implementing the necessary ABCI calls. The repository includes example ABCI applications such as the KVStoreApplication and the PersistentKVStoreApplication, which can be used as placeholders for Cosmos SDK-based applications.

### How to Connect Existing Cosmos dApps to Avalanche

To connect existing Cosmos dApps to Avalanche using the Landslide Core repository, developers need to implement the necessary ABCI calls in their application. This includes implementing the `InitChain`, `BeginBlock`, `DeliverTx`, `CheckTx`, and `EndBlock` ABCI calls, which enable the dApp to interact with the Avalanche network. Once the ABCI calls are implemented, the dApp can be compiled using the Landslide SDK and deployed to the Avalanche network.

The ABCI calls in the Landslide Core repository provide the interface for Cosmos-based dApps to interact with the Avalanche network.

* `InitChain`: This ABCI call is used to initialize the application state. It is called once when the application is first started or when a new chain is created. This is where the initial genesis state of the application is set.
* `BeginBlock`: This ABCI call is called at the beginning of each block. It provides information about the current block and allows the application to update its state based on the contents of the block.
* `DeliverTx`: This ABCI call is called when a new transaction is delivered to the application. It is used to validate the transaction and update the application state if the transaction is valid.
* `CheckTx`: This ABCI call is called when a new transaction is received by the node. It is used to validate the transaction before it is included in a block.
* `EndBlock`: This ABCI call is called at the end of each block. It provides information about the current block and allows the application to update its state based on the contents of the block.

To connect an existing Cosmos dApp to Avalanche using Landslide Core, developers need to implement these ABCI calls in their application. This is done by creating a new ABCI application that implements the necessary functions for each of the ABCI calls. These functions will define how the application interacts with the Avalanche network.

Once the ABCI application is implemented, it can be compiled using the Landslide SDK and deployed to the Avalanche network. The Landslide SDK is a fork of the Cosmos SDK that is 99% compatible with the existing Cosmos SDK, with the exception of the consensus algorithm. The Landslide SDK includes all the necessary libraries and modules needed to build and deploy the ABCI application to the Avalanche network.

In summary, by implementing the necessary ABCI calls, developers can connect their existing Cosmos dApps to the Avalanche network using Landslide Core. This allows them to take advantage of the benefits of the Avalanche network, including faster finality times and IBC compatibility.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.landslide.network/integrations/connecting-existing-cosmos-dapps-to-avalanche/abci-calls.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
