How to use the lisk-sdk.Application function in lisk-sdk

To help you get started, we’ve selected a few lisk-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiskHQ / lisk-sdk-examples / workshop / index.js View on Github external
const { Application, genesisBlockDevnet, configDevnet } = require('lisk-sdk');
// const { InvoiceTransaction } = require('./transactions/index');
// const { PaymentTransaction } = require('./transactions/index');

const app = new Application(genesisBlockDevnet, configDevnet);

// app.registerTransaction(InvoiceTransaction);
// app.registerTransaction(PaymentTransaction); 

app
	.run()
	.then(() => app.logger.info('App started...'))
	.catch(error => {
		console.error('Faced error in application', error);
		process.exit(1);
	});
github LiskHQ / lisk-core / src / index.ts View on Github external
} from './transactions';

try {
	/**
	 * We have to keep it in try/catch block as it can throw
	 * exception while validating the configuration
	 */

	// tslint:disable-next-line no-require-imports no-var-requires
	const { config } = require('./helpers/config');

	const { NETWORK } = config;
	// tslint:disable-next-line no-var-requires
	const genesisBlock = require(`../config/${NETWORK}/genesis_block.json`);

	const app = new Application(genesisBlock, config);

	app.registerTransaction(DappTransaction, {
		matcher: context =>
			context.blockHeight <
			app.config.modules.chain.exceptions.precedent.disableDappTransaction,
	});

	app.registerTransaction(
		InTransferTransaction,
		{
			matcher: context =>
				context.blockHeight <
				app.config.modules.chain.exceptions.precedent.disableDappTransfer,
		}
	);
github LiskHQ / lisk-core / test / unit / scripts / update_config.js View on Github external
			expect(() => new Application(genesisBlock, updatedConfig)).not.to.throw;
	});
github LiskHQ / lisk-sdk-examples / cashback / index.js View on Github external
const { Application, genesisBlockDevnet, configDevnet } = require('lisk-sdk');
const CashbackTransaction = require('./cashback_transaction');

configDevnet.app.label = 'Cashback-blockchain-app';

const app = new Application(genesisBlockDevnet, configDevnet);

app.registerTransaction(CashbackTransaction);

app
	.run()
	.then(() => app.logger.info('App started...'))
	.catch(error => {
		console.error('Faced error in application', error);
		process.exit(1);
	});
github LiskHQ / lisk-sdk-examples / invoice / index.js View on Github external
const { Application, genesisBlockDevnet, configDevnet } = require('lisk-sdk');
const { InvoiceTransaction, PaymentTransaction } = require('./transactions/index');

const app = new Application(genesisBlockDevnet, configDevnet);

app.registerTransaction(InvoiceTransaction);
app.registerTransaction(PaymentTransaction);

app
	.run()
	.then(() => app.logger.info('App started...'))
	.catch(error => {
		console.error('Faced error in application', error);
		process.exit(1);
	});
github LiskHQ / lisk-sdk-examples / delivery / node / index.js View on Github external
const { Application, genesisBlockDevnet, configDevnet } = require('lisk-sdk');
const RegisterPacketTransaction = require('../transactions/register-packet');
const RegisterCarrierTransaction = require('../transactions/register-carrier');
const UnregisterCarrierTransaction = require('../transactions/unregister-carrier');
const StartDeliveryTransaction = require('../transactions/start-delivery');
const FinishDeliveryTransaction = require('../transactions/finish-delivery');

configDevnet.app.label = 'lisk-delivery';

const app = new Application(genesisBlockDevnet, configDevnet);
app.registerTransaction(RegisterPacketTransaction);
app.registerTransaction(RegisterCarrierTransaction);
app.registerTransaction(UnregisterCarrierTransaction);
app.registerTransaction(StartDeliveryTransaction);
app.registerTransaction(FinishDeliveryTransaction);

app
    .run()
    .then(() => app.logger.info('App started...'))
    .catch(error => {
        console.error('Faced error in application', error);
        process.exit(1);
    });
github LiskHQ / lisk-sdk-examples / d-npm / index.js View on Github external
const { Application, genesisBlockDevnet, configDevnet } = require('lisk-sdk');
const RegisterPackageTransaction = require('./register-package-transaction');

configDevnet.app.label = 'D-NPM-application';

const app = new Application(genesisBlockDevnet, configDevnet);

app.registerTransaction(RegisterPackageTransaction);

app
    .run()
    .then(() => app.logger.info('App started...'))
.catch(error => {
    console.error('Faced error in application', error);
process.exit(1);
});
github LiskHQ / lisk-sdk-examples / hello_world / index.js View on Github external
const { Application, genesisBlockDevnet, configDevnet} = require('lisk-sdk');
const HelloTransaction = require('./hello_transaction');

configDevnet.app.label = 'HelloWorld-blockchain-app';

const app = new Application(genesisBlockDevnet, configDevnet);

app.registerTransaction(HelloTransaction);

app
	.run()
	.then(() => app.logger.info('App started...'))
	.catch(error => {
		console.error('Faced error in application', error);
		process.exit(1);
	});
github LiskHQ / lisk-sdk-examples / transport / workshop-example / index.js View on Github external
const { Application, genesisBlockDevnet, configDevnet } = require('lisk-sdk');
const RegisterPacketTransaction = require('../transactions/register-packet');
const StartTransportTransaction = require('../transactions/start-transport');
const FinishTransportTransaction = require('../transactions/finish-transport');
const LightAlarmTransaction = require('../transactions/light-alarm');

configDevnet.app.label = 'lisk-transport';
configDevnet.modules.http_api.access.public = true;
configDevnet.components.storage.host = 'db';

const app = new Application(genesisBlockDevnet, configDevnet);
app.registerTransaction(RegisterPacketTransaction);
app.registerTransaction(StartTransportTransaction);
app.registerTransaction(FinishTransportTransaction);
app.registerTransaction(LightAlarmTransaction);

app
    .run()
    .then(() => app.logger.info('App started...'))
    .catch(error => {
        console.error('Faced error in application', error);
        process.exit(1);
    });
github LiskHQ / lisk-sdk-examples / src / index.js View on Github external
const { Application } = require('lisk-sdk');
const genesisBlockDevnet = require('./genesis_block_devnet.json');
const CashbackTransaction = require('./transactions/cashback_transaction');

const app = new Application(genesisBlockDevnet, {
	app: {
		label: 'my-app',
		minVersion: '0.0.0',
		version: '0.0.0',
		protocolVersion: '0.0',
	},
	modules: {
		chain: {
			forging: {
				force: true,
				"delegates": [
					{
						"encryptedPassphrase": "iterations=1&salt=476d4299531718af8c88156aab0bb7d6&cipherText=663dde611776d87029ec188dc616d96d813ecabcef62ed0ad05ffe30528f5462c8d499db943ba2ded55c3b7c506815d8db1c2d4c35121e1d27e740dc41f6c405ce8ab8e3120b23f546d8b35823a30639&iv=1a83940b72adc57ec060a648&tag=b5b1e6c6e225c428a4473735bc8f1fc9&version=1",
						"publicKey": "9d3058175acab969f41ad9b86f7a2926c74258670fe56b37c429c01fca9f2f0f"
					},
					{