chore: Use fluence-cli to setup network (#441)

* Use fluence-cli to setup network

* F

* Ignore fluence dir

* Change default relay

* Fix peer ID

* Add provider secrets

* Cleanup

* Fix

* Use unstable nox

* Cleanup

---------

Co-authored-by: Akim Mamedov <akim99999999@gmail.com>
This commit is contained in:
Anatolios Laskaris 2024-02-27 09:53:18 +02:00 committed by GitHub
parent 25faa5af30
commit aea5efb643
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 76 additions and 237 deletions

9
.fluence/env.yaml Normal file
View File

@ -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

View File

@ -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"

29
.fluence/schemas/env.json Normal file
View File

@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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/**
packages/@tests/aqua/src/_aqua/**

View File

@ -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() {

View File

@ -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 = () => {

View File

@ -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;