Building a sidechain with the Klayr SDK
The "Build Blockchain" category contains all the guides related to the development of a blockchain client with the Klayr SDK.
The "Hello World" client
By the example of the "Hello World" client, it is explained how to build a very simple blockchain client step by step in the following chapters.
| Although the example is kept very simple by intention, the Hello World client implements all the most important components, and is therefore a good example to understand the basics of the development of a blockchain client. |
The "Hello World" client allows each account to save a greeting message on-chain. It also stores the addresses of senders of the greeting message, in an off-chain database. The following guides each focus on developing a specific part of the Hello client.
-
Creating a new blockchain client: How to bootstrap a default blockchain client.
-
Blockchain client configuration: How to create a custom configuration for a blockchain client.
-
How to create a module: How to create a new module and how to add it to the client. In the example, the
HelloModulewill contain all on-chain logic related to the Hello message.-
How to create a command: How to create a new command and how to add it to a module. In the example, the "Create Hello" command saves Hello messages of accounts, if they send a corresponding transaction.
-
-
How to create a plugin: How to create a new plugin and how to add it to the blockchain client.
-
In the example, the
HelloInfoPluginwill save all sent Hello messages, their corresponding sender address, and the corresponding block height of each event in an off-chain database. -
It will also expose an endpoint to retrieve the data from the off-chain database.
-
The plugin will also be configured and based on the configuration, the plugin will sync with the sidechain after regular intervals.
-
-
How to create a new genesis block: How to generate a new genesis block for a blockchain.
|
Complete application code
View the complete sample code of the complete "Hello World" Klayr app on GitHub in the Klayr SDK examples repository. |
The following image provides an overview of the "Hello" client: