Skip to content

Commit 18d06eb

Browse files
p2p impl (#2055)
* p2p impl * parallel http and p2p * rename job * fix field blob * serialize string * validate ddo * revert decryptor url * revert to http for now * fix signatures * lint fix * decrypt p2p and refactor * cleanup * cleanup and refactroing * p2p warmup * find peer * move functions to class level * remove unused checks * async node creation * reuse same provider * Updating ComputeExamples.md * simplift to hex and log err msg * lint fix * revert bad conversion * enable tcp and new method * fix methods mismatch * use signer in tests * Updating ComputeExamples.md * try peer id * use contracts version main * export contracts version main * get compute result, not only by url * lint fix * signature if no auth token * remove lint unused vars * encypt docker registry auth p2p * rename env to NODE * rename to NODE_ENDPOINT, NODE is reserved * Updating CodeExamples.md * Updating ComputeExamples.md * push,fetch config and no tls * Release 7.0.0-next.0 * bump uint8arrays to esm supported * getmultiaddr from peerid * remove mdns * print ci barge start script logs * remove explicit contracts version * start without typesense * Release 7.0.0-next.1 * improve check * circuit relay * circuit relay provider * libp2p circuit + evict bad connections * rename methods * fix unused auth in initializecompute * fix test init compute * Updating ComputeExamples.md * Release 7.0.0-next.2 * replace uint8arrays lib with native * fix exports name in pacakge json * Revert "fix exports name in pacakge json" This reverts commit 278ef0f. * Release 7.0.0-next.3 * devdep libp2p + fix exports * Release 7.0.0-next.4 * fix circuit parsing * Release 7.0.0-next.5 * keep only esential files * Release 7.0.0-next.6 * get node jobs and get node status * add fromtimestamp http * use direct command for status * Release 7.0.0-next.7 * allow multiaddr dial * Release 7.0.0-next.8 * fix review comments * Release 7.0.0-next.9 * p2p store discovered nodes & add dockerregistryauth * lint fix * Release 7.0.0-next.10 * export libp2p node * Release 7.0.0-next.11 * fetchnodelogs p2p method * Release 7.0.0-next.12 * create auth token with signed messge * Release 7.0.0-next.13 * ci use 127.0.0.1 * use older branch * Revert "ci use 127.0.0.1" This reverts commit db531ab. * add optional stream to command (#2065) * add optional stream to command * run CI on all branches, not just main * expose client protocols (#2066) * expose client protocols --------- Co-authored-by: GitHub Actions Bot <> Co-authored-by: alexcos20 <alex.coseru@gmail.com>
1 parent add67ef commit 18d06eb

26 files changed

Lines changed: 8485 additions & 20682 deletions

.github/workflows/ci.yml

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: 'CI'
1+
name: "CI"
22

33
on:
44
pull_request:
55
branches:
6-
- main
6+
- '**'
77

88
jobs:
99
lint:
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-node@v4
1414
with:
15-
node-version: '20'
15+
node-version: "22"
1616
- name: Cache node_modules
1717
uses: actions/cache@v4
1818
env:
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/checkout@v3
3232
- uses: actions/setup-node@v4
3333
with:
34-
node-version: '20'
34+
node-version: "22"
3535
- name: Cache node_modules
3636
uses: actions/cache@v4
3737
env:
@@ -47,8 +47,8 @@ jobs:
4747
- name: Checkout Barge
4848
uses: actions/checkout@v3
4949
with:
50-
repository: 'oceanprotocol/barge'
51-
path: 'barge'
50+
repository: "oceanprotocol/barge"
51+
path: "barge"
5252

5353
- name: Set Database Environment Variables
5454
run: |
@@ -60,7 +60,7 @@ jobs:
6060
- name: Run Ganache with Barge
6161
working-directory: ${{ github.workspace }}/barge
6262
run: |
63-
bash -x start_ocean.sh --with-typesense 2>&1 > start_ocean.log &
63+
bash -x start_ocean.sh 2>&1 > start_ocean.log &
6464
6565
- name: Install deps & build
6666
run: npm ci && npm run build:metadata
@@ -78,7 +78,11 @@ jobs:
7878
if [ $attempt -eq $max_attempts ]; then
7979
echo "Error: Node container failed to start within 300 seconds"
8080
docker ps -a
81-
docker inspect ocean-node-1
81+
docker inspect ocean-node-1 || true
82+
echo "=== Barge startup script output ==="
83+
cat ${{ github.workspace }}/barge/start_ocean.log || true
84+
echo "=== Ocean Node Logs ==="
85+
docker logs ocean-node-1 2>&1 | tail -100 || true
8286
exit 1
8387
fi
8488
sleep 10
@@ -91,13 +95,23 @@ jobs:
9195
path: coverage/
9296

9397
test_integration:
98+
name: test_integration (${{ matrix.transport }})
9499
runs-on: ubuntu-latest
95100

101+
strategy:
102+
fail-fast: false
103+
matrix:
104+
include:
105+
- transport: http
106+
node_endpoint: "http://127.0.0.1:8001"
107+
- transport: p2p
108+
node_endpoint: "16Uiu2HAmRkJeRYRghP3ETQCpdz8NsQzQE9RpSST7i5YNgWqH4dVE"
109+
96110
steps:
97111
- uses: actions/checkout@v3
98112
- uses: actions/setup-node@v4
99113
with:
100-
node-version: '20'
114+
node-version: "22"
101115
- name: Cache node_modules
102116
uses: actions/cache@v4
103117
env:
@@ -115,8 +129,8 @@ jobs:
115129
- name: Checkout Barge
116130
uses: actions/checkout@v3
117131
with:
118-
repository: 'oceanprotocol/barge'
119-
path: 'barge'
132+
repository: "oceanprotocol/barge"
133+
path: "barge"
120134

121135
- name: Login to Docker Hub
122136
if: ${{ env.DOCKERHUB_PASSWORD && env.DOCKERHUB_USERNAME }}
@@ -136,7 +150,7 @@ jobs:
136150
- name: Run Barge
137151
working-directory: ${{ github.workspace }}/barge
138152
run: |
139-
bash -x start_ocean.sh --with-typesense 2>&1 > start-node.log &
153+
bash -x start_ocean.sh 2>&1 > start-node.log &
140154
141155
- name: Install deps & build
142156
run: npm ci && npm run build:metadata
@@ -170,15 +184,23 @@ jobs:
170184
attempt=$((attempt + 1))
171185
done
172186
173-
- name: integration
174-
run: npm run test:integration:cover
187+
- name: integration (${{ matrix.transport }})
188+
run: |
189+
if [ "${{ matrix.transport }}" = "http" ]; then
190+
npm run test:integration:cover
191+
else
192+
npm run test:integration
193+
fi
175194
env:
176195
INDEXING_RETRY_INTERVAL: 4000
177196
INDEXING_MAX_RETRIES: 120
178-
NODE_URL: 'http://127.0.0.1:8001'
197+
NODE_ENDPOINT: ${{ matrix.node_endpoint }}
179198

180199
- name: docker logs
181200
run: |
201+
echo "=== Barge startup script output ==="
202+
cat ${{ github.workspace }}/barge/start-node.log || true
203+
echo ""
182204
echo "=== Ocean Contracts Logs ==="
183205
docker logs ocean-ocean-contracts-1 2>&1 || echo "Container not found"
184206
echo ""
@@ -187,6 +209,7 @@ jobs:
187209
if: ${{ failure() }}
188210

189211
- name: Upload coverage
212+
if: matrix.transport == 'http'
190213
uses: actions/upload-artifact@v4
191214
with:
192215
name: coverage-integration
@@ -199,7 +222,7 @@ jobs:
199222
fail-fast: false
200223
matrix:
201224
os: [ubuntu-latest, macos-latest, windows-latest]
202-
node: ['20', '18']
225+
node: ["22", "20"]
203226

204227
steps:
205228
- uses: actions/checkout@v3
@@ -237,13 +260,13 @@ jobs:
237260
- uses: actions/checkout@v3
238261
- uses: actions/setup-node@v4
239262
with:
240-
node-version: '20'
263+
node-version: "22"
241264

242265
- name: checkout ocean.js repo
243266
uses: actions/checkout@v3
244267
with:
245-
repository: 'oceanprotocol/ocean.js'
246-
path: 'ocean.js'
268+
repository: "oceanprotocol/ocean.js"
269+
path: "ocean.js"
247270
ref: ${{ github.event.pull_request.head.sha }}
248271

249272
- name: setup git config

CHANGELOG.md

Lines changed: 107 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,113 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [v7.0.0-next.13](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.12...v7.0.0-next.13)
8+
9+
- create auth token with signed messge [`664a9b3`](https://github.com/oceanprotocol/ocean.js/commit/664a9b36552a8aaad6d995f5ef615735aba0c58f)
10+
11+
#### [v7.0.0-next.12](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.11...v7.0.0-next.12)
12+
13+
> 9 April 2026
14+
15+
- fetchnodelogs p2p method [`218c472`](https://github.com/oceanprotocol/ocean.js/commit/218c4720a2f82d780cfc6f29f24372fd2a706649)
16+
- Release 7.0.0-next.12 [`5abf22f`](https://github.com/oceanprotocol/ocean.js/commit/5abf22f8ac3c02d1b61eb89df77c2dee06dcaf42)
17+
18+
#### [v7.0.0-next.11](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.10...v7.0.0-next.11)
19+
20+
> 9 April 2026
21+
22+
- Release 7.0.0-next.11 [`b8a24d9`](https://github.com/oceanprotocol/ocean.js/commit/b8a24d92842e3ca6c91c3810d77ac24767486c87)
23+
- export libp2p node [`cfae9c5`](https://github.com/oceanprotocol/ocean.js/commit/cfae9c5ec5749c8902717f4e231a1baa14a880c6)
24+
25+
#### [v7.0.0-next.10](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.9...v7.0.0-next.10)
26+
27+
> 9 April 2026
28+
29+
- p2p store discovered nodes & add dockerregistryauth [`8689233`](https://github.com/oceanprotocol/ocean.js/commit/8689233403c0a73e555844d72e04f48e7d581cab)
30+
- Release 7.0.0-next.10 [`b74e620`](https://github.com/oceanprotocol/ocean.js/commit/b74e62047ec6c05e2b30491a643693556edbdb58)
31+
- lint fix [`cfa8ffd`](https://github.com/oceanprotocol/ocean.js/commit/cfa8ffd0b598e48fcf3c4cf008d9b4a72e0b25a8)
32+
33+
#### [v7.0.0-next.9](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.8...v7.0.0-next.9)
34+
35+
> 9 April 2026
36+
37+
- fix review comments [`51f59c5`](https://github.com/oceanprotocol/ocean.js/commit/51f59c52ca9885087d8a00c77ae053e3495a7d65)
38+
- Release 7.0.0-next.9 [`5c02645`](https://github.com/oceanprotocol/ocean.js/commit/5c0264573d89ae7eb805a256f446f8c98086329a)
39+
40+
#### [v7.0.0-next.8](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.7...v7.0.0-next.8)
41+
42+
> 8 April 2026
43+
44+
- Release 7.0.0-next.8 [`b5582b5`](https://github.com/oceanprotocol/ocean.js/commit/b5582b5934868180b59477fd7ce3eb18a0933b02)
45+
- allow multiaddr dial [`c6d7807`](https://github.com/oceanprotocol/ocean.js/commit/c6d78078be7f855256500e82a98fc88983c08f89)
46+
47+
#### [v7.0.0-next.7](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.6...v7.0.0-next.7)
48+
49+
> 8 April 2026
50+
51+
- get node jobs and get node status [`a56d4c3`](https://github.com/oceanprotocol/ocean.js/commit/a56d4c35b7993a4982507617fa2e1d88f5272c2a)
52+
- use direct command for status [`694fce7`](https://github.com/oceanprotocol/ocean.js/commit/694fce7f901f019bf7e51626701e6adf3da5b49d)
53+
- Release 7.0.0-next.7 [`7bb6345`](https://github.com/oceanprotocol/ocean.js/commit/7bb6345536684dc8009e7e93e3c6bf6adbc3d366)
54+
55+
#### [v7.0.0-next.6](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.5...v7.0.0-next.6)
56+
57+
> 6 April 2026
58+
59+
- Release 7.0.0-next.6 [`7b376f2`](https://github.com/oceanprotocol/ocean.js/commit/7b376f2c1206f84ae8c2562e73f7b9bde15ecc53)
60+
- keep only esential files [`4368065`](https://github.com/oceanprotocol/ocean.js/commit/4368065552309e723e8447be2170130942a8c01c)
61+
62+
#### [v7.0.0-next.5](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.4...v7.0.0-next.5)
63+
64+
> 6 April 2026
65+
66+
- fix circuit parsing [`aef0342`](https://github.com/oceanprotocol/ocean.js/commit/aef0342880eb7481076266f99054f4c71c011394)
67+
- Release 7.0.0-next.5 [`eca532f`](https://github.com/oceanprotocol/ocean.js/commit/eca532f2825adb733b49bc07e9999edecdb0850c)
68+
69+
#### [v7.0.0-next.4](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.3...v7.0.0-next.4)
70+
71+
> 6 April 2026
72+
73+
- devdep libp2p + fix exports [`2362ece`](https://github.com/oceanprotocol/ocean.js/commit/2362ece541681c5f50873aa5f3ce584be7ba139b)
74+
- Release 7.0.0-next.4 [`a82ab55`](https://github.com/oceanprotocol/ocean.js/commit/a82ab55cfaef98fedc281c23ff758d059caff8b1)
75+
76+
#### [v7.0.0-next.3](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.2...v7.0.0-next.3)
77+
78+
> 6 April 2026
79+
80+
- replace uint8arrays lib with native [`9af1c01`](https://github.com/oceanprotocol/ocean.js/commit/9af1c017620f65848bf26f00d30f40e37ff30e77)
81+
- Release 7.0.0-next.3 [`b399086`](https://github.com/oceanprotocol/ocean.js/commit/b399086553c03801acc9d3922eb2131ecec9b928)
82+
- Revert "fix exports name in pacakge json" [`aaf33a9`](https://github.com/oceanprotocol/ocean.js/commit/aaf33a97d3b6af019cfa01ae2ba739c6da720f3a)
83+
84+
#### [v7.0.0-next.2](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.1...v7.0.0-next.2)
85+
86+
> 3 April 2026
87+
88+
- circuit relay [`1465468`](https://github.com/oceanprotocol/ocean.js/commit/1465468442f6f5d5eb93a476e8ba04c02d295a8f)
89+
- libp2p circuit + evict bad connections [`d9cba46`](https://github.com/oceanprotocol/ocean.js/commit/d9cba462d02fedba6c221efbc5aa8e8a080b372e)
90+
- Release 7.0.0-next.2 [`8f33b03`](https://github.com/oceanprotocol/ocean.js/commit/8f33b03b11bf442d7ce0c6a31d905cbde4514508)
91+
92+
#### [v7.0.0-next.1](https://github.com/oceanprotocol/ocean.js/compare/v7.0.0-next.0...v7.0.0-next.1)
93+
94+
> 2 April 2026
95+
96+
- bump uint8arrays to esm supported [`f1ff511`](https://github.com/oceanprotocol/ocean.js/commit/f1ff511e9c92cee94cd129698bc46c7700952461)
97+
- getmultiaddr from peerid [`1973f27`](https://github.com/oceanprotocol/ocean.js/commit/1973f278964598b6c8abb61c85395f0608375d43)
98+
- Release 7.0.0-next.1 [`0a59035`](https://github.com/oceanprotocol/ocean.js/commit/0a5903556fcc2d7e38ccc52b266e15b1ca9e2273)
99+
100+
#### [v7.0.0-next.0](https://github.com/oceanprotocol/ocean.js/compare/v6.1.2...v7.0.0-next.0)
101+
102+
> 1 April 2026
103+
104+
- p2p impl [`68db01f`](https://github.com/oceanprotocol/ocean.js/commit/68db01fbf8f28854e6e0abe43aba85fbf6834c28)
105+
- p2p warmup [`8c2bb5a`](https://github.com/oceanprotocol/ocean.js/commit/8c2bb5ae2b17b5f2c9530800c1f3143b1b318b0e)
106+
- push,fetch config and no tls [`9cda783`](https://github.com/oceanprotocol/ocean.js/commit/9cda78366ddcfe97a93ecb79dc3a8aa3264ccecc)
107+
7108
#### [v6.1.2](https://github.com/oceanprotocol/ocean.js/compare/v6.1.1...v6.1.2)
8109

110+
> 24 March 2026
111+
9112
- Feature/output_in_initializeCompute [`#2056`](https://github.com/oceanprotocol/ocean.js/pull/2056)
113+
- Release 6.1.2 [`3b3cdeb`](https://github.com/oceanprotocol/ocean.js/commit/3b3cdebdb5ce7b89ebbbd2d49e44d5f6fa65e0d1)
10114

11115
#### [v6.1.1](https://github.com/oceanprotocol/ocean.js/compare/v6.1.0...v6.1.1)
12116

@@ -209,7 +313,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
209313
- export util addrs functions [`#2017`](https://github.com/oceanprotocol/ocean.js/pull/2017)
210314
- Release 4.3.6 [`b28db44`](https://github.com/oceanprotocol/ocean.js/commit/b28db446144939e9ed864cc11559f718104d094b)
211315

212-
#### [v4.3.5](https://github.com/oceanprotocol/ocean.js/compare/v4.3.4...v4.3.5)
316+
#### [v4.3.5](https://github.com/oceanprotocol/ocean.js/compare/v4.3.3...v4.3.5)
213317

214318
> 17 November 2025
215319
@@ -218,13 +322,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
218322
- remove typo [`f199f4a`](https://github.com/oceanprotocol/ocean.js/commit/f199f4af809eb85249fe0c59303fcc3207d8e7a7)
219323
- export EnterpriseFeeCollector [`68712a2`](https://github.com/oceanprotocol/ocean.js/commit/68712a2af17824bb8fc78824842376e35f582487)
220324

221-
#### [v4.3.4](https://github.com/oceanprotocol/ocean.js/compare/v4.3.2...v4.3.4)
325+
#### [v4.3.3](https://github.com/oceanprotocol/ocean.js/compare/v4.3.2...v4.3.3)
222326

223-
> 15 November 2025
327+
> 1 August 2025
224328
225329
- add policy server endpoints [`#1974`](https://github.com/oceanprotocol/ocean.js/pull/1974)
226-
- add EnterpriseFee [`b502882`](https://github.com/oceanprotocol/ocean.js/commit/b502882d05375eda326166608730a11e779c6f42)
227-
- Release 4.3.4 [`e45a7de`](https://github.com/oceanprotocol/ocean.js/commit/e45a7defa239f6800eb68a13e1a9a3d9662f509d)
228330
- Release 4.3.3 [`6d6d4cf`](https://github.com/oceanprotocol/ocean.js/commit/6d6d4cfe57f2a3dee73b4957ff2f144c0e7ff9d7)
229331

230332
#### [v4.3.2](https://github.com/oceanprotocol/ocean.js/compare/v4.3.1...v4.3.2)

CodeExamples.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ import {
104104
sendTx,
105105
ConfigHelper,
106106
configHelperNetworks,
107+
getNodeEndpointConfig,
107108
amountToUnits,
108109
getEventFromTx,
109110
LoggerInstance
@@ -206,9 +207,7 @@ Next, we define the metadata that will describe our data asset. This is what we
206207
const config = new ConfigHelper().getConfig(
207208
parseInt(String((await publisherAccount.provider.getNetwork()).chainId))
208209
)
209-
if (process.env.NODE_URL) {
210-
config.oceanNodeUri = process.env.NODE_URL
211-
}
210+
Object.assign(config, getNodeEndpointConfig())
212211
aquarius = new Aquarius(config?.oceanNodeUri)
213212
providerUrl = config?.oceanNodeUri
214213
addresses = JSON.parse(

0 commit comments

Comments
 (0)