-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
101 lines (95 loc) · 2.38 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import Fastify from 'fastify';
import fs from 'fs';
import FlowCLI from './source/FlowCLI.js';
(async () => {
// 0: 0111010011101011100101110
// 1: 0010001100001000010001110
// 2: 0111010001000100010011111
// 3: 0111010001001101000101110
// 4: 0011001010100101111100010
// 5: 1111110000111100000111110
// 6: 0111110000111101000101110
// 7: 1111100010111110100010000
// 8: 0111010001011101000101110
// 9: 0111010001011100000111110
// A: 0111010001111111000110001
// B: 1111010001111101000111110
// C: 0111010001100001000101110
// D: 1111010001100011000111110
// E: 1111010000111001000011110
// F: 1111010000111001000010000
// G: 0111110000101111000101111
// H: 1000110001111111000110001
// I: 1111100100001000010011111
// J: 0111000010000100101001110
// K: 1000110010101001101010001
// L: 1000010000100001000011111
// M: 1000111011101011000110001
// N: 1000111001101011001110001
// O: 0111010001100011000101110
// P:
// Q:
// R:
// S:
// T:
// U:
// V:
// W: 1000110101101011111101010
// X:
// Y:
// Z:
const letterX = [
'10001',
'01010',
'00100',
'01010',
'10000'
];
// await FlowCLI.executeTransaction({
// transactionPath: './model/Artist/transactions/printPicture.cdc',
// argsJSON: [
// {
// type: 'String',
// value: letterX.join('')
// }
// ],
// authorizer: 'owner',
// proposer: 'owner',
// payer: 'owner',
// network: 'emulator',
// showOutput: true
// });
// await FlowCLI.executeTransaction({
// transactionPath: 'model/PictureNFT/transactions/createCollection.cdc',
// authorizer: 'user-testnet',
// proposer: 'user-testnet',
// payer: 'user-testnet',
// network: 'testnet'
// });
// await FlowCLI.executeScript({
// scriptPath: 'model/Artist/scripts/getCanvases.cdc',
// argsJSON: [
// {
// type: 'Address',
// value: '0x01cf0e2f2f715450'
// }
// ],
// network: 'emulator',
// });
const fastify = Fastify({
logger: true
});
fastify.get('/', async (request, reply) => {
reply
.type('text/html')
.send(fs.readFileSync('./main.html', 'utf-8'));
});
fastify.listen(3200, '0.0.0.0', (error, address) => {
if (error) {
console.log(error);
process.exit(1);
} else {
fastify.log.info(`Server listening on ${address}.`);
}
});
})();