add relay listen #6298
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'CI' | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '**' | |
| pull_request: | |
| branches: | |
| - '**' | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'v22.15.0' | |
| - name: Cache node_modules | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-lint-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: ${{ runner.os }}-lint-${{ env.cache-name }}- | |
| - run: npm ci | |
| - run: npm run lint | |
| dockertest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: docker build -t 'ocean-node:mybuild' . | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| node: ['18.20.4', 'v20.19.0', 'v22.15.0'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Cache node_modules | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}- | |
| - run: npm ci | |
| - run: npm run build | |
| test_unit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'v22.15.0' | |
| - name: Cache node_modules | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-test-unit-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: ${{ runner.os }}-test-unit-${{ env.cache-name }}- | |
| - run: npm ci | |
| - run: npm run test:unit:cover | |
| env: | |
| PRIVATE_KEY: ${{ secrets.NODE1_PRIVATE_KEY }} | |
| NODE1_PRIVATE_KEY: ${{ secrets.NODE1_PRIVATE_KEY }} | |
| NODE2_PRIVATE_KEY: ${{ secrets.NODE2_PRIVATE_KEY }} | |
| NODE3_PRIVATE_KEY: ${{ secrets.NODE3_PRIVATE_KEY }} | |
| IPFS_GATEWAY: http://172.15.0.16:8080/ | |
| ARWEAVE_GATEWAY: https://arweave.net/ | |
| RPCS: '{ "1": {"rpc": "https://rpc.eth.gateway.fm", "chainId": 1, "network": "mainet", "chunkSize": 100}, "137": {"rpc": "https://polygon.meowrpc.com", "chainId": 137, "network": "polygon", "chunkSize": 100 }, "80001": {"rpc": "https://rpc-mumbai.maticvigil.com","chainId": 80001, "network": "polygon-mumbai", "chunkSize": 100 } }' | |
| DB_URL: 'http://localhost:8108/?apiKey=xyz' | |
| DB_TYPE: 'typesense' | |
| DB_USERNAME: 'elastic' | |
| DB_PASSWORD: 'changeme' | |
| FEE_TOKENS: '{ "1": "0x967da4048cD07aB37855c090aAF366e4ce1b9F48", "137": "0x282d8efCe846A88B159800bd4130ad77443Fa1A1", "80001": "0xd8992Ed72C445c35Cb4A2be468568Ed1079357c8", "56": "0xDCe07662CA8EbC241316a15B611c89711414Dd1a" }' | |
| FEE_AMOUNT: '{ "amount": 1, "unit": "MB" }' | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage/ | |
| test_integration: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'v22.15.0' | |
| - name: Cache node_modules | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-test-integration-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: ${{ runner.os }}-test-integration-${{ env.cache-name }}- | |
| - name: Set ADDRESS_FILE | |
| run: echo "ADDRESS_FILE=${HOME}/.ocean/ocean-contracts/artifacts/address.json" >> $GITHUB_ENV | |
| - name: Checkout Barge | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'oceanprotocol/barge' | |
| path: 'barge' | |
| - name: Login to Docker Hub | |
| if: ${{ env.DOCKERHUB_PASSWORD && env.DOCKERHUB_USERNAME }} | |
| run: | | |
| echo "Login to Docker Hub";echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin | |
| env: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: Run Barge | |
| working-directory: ${{ github.workspace }}/barge | |
| run: | | |
| bash -x start_ocean.sh --no-node --with-typesense 2>&1 > start_ocean.log & | |
| - run: npm ci | |
| - run: npm run build | |
| - run: docker image ls | |
| - name: Delete default runner images | |
| run: | | |
| rm -rf /usr/share/swift/ | |
| - name: Wait for contracts deployment | |
| working-directory: ${{ github.workspace }}/barge | |
| run: | | |
| for i in $(seq 1 250); do | |
| sleep 5 | |
| [ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" ] && break | |
| done | |
| - name: docker logs | |
| run: docker logs ocean-ocean-contracts-1 && docker logs ocean-typesense-1 | |
| if: ${{ failure() }} | |
| - name: Set DOCKER_REGISTRY_AUTHS from Docker Hub secrets | |
| if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_PASSWORD | |
| run: | | |
| DOCKER_REGISTRY_AUTHS=$(jq -n \ | |
| --arg username "$DOCKERHUB_USERNAME" \ | |
| --arg password "$DOCKERHUB_PASSWORD" \ | |
| '{ "https://registry-1.docker.io": { "username": $username, "password": $password } }') | |
| echo "DOCKER_REGISTRY_AUTHS<<EOF" >> $GITHUB_ENV | |
| echo "$DOCKER_REGISTRY_AUTHS" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| env: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: integration tests | |
| run: npm run test:integration:cover | |
| env: | |
| # OPERATOR_SERVICE_URL: '["http://172.15.0.13:31000"]' | |
| PRIVATE_KEY: ${{ secrets.NODE1_PRIVATE_KEY }} | |
| NODE1_PRIVATE_KEY: ${{ secrets.NODE1_PRIVATE_KEY }} | |
| NODE2_PRIVATE_KEY: ${{ secrets.NODE2_PRIVATE_KEY }} | |
| NODE3_PRIVATE_KEY: ${{ secrets.NODE3_PRIVATE_KEY }} | |
| IPFS_GATEWAY: http://172.15.0.16:8080/ | |
| ARWEAVE_GATEWAY: https://arweave.net/ | |
| RPCS: '{ "8996": {"rpc": "http://127.0.0.1:8545", "chainId": 8996, "network": "development", "chunkSize": 100}}' | |
| DB_URL: 'http://localhost:9200' | |
| DB_TYPE: 'elasticsearch' | |
| FEE_TOKENS: '{ "1": "0x967da4048cD07aB37855c090aAF366e4ce1b9F48", "137": "0x282d8efCe846A88B159800bd4130ad77443Fa1A1", "80001": "0xd8992Ed72C445c35Cb4A2be468568Ed1079357c8", "56": "0xDCe07662CA8EbC241316a15B611c89711414Dd1a" }' | |
| FEE_AMOUNT: '{ "amount": 1, "unit": "MB" }' | |
| ASSET_PURGATORY_URL: 'https://raw.githubusercontent.com/oceanprotocol/list-purgatory/main/list-assets.json' | |
| ACCOUNT_PURGATORY_URL: 'https://raw.githubusercontent.com/oceanprotocol/list-purgatory/main/list-accounts.json' | |
| DOCKER_REGISTRY_AUTHS: ${{ env.DOCKER_REGISTRY_AUTHS }} | |
| - name: docker logs | |
| run: docker logs ocean-ocean-contracts-1 && docker logs ocean-typesense-1 | |
| if: ${{ failure() }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage/ | |
| test_system: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'v22.15.0' | |
| - name: Cache node_modules | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-test-integration-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: ${{ runner.os }}-test-integration-${{ env.cache-name }}- | |
| - name: Set ADDRESS_FILE | |
| run: echo "ADDRESS_FILE=${HOME}/.ocean/ocean-contracts/artifacts/address.json" >> $GITHUB_ENV | |
| - name: Checkout Barge | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'oceanprotocol/barge' | |
| path: 'barge' | |
| - name: Login to Docker Hub | |
| if: ${{ env.DOCKERHUB_PASSWORD && env.DOCKERHUB_USERNAME }} | |
| run: | | |
| echo "Login to Docker Hub" | |
| echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin | |
| env: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: Run Barge | |
| working-directory: ${{ github.workspace }}/barge | |
| run: | | |
| bash -x start_ocean.sh --no-node --with-typesense 2>&1 > start_ocean.log & | |
| - run: npm ci | |
| - run: npm run build | |
| - run: docker image ls | |
| - name: Delete default runner images | |
| run: | | |
| rm -rf /usr/share/swift/ | |
| - name: Wait for contracts deployment and C2D cluster to be ready | |
| working-directory: ${{ github.workspace }}/barge | |
| run: | | |
| for i in $(seq 1 250); do | |
| sleep 10 | |
| [ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" ] && break | |
| done | |
| - name: docker logs | |
| run: docker logs ocean-contracts-1 && docker logs ocean-typesense-1 | |
| if: ${{ failure() }} | |
| - name: Checkout Ocean Node | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'oceanprotocol/ocean-node' | |
| path: 'ocean-node' | |
| ref: ${{ github.event_name == 'pull_request' && github.head_ref || 'main' }} | |
| - name: Set DOCKER_REGISTRY_AUTHS from Docker Hub secrets | |
| if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_PASSWORD | |
| run: | | |
| DOCKER_REGISTRY_AUTHS=$(jq -n \ | |
| --arg username "$DOCKERHUB_USERNAME" \ | |
| --arg password "$DOCKERHUB_PASSWORD" \ | |
| '{ "https://registry-1.docker.io": { "username": $username, "password": $password } }') | |
| echo "DOCKER_REGISTRY_AUTHS<<EOF" >> $GITHUB_ENV | |
| echo "$DOCKER_REGISTRY_AUTHS" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| env: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: Start Ocean Node | |
| working-directory: ${{ github.workspace }}/ocean-node | |
| run: | | |
| npm ci | |
| npm run build | |
| npm run start > ocean-node.log 2>&1 & | |
| env: | |
| PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | |
| IPFS_GATEWAY: http://172.15.0.16:8080/ | |
| ARWEAVE_GATEWAY: https://arweave.net/ | |
| P2P_ipV4BindTcpPort: 8000 | |
| HTTP_API_PORT: 8001 | |
| RPCS: '{ "8996": {"rpc": "http://127.0.0.1:8545", "chainId": 8996, "network": "development", "chunkSize": 100} }' | |
| INDEXER_NETWORKS: '[8996]' | |
| DB_URL: 'http://localhost:9200' | |
| FEE_TOKENS: '{ "1": "0x967da4048cD07aB37855c090aAF366e4ce1b9F48", "137": "0x282d8efCe846A88B159800bd4130ad77443Fa1A1", "80001": "0xd8992Ed72C445c35Cb4A2be468568Ed1079357c8", "56": "0xDCe07662CA8EbC241316a15B611c89711414Dd1a" }' | |
| FEE_AMOUNT: '{ "amount": 1, "unit": "MB" }' | |
| AUTHORIZED_DECRYPTERS: '["0xe2DD09d719Da89e5a3D0F2549c7E24566e947260"]' | |
| P2P_ENABLE_UPNP: 'false' | |
| P2P_ENABLE_AUTONAT: 'false' | |
| ALLOWED_ADMINS: '["0xe2DD09d719Da89e5a3D0F2549c7E24566e947260"]' | |
| DB_TYPE: 'elasticsearch' | |
| DB_USERNAME: 'elastic' | |
| DB_PASSWORD: 'changeme' | |
| MAX_REQ_PER_MINUTE: 320 | |
| MAX_CONNECTIONS_PER_MINUTE: 320 | |
| DOCKER_COMPUTE_ENVIRONMENTS: '[{"socketPath":"/var/run/docker.sock","resources":[{"id":"disk","total":10}],"storageExpiry":604800,"maxJobDuration":3600,"minJobDuration": 60,"fees":{"8996":[{"prices":[{"id":"cpu","price":1}]}]},"free":{"maxJobDuration":60,"minJobDuration": 10,"maxJobs":3,"resources":[{"id":"cpu","max":1},{"id":"ram","max":1},{"id":"disk","max":1}]}}]' | |
| DOCKER_REGISTRY_AUTHS: ${{ env.DOCKER_REGISTRY_AUTHS }} | |
| - name: Check Ocean Node is running | |
| run: | | |
| for i in $(seq 1 90); do | |
| if curl --output /dev/null --silent --head --fail "http://localhost:8001"; then | |
| echo "Ocean Node is up" | |
| exit 0 | |
| fi | |
| sleep 10 | |
| done | |
| echo "Ocean Node did not start in time" | |
| exit 1 | |
| - name: Checkout Ocean CLI | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'oceanprotocol/ocean-cli' | |
| path: 'ocean-cli' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'v20.19.0' | |
| - name: Checkout Ocean-js | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'oceanprotocol/ocean.js' | |
| path: 'ocean.js' | |
| ref: main | |
| - name: Build ocean-js | |
| working-directory: ${{ github.workspace }}/ocean.js | |
| run: | | |
| npm ci | |
| npm run build | |
| npm link | |
| - name: Setup Ocean CLI | |
| working-directory: ${{ github.workspace }}/ocean-cli | |
| run: | | |
| npm ci | |
| npm link @oceanprotocol/lib | |
| npm run build | |
| - name: Run system tests | |
| working-directory: ${{ github.workspace }}/ocean-cli | |
| run: npm run test:system | |
| env: | |
| AVOID_LOOP_RUN: true | |
| - name: Show Ocean Node logs on failure | |
| if: failure() | |
| working-directory: ${{ github.workspace }}/ocean-node | |
| run: | | |
| echo "=== Ocean Node Logs ===" | |
| if [ -f ocean-node.log ]; then | |
| cat ocean-node.log | |
| else | |
| echo "No ocean-node.log file found" | |
| fi | |
| echo "=== Docker Logs ===" | |
| docker logs ocean-contracts-1 || echo "No ocean-contracts-1 container" | |
| docker logs ocean-typesense-1 || echo "No ocean-typesense-1 container" | |
| echo "=== System Processes ===" | |
| ps aux | grep -E "(node|ocean)" || echo "No node/ocean processes found" |