Skip to content

Commit a8aaa44

Browse files
committed
initial commit
0 parents  commit a8aaa44

35 files changed

+45635
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
db.json
3+
.env

LICENSE

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2022 Wormhole Project Contributors
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Wormhole Monitor
2+
3+
# Watcher
4+
5+
Watches each blockchain for new logs. Will need to expand to all chains and also check if the VAA is available.
6+
7+
You'll need a `.env` with an infura URL, or something that supports "finalized" block calls on Eth
8+
9+
```bash
10+
cd watcher
11+
npm ci
12+
npm run dev
13+
```
14+
15+
# Server
16+
17+
Express server that serves up the db file. Eventually there should be, like, a real db and stuff.
18+
19+
```bash
20+
cd server
21+
npm ci
22+
node app.js
23+
```
24+
25+
# Web
26+
27+
Displays a visualization of the database.
28+
29+
```bash
30+
cd web
31+
npm ci
32+
npm start
33+
```

server/app.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const express = require("express");
2+
const fs = require("fs");
3+
const app = express();
4+
const port = 4000;
5+
6+
const DB_FILE = "./db.json";
7+
const ENCODING = "utf8";
8+
9+
app.get("/api/db", (req, res) => {
10+
res.send(fs.readFileSync(DB_FILE, ENCODING));
11+
});
12+
13+
app.listen(port, () => {
14+
console.log(`Example app listening on port ${port}`);
15+
});

0 commit comments

Comments
 (0)