-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
31 lines (26 loc) · 1.65 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//index.js
const { Application, genesisBlockDevnet, configDevnet } = require('lisk-sdk'); // require application class, the default genesis block and the default config for the application
const CreateBikeTransaction = require('./transactions/create-bike'); // require the newly created transaction type 'HelloTransaction'
const FaucetTransaction = require('./transactions/faucet'); // require the newly created transaction type 'HelloTransaction'
const UpdateBikeLocationTransaction = require('./transactions/update-bike-location'); // require the newly created transaction type 'HelloTransaction'
const RentBikeTransaction = require('./transactions/rent-bike'); // require the newly created transaction type 'HelloTransaction'
const ReturnBikeTransaction = require('./transactions/return-bike');
configDevnet.app.label = 'lisk-bike-blockchain-app'; // change the label of the app
configDevnet.components.storage.password = 'lisk123'; // replace password with the password for your database user
configDevnet.modules.http_api.access.public = true;
// Create the application instance
const app = new Application(genesisBlockDevnet, configDevnet);
// Register custom transactions
app.registerTransaction(CreateBikeTransaction);
app.registerTransaction(FaucetTransaction);
app.registerTransaction(UpdateBikeLocationTransaction);
app.registerTransaction(RentBikeTransaction);
app.registerTransaction(ReturnBikeTransaction);
// the code block below starts the application and doesn't need to be changed
app
.run()
.then(() => app.logger.info('App started...'))
.catch(error => {
console.error('Faced error in application', error);
process.exit(1);
});