Skip to content

Commit eb195ae

Browse files
V3 (#148)
* remove messages, aliases and peerids * futher changes * version bump * buildable alpha v3 * return channels without their currency in the balance * return ticket min price without their currency in the balance * channels changed type * add token type to balances call and parse tikets tokens to remove token type * V3 to V4 links, added new getMEtrics * update getMetrics * change version to 3.0.0 * format * fix some tests * fix unit tests for v3 * format * Fix package to private registry * Add public access * remove reported Version * Testing publishing * Remove debug lines * getChannelsCorrupted * getChannelsCorrupted with tests * format * update getChannelsCorrupted * update node from 20 to 24 for building * build on 22.x --------- Co-authored-by: ausias-armesto <ausiasarmesto@gmail.com>
1 parent 2479b86 commit eb195ae

File tree

146 files changed

+704
-3283
lines changed

Some content is hidden

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

146 files changed

+704
-3283
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: self-hosted-hoprnet-big
1515
strategy:
1616
matrix:
17-
node-version: [20.x, 22.x]
17+
node-version: [22.x, 24.x]
1818
steps:
1919
- name: Checkout repository
2020
uses: actions/checkout@v4
@@ -38,7 +38,7 @@ jobs:
3838

3939
publish:
4040
name: Publish
41-
runs-on: self-hosted-hoprnet-small
41+
runs-on: self-hosted-hoprnet-big
4242
needs: build
4343
steps:
4444
- name: Checkout repository
@@ -47,7 +47,7 @@ jobs:
4747
- name: Setup Node.js
4848
uses: hoprnet/hopr-workflows/actions/setup-node-js@master
4949
with:
50-
node-version: ${{ vars.NODE_VERSION }}
50+
node-version: 22.x
5151

5252
- name: Setup GCP
5353
id: gcp
@@ -62,6 +62,8 @@ jobs:
6262
PR_VERSION=$(jq -r '.version' package.json)-pr.${{ github.event.pull_request.number }}
6363
jq --arg version "${PR_VERSION}-${BUILD_DATE}" '.version = $version' package.json > temp.json
6464
mv temp.json package.json
65-
yarn publish --no-git-tag-version --tag next
65+
yarn build
66+
npm run login
67+
yarn publish --registry=https://europe-west3-npm.pkg.dev/hoprassociation/npm/ --no-git-tag-version --tag next
6668
env:
6769
NODE_AUTH_TOKEN: ${{ steps.gcp.outputs.access_token }}

.github/workflows/gh-pages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Node.js
2222
uses: hoprnet/hopr-workflows/actions/setup-node-js@master
2323
with:
24-
node-version: ${{ vars.NODE_VERSION }}
24+
node-version: 22.x
2525

2626
- name: Create docs
2727
run: |

.github/workflows/merge.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
jobs:
1515
merge:
1616
name: Merge PR
17-
runs-on: self-hosted-hoprnet-small
17+
runs-on: self-hosted-hoprnet-big
1818
if: github.event.pull_request.merged == true
1919

2020
steps:
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup Node.js
2525
uses: hoprnet/hopr-workflows/actions/setup-node-js@master
2626
with:
27-
node-version: ${{ vars.NODE_VERSION }}
27+
node-version: 22.x
2828

2929
- name: Setup GCP
3030
id: gcp
@@ -47,9 +47,10 @@ jobs:
4747
PR_VERSION=$(jq -r '.version' package.json)-pr.${{ github.event.pull_request.number }}
4848
jq --arg version "${PR_VERSION}-${BUILD_DATE}" '.version = $version' package.json > temp.json
4949
mv temp.json package.json
50-
yarn publish --no-git-tag-version --tag next
50+
yarn build
51+
yarn publish --registry=https://europe-west3-npm.pkg.dev/hoprassociation/npm/ --no-git-tag-version --tag next
5152
jq --arg version "${PR_VERSION}" '.version = $version' package.json > temp.json
5253
mv temp.json package.json
53-
yarn publish --no-git-tag-version --tag alpha
54+
yarn publish --registry=https://europe-west3-npm.pkg.dev/hoprassociation/npm/ --no-git-tag-version --tag alpha
5455
env:
5556
NODE_AUTH_TOKEN: ${{ steps.gcp.outputs.access_token }}

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Setup Node.js
3333
uses: hoprnet/hopr-workflows/actions/setup-node-js@master
3434
with:
35-
node-version: ${{ vars.NODE_VERSION }}
35+
node-version: 22.x
3636

3737
- name: Setup GCP
3838
id: gcp
@@ -112,7 +112,7 @@ jobs:
112112
- name: Setup Node.js
113113
uses: actions/setup-node@v4
114114
with:
115-
node-version: ${{ vars.NODE_VERSION }}
115+
node-version: 22.x
116116
cache: 'yarn'
117117
cache-dependency-path: ./yarn.lock
118118
registry-url: https://registry.npmjs.org
@@ -122,7 +122,7 @@ jobs:
122122
rm .yarnrc
123123
sed -i '/hoprassociation/d' .npmrc
124124
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
125-
yarn publish --non-interactive --registry=https://registry.npmjs.org/ --no-git-tag-version --tag release-candidate
125+
yarn publish --non-interactive --registry=https://registry.npmjs.org/ --access public --no-git-tag-version --tag release-candidate
126126
git checkout .npmrc .yarnrc
127127
128128
- name: Bump Version

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Source code resides under `src/` folder.
136136

137137
The api folder is used to find routes with ease.
138138

139-
For example if you are looking for `GET /api/v3/node/info` you would go straight
139+
For example if you are looking for `GET /api/v4/node/info` you would go straight
140140
to the node folder and find the file `getInfo.ts` alongside `getInfo.spec.ts` to
141141
understand how this function will react to different responses from the node.
142142

@@ -154,7 +154,7 @@ The adapter creates a resource class used by the [sdk class](./sdk.ts)
154154

155155
#### Adding a new route
156156

157-
The resource of the route can be seen after the `v3` keyword, for example in this example `/api/v3/node/info` the resource is `node`.
157+
The resource of the route can be seen after the `v4` keyword, for example in this example `/api/v4/node/info` the resource is `node`.
158158

159159
##### New Resource
160160

e2e/account.spec.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ describe('Account E2E tests', function () {
1919
});
2020
});
2121

22-
it('receives the hopr address', async function () {
23-
const response = await sdk.api.account.getHoprAddress();
24-
25-
expect(typeof response).toEqual('string');
26-
});
27-
2822
it('receives the native address', async function () {
2923
nativeAddress = (await sdk.api.account.getNativeAddress()) as string;
3024

e2e/aliases.spec.ts

Lines changed: 0 additions & 55 deletions
This file was deleted.

e2e/channels.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ describe('Channels E2E test', function () {
104104
const firstPeerAddresses = await sdk.api.account.getAddresses();
105105
const thirdPeerId = (await sdk3.api.account.getAddresses()).hopr;
106106

107-
await sdk2.api.messages.sendMessage({
108-
body: 'ticket',
109-
peerId: thirdPeerId,
110-
path: [firstPeerAddresses.hopr],
111-
tag: 0
112-
});
107+
// await sdk2.api.messages.sendMessage({
108+
// body: 'ticket',
109+
// peerId: thirdPeerId,
110+
// path: [firstPeerAddresses.hopr],
111+
// tag: 0
112+
// });
113113
// wait for ticket to exist
114114
await sleep(1_000);
115115

e2e/messages.spec.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

e2e/node.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ describe('Node E2E Tests', function () {
3131
lastSeen: expect.any(Number),
3232
lastSeenLatency: expect.any(Number),
3333
backoff: expect.any(Number),
34-
reportedVersion: expect.any(String),
3534
isNew: expect.any(Boolean)
3635
};
3736

@@ -45,12 +44,6 @@ describe('Node E2E Tests', function () {
4544
expect(response).toStrictEqual(expectedResponse);
4645
});
4746

48-
test('should get prometheus metrics from the node', async function () {
49-
const metrics = await sdk.api.node.getMetrics();
50-
51-
expect(typeof metrics).toBe('string');
52-
});
53-
5447
test('should get the nodes info', async function () {
5548
const info = await sdk.api.node.getInfo();
5649

0 commit comments

Comments
 (0)