Skip to content

Commit 6653263

Browse files
authored
Update ocean.js (#119)
* as any and latest lib * ci * fix build * latest ocean.js * remove any * add asset type * backwards comp
1 parent 898e7fe commit 6653263

6 files changed

Lines changed: 297 additions & 351 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
with:
7272
repository: 'oceanprotocol/barge'
7373
path: 'barge'
74+
ref: 'feature/barge_with_node'
7475

7576
- name: Login to Docker Hub
7677
if: ${{ env.DOCKERHUB_PASSWORD && env.DOCKERHUB_USERNAME }}
@@ -84,7 +85,7 @@ jobs:
8485
- name: Run Barge
8586
working-directory: ${{ github.workspace }}/barge
8687
run: |
87-
bash -x start_ocean.sh --no-aquarius --no-provider --no-dashboard --with-c2d --with-typesense 2>&1 > start_ocean.log &
88+
bash -x start_ocean.sh --with-typesense 2>&1 > start_ocean.log &
8889
- run: npm ci
8990
- run: npm run build
9091
- run: docker image ls
@@ -100,65 +101,34 @@ jobs:
100101
docker image rm -f ubuntu:20.04
101102
docker image rm -f moby/buildkit:latest
102103
rm -rf /usr/share/swift/
103-
104-
- name: Wait for contracts deployment and C2D cluster to be ready
105-
working-directory: ${{ github.workspace }}/barge
104+
- name: Wait for node to be ready
106105
run: |
107-
for i in $(seq 1 250); do
106+
max_attempts=60
107+
attempt=1
108+
echo "Waiting for node container to be ready (timeout: 300s)..."
109+
while [ $attempt -le $max_attempts ]; do
110+
if [ "$(docker inspect -f '{{.State.Running}}' ocean-node-1 2>/dev/null)" = "true" ]; then
111+
echo "Node container is running!"
112+
break
113+
fi
114+
echo "Attempt $attempt/$max_attempts: Node container not ready yet, waiting..."
115+
if [ $attempt -eq $max_attempts ]; then
116+
echo "Error: Node container failed to start within 300 seconds"
117+
docker ps -a
118+
docker inspect ocean-node-1
119+
exit 1
120+
fi
108121
sleep 10
109-
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" -a -f "$HOME/.ocean/ocean-c2d/ready" ] && break
122+
attempt=$((attempt + 1))
110123
done
111-
112124
- name: docker logs
113-
run: docker logs ocean_ocean-contracts_1 && docker logs ocean_kindcluster_1 && docker logs ocean_computetodata_1 && docker logs ocean_typesense_1
125+
run: docker logs ocean-ocean-contracts-1 && docker logs ocean-ganache-1 && docker logs ocean-typesense-1
114126
if: ${{ failure() }}
115127

116-
- name: Checkout Ocean Node
117-
uses: actions/checkout@v3
118-
with:
119-
repository: 'oceanprotocol/ocean-node'
120-
path: 'ocean-node'
121-
ref: 'main'
122-
123-
- name: Start Ocean Node
124-
working-directory: ${{ github.workspace }}/ocean-node
125-
run: |
126-
npm ci
127-
npm run build
128-
npm run start &
129-
env:
130-
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
131-
IPFS_GATEWAY: http://172.15.0.16:8080/
132-
ARWEAVE_GATEWAY: https://arweave.net/
133-
P2P_ipV4BindTcpPort: 8000
134-
HTTP_API_PORT: 8001
135-
RPCS: '{ "8996": {"rpc": "http://127.0.0.1:8545", "chainId": 8996, "network": "development", "chunkSize": 100} }'
136-
DB_URL: 'http://localhost:9200'
137-
DB_TYPE: 'elasticsearch'
138-
FEE_TOKENS: '{ "1": "0x967da4048cD07aB37855c090aAF366e4ce1b9F48", "137": "0x282d8efCe846A88B159800bd4130ad77443Fa1A1", "80001": "0xd8992Ed72C445c35Cb4A2be468568Ed1079357c8", "56": "0xDCe07662CA8EbC241316a15B611c89711414Dd1a" }'
139-
FEE_AMOUNT: '{ "amount": 1, "unit": "MB" }'
140-
AUTHORIZED_DECRYPTERS: '["0xe2DD09d719Da89e5a3D0F2549c7E24566e947260","0x529043886F21D9bc1AE0feDb751e34265a246e47"]'
141-
AUTHORIZED_PUBLISHERS: '["0xe2DD09d719Da89e5a3D0F2549c7E24566e947260","0x529043886F21D9bc1AE0feDb751e34265a246e47"]'
142-
ALLOWED_ADMINS: '["0xe2DD09d719Da89e5a3D0F2549c7E24566e947260"]'
143-
MAX_REQ_PER_MINUTE: 320
144-
MAX_CONNECTIONS_PER_MINUTE: 500
145-
DOCKER_COMPUTE_ENVIRONMENTS: '[{"socketPath":"/var/run/docker.sock","resources":[{"id":"disk","total":1000000000}],"storageExpiry":604800,"maxJobDuration":3600,"fees":{"1":[{"feeToken":"0x123","prices":[{"id":"cpu","price":1}]}]},"free":{"maxJobDuration":60,"maxJobs":3,"resources":[{"id":"cpu","max":1},{"id":"ram","max":1000000000},{"id":"disk","max":1000000000}]}}]'
146-
- name: Check Ocean Node is running
147-
run: |
148-
for i in $(seq 1 30); do
149-
if curl --output /dev/null --silent --head --fail "http://localhost:8001"; then
150-
echo "Ocean Node is up"
151-
exit 0
152-
fi
153-
sleep 10
154-
done
155-
echo "Ocean Node did not start in time"
156-
exit 1
157128
- name: Run system tests
158129
run: npm run test:system
159130
env:
160131
INDEXING_RETRY_INTERVAL: 4000
161132
INDEXING_MAX_RETRIES: 120
162133
NODE_URL: 'http://127.0.0.1:8001'
163-
AVOID_LOOP_RUN: true
164-
134+
AVOID_LOOP_RUN: true

0 commit comments

Comments
 (0)