Quickstart
The quickest way to bootstrap a blockchain application with the Lisk SDK is explained here step-by-step.
Installation
Create a package.json
file.
npm init --yes
Install the lisk-sdk
package.
npm i lisk-sdk
Start the application
Create a new file index.js
and paste the snippet below.
The Both objects can be customized before passing them to the |
const { Application, genesisBlockDevnet, configDevnet } = require('lisk-sdk'); (1)
const app = Application.defaultApplication(genesisBlockDevnet, configDevnet); (2)
app (3)
.run()
.then(() => app.logger.info('App started...'))
.catch(error => {
console.error('Faced error in application', error);
process.exit(1);
});
1 | Import the Application , genesisBlockDevnet and configDevnet from the lisk-sdk package. |
2 | Creates a default application, which comes with all default modules. |
3 | Starts the application. |
After saving the file with the above contents, start the application as shown below:
node index.js
To verify the application start, check the log messages in the terminal. If the start was successful, the application will enable forging for all genesis delegates and will start to add new blocks to the blockchain every 10 seconds.
After completing these steps, the default blockchain application of the Lisk SDK will now be running. It is now possible to customize your application by registering new modules and plugins, and also adjusting the genesis block and config to suit your specific use case. |