How to register a custom transaction with your custom blockchain app?

A custom transaction can be registered the following:

  1. Import Application object to create a new app instance.
  2. Import your custom transaction.
  3. Pass the devnet (or other network) config to the app object.
  4. Register your custom transaction to the application with the registerTransaction() interface.
  5. Lastly, run the application with the run() function.
const { Application, genesisBlockDevnet, configDevnet } = require('lisk-sdk');

const MyTransaction = require('./my_transaction'); 

const app = new Application(genesisBlockDevnet, configDevnet);

app.registerTransaction(MyTransaction); 

app
    .run()
    .then(() => app.logger.info('App started...'))
    .catch(error => {
        console.error('Faced error in application', error);
        process.exit(0);
    });