diff --git a/.fluence/env.yaml b/.fluence/env.yaml new file mode 100644 index 00000000..cacea2c5 --- /dev/null +++ b/.fluence/env.yaml @@ -0,0 +1,9 @@ +# yaml-language-server: $schema=schemas/env.json + +# Defines user project preferences + +# Documentation: https://github.com/fluencelabs/cli/tree/main/docs/configs/env.md + +version: 0 + +fluenceEnv: local diff --git a/.fluence/provider-secrets.yaml b/.fluence/provider-secrets.yaml new file mode 100644 index 00000000..3d79c1bd --- /dev/null +++ b/.fluence/provider-secrets.yaml @@ -0,0 +1,18 @@ +# yaml-language-server: $schema=schemas/provider-secrets.json + +# Defines secrets config used for provider set up + +# Documentation: https://github.com/fluencelabs/cli/tree/main/docs/configs/provider-secrets.md + +version: 0 + +noxes: + nox-0: + networkKey: t/7R5m9TprvbWFwr2ZKe8hm6UW84ulDq4pVbDvHUCdw= + signingWallet: "0x3785b85a34b65082664bdb2ccb47fba6aab6984b7c16b36ad54145eecc368e4c" + nox-1: + networkKey: +5VkzeaILY+Emk9zsLKJ82dzzF3fMmlFkNhkJVwDMdo= + signingWallet: "0xd9a5eee84979d0cf118f82f7c97ca6980e6a21db0c7271a3d59248841ed04d83" + nox-2: + networkKey: YNq7A6KlPhdyJwq7y3meTIPUVQ34HFwW21MlsDjpxsM= + signingWallet: "0x16e3984df2918538c5dbba032f00a5ecd5900b9c43a36b38ed89b6be1820a9ba" diff --git a/.fluence/schemas/env.json b/.fluence/schemas/env.json new file mode 100644 index 00000000..53bb4492 --- /dev/null +++ b/.fluence/schemas/env.json @@ -0,0 +1,29 @@ +{ + "$id": "https://fluence.dev/schemas/env.yaml", + "title": "env.yaml", + "type": "object", + "description": "Defines user project preferences", + "properties": { + "fluenceEnv": { + "title": "Fluence environment", + "description": "Fluence environment to connect to", + "type": "string", + "enum": [ + "dar", + "stage", + "kras", + "local", + "custom" + ], + "nullable": true + }, + "version": { + "type": "number", + "const": 0 + } + }, + "required": [ + "version" + ], + "additionalProperties": false +} diff --git a/.github/e2e/docker-compose.yml b/.github/e2e/docker-compose.yml deleted file mode 100644 index 76a0665f..00000000 --- a/.github/e2e/docker-compose.yml +++ /dev/null @@ -1,208 +0,0 @@ -networks: - nox: - driver: bridge - ipam: - config: - - subnet: 10.50.10.0/24 - -services: - aurora: - image: docker.fluence.dev/aurora:0.2.11 - ports: - - 8545:8545 - networks: - nox: - - ipfs: - image: ipfs/go-ipfs - ports: - - 5001:5001 - - 4001:4001 - environment: - IPFS_PROFILE: server - volumes: - - ./ipfs/:/container-init.d/ - networks: - nox: - ipv4_address: 10.50.10.100 - - nox-1: - image: ${NOX_IMAGE} - ports: - - 7771:7771 - - 9991:9991 - environment: - FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - FLUENCE_ENV_CONNECTOR_API_ENDPOINT: http://aurora:8545 - FLUENCE_ENV_CONNECTOR_CONTRACT_ADDRESS: "0xea6777e8c011E7968605fd012A9Dd49401ec386C" - FLUENCE_ENV_CONNECTOR_FROM_BLOCK: earliest - FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - RUST_LOG: "info,aquamarine=warn,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,cranelift_codegen=info,wasmer_wasi=info,run-console=debug" - command: - - --aqua-pool-size=2 - - -t=7771 - - -w=9991 - - -x=10.50.10.10 - - --external-maddrs - - /ip4/127.0.0.1/tcp/7771 - - /ip4/127.0.0.1/tcp/9991/ws - - --allow-private-ips - - --local - # - --bootstraps=/dns/nox-1/tcp/7771 - # 12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR - - -k=hK62afickoeP2uZbmSkAYXxxqP8ozq16VRN7qfTP719EHC5V5tjrtW57BSjUr8GvsEXmJRbtejUWyPZ2rZMyQdq - depends_on: - - ipfs - networks: - nox: - ipv4_address: 10.50.10.10 - - nox-2: - image: ${NOX_IMAGE} - ports: - - 7772:7772 - - 9992:9992 - environment: - FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - FLUENCE_ENV_CONNECTOR_API_ENDPOINT: http://aurora:8545 - FLUENCE_ENV_CONNECTOR_CONTRACT_ADDRESS: "0xea6777e8c011E7968605fd012A9Dd49401ec386C" - FLUENCE_ENV_CONNECTOR_FROM_BLOCK: earliest - FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - RUST_LOG: "info,aquamarine=warn,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,cranelift_codegen=info,wasmer_wasi=info,run-console=debug" - command: - - --aqua-pool-size=2 - - -t=7772 - - -w=9992 - - -x=10.50.10.20 - - --external-maddrs - - /ip4/127.0.0.1/tcp/7772 - - /ip4/127.0.0.1/tcp/9992/ws - - --allow-private-ips - - --bootstraps=/dns/nox-1/tcp/7771 - # 12D3KooWQdpukY3p2DhDfUfDgphAqsGu5ZUrmQ4mcHSGrRag6gQK - - -k=2WijTVdhVRzyZamWjqPx4V4iNMrajegNMwNa2PmvPSZV6RRpo5M2fsPWdQr22HVRubuJhhSw8BrWiGt6FPhFAuXy - depends_on: - - ipfs - networks: - nox: - ipv4_address: 10.50.10.20 - - nox-3: - image: ${NOX_IMAGE} - ports: - - 7773:7773 - - 9993:9993 - environment: - FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - FLUENCE_ENV_CONNECTOR_API_ENDPOINT: http://aurora:8545 - FLUENCE_ENV_CONNECTOR_CONTRACT_ADDRESS: "0xea6777e8c011E7968605fd012A9Dd49401ec386C" - FLUENCE_ENV_CONNECTOR_FROM_BLOCK: earliest - FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - RUST_LOG: "info,aquamarine=warn,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,cranelift_codegen=info,wasmer_wasi=info,run-console=debug" - command: - - --aqua-pool-size=2 - - -t=7773 - - -w=9993 - - -x=10.50.10.30 - - --external-maddrs - - /ip4/127.0.0.1/tcp/7773 - - /ip4/127.0.0.1/tcp/9993/ws - - --allow-private-ips - - --bootstraps=/dns/nox-1/tcp/7771 - # 12D3KooWRT8V5awYdEZm6aAV9HWweCEbhWd7df4wehqHZXAB7yMZ - - -k=2n2wBVanBeu2GWtvKBdrYK9DJAocgG3PrTUXMharq6TTfxqTL4sLdXL9BF23n6rsnkAY5pR9vBtx2uWYDQAiZdrX - depends_on: - - ipfs - networks: - nox: - ipv4_address: 10.50.10.30 - - nox-4: - image: ${NOX_IMAGE} - ports: - - 7774:7774 - - 9994:9994 - environment: - FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - FLUENCE_ENV_CONNECTOR_API_ENDPOINT: http://aurora:8545 - FLUENCE_ENV_CONNECTOR_CONTRACT_ADDRESS: "0xea6777e8c011E7968605fd012A9Dd49401ec386C" - FLUENCE_ENV_CONNECTOR_FROM_BLOCK: earliest - FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - RUST_LOG: "info,aquamarine=warn,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,cranelift_codegen=info,wasmer_wasi=info,run-console=debug" - command: - - --aqua-pool-size=2 - - -t=7774 - - -w=9994 - - -x=10.50.10.40 - - --external-maddrs - - /ip4/127.0.0.1/tcp/7774 - - /ip4/127.0.0.1/tcp/9994/ws - - --allow-private-ips - - --bootstraps=/dns/nox-1/tcp/7771 - # 12D3KooWBzLSu9RL7wLP6oUowzCbkCj2AGBSXkHSJKuq4wwTfwof - - -k=4zp8ucAikkjB8CmkufYiFBW4QCDUCbQG7yMjviX7W8bMyN5rfChQ2Pi5QCWThrCTbAm9uq5nbFbxtFcNZq3De4dX - depends_on: - - ipfs - networks: - nox: - ipv4_address: 10.50.10.40 - - nox-5: - image: ${NOX_IMAGE} - ports: - - 7775:7775 - - 9995:9995 - environment: - FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - FLUENCE_ENV_CONNECTOR_API_ENDPOINT: http://aurora:8545 - FLUENCE_ENV_CONNECTOR_CONTRACT_ADDRESS: "0xea6777e8c011E7968605fd012A9Dd49401ec386C" - FLUENCE_ENV_CONNECTOR_FROM_BLOCK: earliest - FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - RUST_LOG: "info,aquamarine=warn,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,cranelift_codegen=info,wasmer_wasi=info,run-console=debug" - command: - - --aqua-pool-size=2 - - -t=7775 - - -w=9995 - - -x=10.50.10.50 - - --external-maddrs - - /ip4/127.0.0.1/tcp/7775 - - /ip4/127.0.0.1/tcp/9995/ws - - --allow-private-ips - - --bootstraps=/dns/nox-1/tcp/7771 - # 12D3KooWBf6hFgrnXwHkBnwPGMysP3b1NJe5HGtAWPYfwmQ2MBiU - - -k=3ry26rm5gkJXvdqRH4FoM3ezWq4xVVsBQF7wtKq4E4pbuaa6p1F84tNqifUS7DdfJL9hs2gcdW64Wc342vHZHMUp - depends_on: - - ipfs - networks: - nox: - ipv4_address: 10.50.10.50 - - nox-6: - image: ${NOX_IMAGE} - ports: - - 7776:7776 - - 9996:9996 - environment: - FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - FLUENCE_ENV_CONNECTOR_API_ENDPOINT: http://aurora:8545 - FLUENCE_ENV_CONNECTOR_CONTRACT_ADDRESS: "0xea6777e8c011E7968605fd012A9Dd49401ec386C" - FLUENCE_ENV_CONNECTOR_FROM_BLOCK: earliest - FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR: "/ip4/10.50.10.100/tcp/5001" - RUST_LOG: "info,aquamarine=warn,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,cranelift_codegen=info,wasmer_wasi=info,run-console=debug" - command: - - --aqua-pool-size=2 - - -t=7776 - - -w=9996 - - --bootstraps=/dns/nox-1/tcp/7771 - - -x=10.50.10.60 - - --external-maddrs - - /ip4/127.0.0.1/tcp/7776 - - /ip4/127.0.0.1/tcp/9996/ws - - --allow-private-ips - # 12D3KooWPisGn7JhooWhggndz25WM7vQ2JmA121EV8jUDQ5xMovJ - - -k=5Qh8bB1sF28uLPwr3HTvEksCeC6mAWQvebCfcgv9y6j4qKwSzNKm2tzLUg4nACUEo2KZpBw11gNCnwaAdM7o1pEn - depends_on: - - ipfs - networks: - nox: - ipv4_address: 10.50.10.60 \ No newline at end of file diff --git a/.github/e2e/ipfs/01-configure.sh b/.github/e2e/ipfs/01-configure.sh deleted file mode 100755 index 344e5e86..00000000 --- a/.github/e2e/ipfs/01-configure.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -ipfs bootstrap rm --all - -ipfs config Addresses.API "/ip4/0.0.0.0/tcp/5001" -ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8001" -ipfs config --json Addresses.Swarm '["/ip4/0.0.0.0/tcp/4001", "/ip4/0.0.0.0/tcp/4001/ws"]' -ipfs config --json Addresses.Announce '["/ip4/10.50.10.1/tcp/4001", "/ip4/10.50.10.1/tcp/4001/ws"]' - -ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]' -ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]' - -ipfs config --json Pubsub.Enabled true diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index dc7f4705..a93f8e23 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -43,7 +43,6 @@ jobs: uses: fluencelabs/aqua/.github/workflows/tests.yml@main with: js-client-snapshots: "${{ needs.js-client.outputs.js-client-snapshots }}" - nox-image: "docker.fluence.dev/nox:renovate-avm_4905_1" flox: needs: - js-client @@ -51,4 +50,3 @@ jobs: uses: fluencelabs/flox/.github/workflows/tests.yml@main with: js-client-snapshots: "${{ needs.js-client.outputs.js-client-snapshots }}" - nox-image: "docker.fluence.dev/nox:renovate-avm_4905_1" \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0c383bc6..3b2db7f9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ on: nox-image: description: "nox image tag" type: string - default: "fluencelabs/nox:0.4.2" + default: "fluencelabs/nox:unstable" avm-version: description: "@fluencelabs/avm version" type: string @@ -21,9 +21,9 @@ on: default: "main" env: - NOX_IMAGE: "${{ inputs.nox-image }}" FORCE_COLOR: true CI: true + FCLI_V_NOX: "${{ inputs.nox-image }}" jobs: js-client: @@ -70,14 +70,17 @@ jobs: repository: fluencelabs/fluence-js ref: ${{ inputs.ref }} - - name: Pull nox image - run: docker pull $NOX_IMAGE + - name: Setup fcli + uses: fluencelabs/setup-fluence@v1 + with: + artifact: fcli + version: unstable + + - name: Init local env with fcli + run: fluence local init --no-input - name: Run nox network - uses: isbang/compose-action@v1.4.1 - with: - compose-file: ".github/e2e/docker-compose.yml" - down-flags: "--volumes" + run: fluence local up - name: Setup pnpm uses: pnpm/action-setup@v2.2.4 diff --git a/.prettierignore b/.prettierignore index a11c789f..667fa5c1 100644 --- a/.prettierignore +++ b/.prettierignore @@ -7,10 +7,12 @@ dist build public +.fluence + **/CHANGELOG.md # TODO: remove after pnpm-set-deps will add \n symbol at the end of these files **/package.json packages/core/js-client-isomorphic/src/versions.ts __snapshots__ -packages/@tests/aqua/src/_aqua/** \ No newline at end of file +packages/@tests/aqua/src/_aqua/** diff --git a/packages/@tests/aqua/src/index.ts b/packages/@tests/aqua/src/index.ts index c5a47205..e659578d 100644 --- a/packages/@tests/aqua/src/index.ts +++ b/packages/@tests/aqua/src/index.ts @@ -26,8 +26,8 @@ import { wasm } from "./wasmb64.js"; const relay = { multiaddr: - "/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR", - peerId: "12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR", + "/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWBbMuqJJZT7FTFN4fWg3k3ipUKx6KEy7pDy8mdorK5g5o", + peerId: "12D3KooWBbMuqJJZT7FTFN4fWg3k3ipUKx6KEy7pDy8mdorK5g5o", }; function generateRandomUint8Array() { diff --git a/packages/@tests/smoke/web/public/index.js b/packages/@tests/smoke/web/public/index.js index 00175878..9f0ac983 100644 --- a/packages/@tests/smoke/web/public/index.js +++ b/packages/@tests/smoke/web/public/index.js @@ -2,8 +2,8 @@ import { Fluence, callAquaFunction, randomStage } from "./js-client.min.js"; const relay = { multiaddr: - "/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR", - peerId: "12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR", + "/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWBbMuqJJZT7FTFN4fWg3k3ipUKx6KEy7pDy8mdorK5g5o", + peerId: "12D3KooWBbMuqJJZT7FTFN4fWg3k3ipUKx6KEy7pDy8mdorK5g5o", }; const getRelayTime = () => { diff --git a/packages/core/js-client/src/clientPeer/__test__/connection.ts b/packages/core/js-client/src/clientPeer/__test__/connection.ts index 07e569b1..2174dc09 100644 --- a/packages/core/js-client/src/clientPeer/__test__/connection.ts +++ b/packages/core/js-client/src/clientPeer/__test__/connection.ts @@ -17,8 +17,8 @@ export const nodes = [ { multiaddr: - "/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR", - peerId: "12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR", + "/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWBbMuqJJZT7FTFN4fWg3k3ipUKx6KEy7pDy8mdorK5g5o", + peerId: "12D3KooWBbMuqJJZT7FTFN4fWg3k3ipUKx6KEy7pDy8mdorK5g5o", }, ] as const;