Skip to content

Commit cb3fb1c

Browse files
committed
ft_watcher: make fast_transfer a submodule for easy sync
Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
1 parent def8d2d commit cb3fb1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+15016
-39203
lines changed

.github/workflows/build.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,21 @@ jobs:
99
steps:
1010
- name: Checkout 🛎️
1111
uses: actions/checkout@v3
12+
with:
13+
submodules: recursive
1214
- uses: actions/setup-node@v3
1315
with:
14-
node-version: 16
16+
node-version: 20
1517
cache: 'npm'
18+
- uses: metadaoproject/setup-anchor@v2
19+
with:
20+
node-version: "20.11.0"
21+
solana-cli-version: "1.18.11"
22+
anchor-version: "0.30.0"
23+
- name: Set default Rust toolchain
24+
run: rustup default stable
25+
- name: make fast-transfer-sdk
26+
run: make fast-transfer-sdk
1627
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
1728
run: |
1829
npm ci

.github/workflows/test.yaml

+23-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,22 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v3
9+
with:
10+
submodules: recursive # Initialize submodules recursively
911
- uses: actions/setup-node@v3
1012
with:
1113
node-version: 20
1214
cache: 'npm'
1315
cache-dependency-path: package-lock.json
16+
- uses: metadaoproject/setup-anchor@v2
17+
with:
18+
node-version: "20.11.0"
19+
solana-cli-version: "1.18.11"
20+
anchor-version: "0.30.0"
21+
- name: Set default Rust toolchain
22+
run: rustup default stable
23+
- name: make fast-transfer-sdk
24+
run: make fast-transfer-sdk
1425
- run: npm ci
1526
- run: npm run build
1627
- run: npm run build -w dashboard
@@ -24,10 +35,21 @@ jobs:
2435
runs-on: ubuntu-latest
2536
steps:
2637
- uses: actions/checkout@v3
38+
with:
39+
submodules: recursive # Initialize submodules recursively
2740
- uses: actions/setup-node@v3
2841
with:
2942
node-version: 20
30-
- run: npm ci
43+
- uses: metadaoproject/setup-anchor@v2
44+
with:
45+
node-version: "20.11.0"
46+
solana-cli-version: "1.18.11"
47+
anchor-version: "0.30.0"
48+
- name: Set default Rust toolchain
49+
run: rustup default stable
50+
- name: make fast-transfer-sdk
51+
run: make fast-transfer-sdk
52+
- run: npm ci
3153
- run: npx prettier --check .
3254
build-fly:
3355
runs-on: ubuntu-latest

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "watcher/sdk/example-liquidity-layer"]
2+
path = watcher/sdk/example-liquidity-layer
3+
url = https://github.com/wormhole-foundation/example-liquidity-layer.git
4+
rev = 40b328135c95453f41ffb12804cfcce440143c46

.prettierignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.github/
1+
.github/
2+
watcher/sdk/

Makefile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.PHONY: clean
2+
clean:
3+
$(MAKE) fast-transfer-clean
4+
rm -rf node_modules
5+
6+
.PHONY: fast-transfer-sync
7+
fast-transfer-sync:
8+
git submodule update --checkout
9+
git submodule sync --recursive
10+
11+
.PHONY: fast-transfer-clean
12+
fast-transfer-clean: fast-transfer-sync
13+
cd watcher/sdk/example-liquidity-layer/solana && $(MAKE) clean
14+
15+
.PHONY: fast-transfer-setup
16+
fast-transfer-setup: fast-transfer-sync
17+
cd watcher/sdk/example-liquidity-layer/solana && $(MAKE) anchor-test-setup
18+
19+
.PHONY: fast-transfer-sdk
20+
fast-transfer-sdk: fast-transfer-setup
21+
cd watcher/sdk/example-liquidity-layer \
22+
&& $(MAKE) build \
23+
&& npm run build -w solana \
24+
&& npm pack -w universal/ts -w solana
25+
26+
node_modules: fast-transfer-sdk
27+
npm install -w solana watcher/sdk/example-liquidity-layer/wormhole-foundation-example-liquidity-layer-*
28+
npm ci

cloud_functions/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@coral-xyz/anchor": "^0.29.0",
1717
"@cosmjs/cosmwasm-stargate": "^0.31.1",
1818
"@google-cloud/bigtable": "^4.1.0",
19-
"@google-cloud/functions-framework": "^3.1.3",
19+
"@google-cloud/functions-framework": "^3.4.0",
2020
"@google-cloud/pubsub": "^3.4.1",
2121
"@google-cloud/storage": "^6.8.0",
2222
"@solana/web3.js": "^1.87.3",
@@ -25,6 +25,7 @@
2525
"axios": "^1.5.0",
2626
"borsh": "^1.0.0",
2727
"dotenv": "^16.0.3",
28+
"ethers": "6.12.0",
2829
"firebase-admin": "^11.4.1",
2930
"knex": "^2.4.2",
3031
"path-to-regexp": "^6.2.1",

cloud_functions/src/processVaa.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Context, EventFunction } from '@google-cloud/functions-framework/build/src/functions';
1+
import { Context, EventFunction } from '@google-cloud/functions-framework';
22
import { PubsubMessage } from '@google-cloud/pubsub/build/src/publisher';
33
import { Bigtable, Instance, Table } from '@google-cloud/bigtable';
44
import knex, { Knex } from 'knex';

cloud_functions/tsconfig.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
"references": [{ "path": "../common" }, { "path": "../database" }],
44
"compilerOptions": {
55
"outDir": "dist",
6-
"skipLibCheck": true
6+
"skipLibCheck": true,
7+
"module": "NodeNext",
8+
"moduleResolution": "NodeNext",
9+
"esModuleInterop": true
710
},
811
"include": ["src", "src/data/*.json"]
912
}

0 commit comments

Comments
 (0)