From 60814912ebdc8ee0a57c24e9a59710d73b838b3c Mon Sep 17 00:00:00 2001 From: Marko Date: Mon, 23 Jan 2023 11:46:06 +0100 Subject: [PATCH] chore: add docs on 0 height (#14723) --- docs/docs/basics/00-app-anatomy.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docs/basics/00-app-anatomy.md b/docs/docs/basics/00-app-anatomy.md index 99d7417df07..a1479658055 100644 --- a/docs/docs/basics/00-app-anatomy.md +++ b/docs/docs/basics/00-app-anatomy.md @@ -36,7 +36,11 @@ Once the main binary is built, the node can be started by running the [`start` c 1. Create an instance of the state-machine defined in [`app.go`](#core-application-file). 2. Initialize the state-machine with the latest known state, extracted from the `db` stored in the `~/.app/data` folder. At this point, the state-machine is at height `appBlockHeight`. -3. Create and start a new Tendermint instance. Among other things, the node performs a handshake with its peers. It gets the latest `blockHeight` from them and replays blocks to sync to this height if it is greater than the local `appBlockHeight`. If `appBlockHeight` is `0`, the node is starting from genesis and Tendermint sends an `InitChain` message via the ABCI to the `app`, which triggers the [`InitChainer`](#initchainer). +3. Create and start a new Tendermint instance. Among other things, the node performs a handshake with its peers. It gets the latest `blockHeight` from them and replays blocks to sync to this height if it is greater than the local `appBlockHeight`. The node starts from genesis and Tendermint sends an `InitChain` message via the ABCI to the `app`, which triggers the [`InitChainer`](#initchainer). + +:::note +When starting an tendermint instance, the genesis file is the `0` height and the state within the genesis file is committed at block height `1`. When querying the state of the node, querying block height 0 will return an error. +::: ## Core Application File