-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
30 lines (23 loc) · 806 Bytes
/
main.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
const prompt = require('prompt-sync')({ sigint: true });
const colors = require('colors');
const App = require('./app');
const app = new App();
let input = 0;
do {
console.log("-------------------------");
console.log("[1] Create user");
console.log("[2] Show users");
console.log("[3] Make a transaction");
console.log("[4] Show pending transactions");
console.log("[5] Show transactions history");
console.log("[6] Create a block of pending transactions");
console.log("[7] Show blockchain\n");
console.log(colors.red("[8] Exit"));
console.log("-------------------------\n");
input = Number(prompt('> '));
if (input === 8) {
console.log("Bye, bye, my friend <3");
break;
}
app.handleOperation(input);
} while (input != 8)