mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-04-25 09:52:12 +00:00
feat: support signatures [fixes DXJ-389]
This commit is contained in:
parent
b9f549f54a
commit
44a5cf9d70
208
.github/e2e/docker-compose.yml
vendored
208
.github/e2e/docker-compose.yml
vendored
@ -1,12 +1,208 @@
|
|||||||
|
networks:
|
||||||
|
fluence:
|
||||||
|
driver: bridge
|
||||||
|
ipam:
|
||||||
|
config:
|
||||||
|
- subnet: 10.50.10.0/24
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
aurora:
|
||||||
|
image: docker.fluence.dev/aurora:main-9e7523f-4-1
|
||||||
|
ports:
|
||||||
|
- 8545:8545
|
||||||
|
networks:
|
||||||
|
fluence:
|
||||||
|
|
||||||
|
ipfs:
|
||||||
|
image: ipfs/go-ipfs
|
||||||
|
ports:
|
||||||
|
- 5001:5001
|
||||||
|
- 4001:4001
|
||||||
|
environment:
|
||||||
|
IPFS_PROFILE: server
|
||||||
|
volumes:
|
||||||
|
- ./ipfs/:/container-init.d/
|
||||||
|
networks:
|
||||||
|
fluence:
|
||||||
|
ipv4_address: 10.50.10.100
|
||||||
|
|
||||||
fluence-1:
|
fluence-1:
|
||||||
image: ${RUST_PEER_IMAGE}
|
image: ${RUST_PEER_IMAGE}
|
||||||
ports:
|
ports:
|
||||||
- 1210:1210
|
- 7771:7771
|
||||||
- 4310:4310
|
- 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:
|
command:
|
||||||
- -t=1210
|
|
||||||
- -w=4310
|
|
||||||
- --local
|
|
||||||
- -k=gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj
|
|
||||||
- --aqua-pool-size=2
|
- --aqua-pool-size=2
|
||||||
|
- -t=7771
|
||||||
|
- -w=9991
|
||||||
|
- -x=10.50.10.10
|
||||||
|
- --external-maddrs
|
||||||
|
- /dns4/fluence-1/tcp/7771
|
||||||
|
- /dns4/fluence-1/tcp/9991/ws
|
||||||
|
- --allow-private-ips
|
||||||
|
- --local
|
||||||
|
# - --bootstraps=/dns/fluence-1/tcp/7771
|
||||||
|
# 12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR
|
||||||
|
- -k=hK62afickoeP2uZbmSkAYXxxqP8ozq16VRN7qfTP719EHC5V5tjrtW57BSjUr8GvsEXmJRbtejUWyPZ2rZMyQdq
|
||||||
|
depends_on:
|
||||||
|
- ipfs
|
||||||
|
networks:
|
||||||
|
fluence:
|
||||||
|
ipv4_address: 10.50.10.10
|
||||||
|
|
||||||
|
fluence-2:
|
||||||
|
image: ${RUST_PEER_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
|
||||||
|
- /dns4/fluence-2/tcp/7772
|
||||||
|
- /dns4/fluence-2/tcp/9992/ws
|
||||||
|
- --allow-private-ips
|
||||||
|
- --bootstraps=/dns/fluence-1/tcp/7771
|
||||||
|
# 12D3KooWQdpukY3p2DhDfUfDgphAqsGu5ZUrmQ4mcHSGrRag6gQK
|
||||||
|
- -k=2WijTVdhVRzyZamWjqPx4V4iNMrajegNMwNa2PmvPSZV6RRpo5M2fsPWdQr22HVRubuJhhSw8BrWiGt6FPhFAuXy
|
||||||
|
depends_on:
|
||||||
|
- ipfs
|
||||||
|
networks:
|
||||||
|
fluence:
|
||||||
|
ipv4_address: 10.50.10.20
|
||||||
|
|
||||||
|
fluence-3:
|
||||||
|
image: ${RUST_PEER_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
|
||||||
|
- /dns4/fluence-3/tcp/7773
|
||||||
|
- /dns4/fluence-3/tcp/9993/ws
|
||||||
|
- --allow-private-ips
|
||||||
|
- --bootstraps=/dns/fluence-1/tcp/7771
|
||||||
|
# 12D3KooWRT8V5awYdEZm6aAV9HWweCEbhWd7df4wehqHZXAB7yMZ
|
||||||
|
- -k=2n2wBVanBeu2GWtvKBdrYK9DJAocgG3PrTUXMharq6TTfxqTL4sLdXL9BF23n6rsnkAY5pR9vBtx2uWYDQAiZdrX
|
||||||
|
depends_on:
|
||||||
|
- ipfs
|
||||||
|
networks:
|
||||||
|
fluence:
|
||||||
|
ipv4_address: 10.50.10.30
|
||||||
|
|
||||||
|
fluence-4:
|
||||||
|
image: ${RUST_PEER_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
|
||||||
|
- /dns4/fluence-4/tcp/7774
|
||||||
|
- /dns4/fluence-4/tcp/9994/ws
|
||||||
|
- --allow-private-ips
|
||||||
|
- --bootstraps=/dns/fluence-1/tcp/7771
|
||||||
|
# 12D3KooWBzLSu9RL7wLP6oUowzCbkCj2AGBSXkHSJKuq4wwTfwof
|
||||||
|
- -k=4zp8ucAikkjB8CmkufYiFBW4QCDUCbQG7yMjviX7W8bMyN5rfChQ2Pi5QCWThrCTbAm9uq5nbFbxtFcNZq3De4dX
|
||||||
|
depends_on:
|
||||||
|
- ipfs
|
||||||
|
networks:
|
||||||
|
fluence:
|
||||||
|
ipv4_address: 10.50.10.40
|
||||||
|
|
||||||
|
fluence-5:
|
||||||
|
image: ${RUST_PEER_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
|
||||||
|
- /dns4/fluence-5/tcp/7775
|
||||||
|
- /dns4/fluence-5/tcp/9995/ws
|
||||||
|
- --allow-private-ips
|
||||||
|
- --bootstraps=/dns/fluence-1/tcp/7771
|
||||||
|
# 12D3KooWBf6hFgrnXwHkBnwPGMysP3b1NJe5HGtAWPYfwmQ2MBiU
|
||||||
|
- -k=3ry26rm5gkJXvdqRH4FoM3ezWq4xVVsBQF7wtKq4E4pbuaa6p1F84tNqifUS7DdfJL9hs2gcdW64Wc342vHZHMUp
|
||||||
|
depends_on:
|
||||||
|
- ipfs
|
||||||
|
networks:
|
||||||
|
fluence:
|
||||||
|
ipv4_address: 10.50.10.50
|
||||||
|
|
||||||
|
fluence-6:
|
||||||
|
image: ${RUST_PEER_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/fluence-1/tcp/7771
|
||||||
|
- -x=10.50.10.60
|
||||||
|
- --external-maddrs
|
||||||
|
- /dns4/fluence-6/tcp/7776
|
||||||
|
- /dns4/fluence-6/tcp/9996/ws
|
||||||
|
- --allow-private-ips
|
||||||
|
# 12D3KooWPisGn7JhooWhggndz25WM7vQ2JmA121EV8jUDQ5xMovJ
|
||||||
|
- -k=5Qh8bB1sF28uLPwr3HTvEksCeC6mAWQvebCfcgv9y6j4qKwSzNKm2tzLUg4nACUEo2KZpBw11gNCnwaAdM7o1pEn
|
||||||
|
depends_on:
|
||||||
|
- ipfs
|
||||||
|
networks:
|
||||||
|
fluence:
|
||||||
|
ipv4_address: 10.50.10.60
|
||||||
|
12
.github/e2e/ipfs/01-configure.sh
vendored
Executable file
12
.github/e2e/ipfs/01-configure.sh
vendored
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/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
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -55,7 +55,7 @@ jobs:
|
|||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v2.2.4
|
uses: pnpm/action-setup@v2.2.4
|
||||||
with:
|
with:
|
||||||
version: 7
|
version: 8
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
@ -105,7 +105,7 @@ jobs:
|
|||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v2.2.4
|
uses: pnpm/action-setup@v2.2.4
|
||||||
with:
|
with:
|
||||||
version: 7
|
version: 8
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
|
2
.github/workflows/snapshot.yml
vendored
2
.github/workflows/snapshot.yml
vendored
@ -45,7 +45,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: pnpm/action-setup@v2.2.4
|
- uses: pnpm/action-setup@v2.2.4
|
||||||
with:
|
with:
|
||||||
version: 7
|
version: 8
|
||||||
|
|
||||||
- name: Setup node with self-hosted npm registry
|
- name: Setup node with self-hosted npm registry
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
|
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
rust-peer-image:
|
rust-peer-image:
|
||||||
description: "rust-peer image tag"
|
description: "rust-peer image tag"
|
||||||
type: string
|
type: string
|
||||||
default: "fluencelabs/rust-peer:minimal"
|
default: "docker.fluence.dev/nox:ipfs_aquavm-0-39-1_2346_1"
|
||||||
avm-version:
|
avm-version:
|
||||||
description: "@fluencelabs/avm version"
|
description: "@fluencelabs/avm version"
|
||||||
type: string
|
type: string
|
||||||
@ -83,7 +83,7 @@ jobs:
|
|||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v2.2.4
|
uses: pnpm/action-setup@v2.2.4
|
||||||
with:
|
with:
|
||||||
version: 7
|
version: 8
|
||||||
|
|
||||||
- name: Setup node ${{ matrix.node-version }} with self-hosted registry
|
- name: Setup node ${{ matrix.node-version }} with self-hosted registry
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
|
1
.prettierignore
Normal file
1
.prettierignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
.github
|
BIN
avm-0.39.1-feat-VM-276-aquavm-keypair-e2816f6-1588-1.0.tgz
Normal file
BIN
avm-0.39.1-feat-VM-276-aquavm-keypair-e2816f6-1588-1.0.tgz
Normal file
Binary file not shown.
@ -18,7 +18,6 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/js-client.api": "workspace:^",
|
"@fluencelabs/js-client.api": "workspace:^",
|
||||||
"@fluencelabs/fluence-network-environment": "1.0.14",
|
|
||||||
"base64-js": "1.5.1"
|
"base64-js": "1.5.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -1,20 +1,13 @@
|
|||||||
import { fromByteArray } from 'base64-js';
|
import { fromByteArray } from 'base64-js';
|
||||||
import { Fluence } from '@fluencelabs/js-client.api';
|
import { Fluence } from '@fluencelabs/js-client.api';
|
||||||
import type { ClientConfig } from '@fluencelabs/js-client.api';
|
import type { ClientConfig } from '@fluencelabs/js-client.api';
|
||||||
import { kras, randomKras } from '@fluencelabs/fluence-network-environment';
|
|
||||||
import { registerHelloWorld, helloTest, marineTest, resourceTest } from './_aqua/smoke_test.js';
|
import { registerHelloWorld, helloTest, marineTest, resourceTest } from './_aqua/smoke_test.js';
|
||||||
import { wasm } from './wasmb64.js';
|
import { wasm } from './wasmb64.js';
|
||||||
|
|
||||||
// Relay running on local machine
|
const relay = {
|
||||||
// const relay = {
|
multiaddr: '/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR',
|
||||||
// multiaddr: '/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
peerId: '12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR',
|
||||||
// peerId: '12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
};
|
||||||
// };
|
|
||||||
|
|
||||||
// Currently the tests executes some calls to registry. And they fail for a single local node setup. So we use kras instead.
|
|
||||||
// TODO DXJ-356: use local peers instead of kras
|
|
||||||
// const relay = randomKras();
|
|
||||||
const relay = kras[4];
|
|
||||||
|
|
||||||
function generateRandomUint8Array() {
|
function generateRandomUint8Array() {
|
||||||
const uint8Array = new Uint8Array(32);
|
const uint8Array = new Uint8Array(32);
|
||||||
|
@ -1,18 +1,10 @@
|
|||||||
const fluence = globalThis.fluence;
|
const fluence = globalThis.fluence;
|
||||||
|
|
||||||
// Relay from kras network
|
|
||||||
// Currently the tests executes some calls to registry. And they fail for a single local node setup. So we use kras instead.
|
|
||||||
const relay = {
|
const relay = {
|
||||||
multiaddr: '/dns4/kras-01.fluence.dev/tcp/19001/wss/p2p/12D3KooWKnEqMfYo9zvfHmqTLpLdiHXPe4SVqUWcWHDJdFGrSmcA',
|
multiaddr: '/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR',
|
||||||
peerId: '12D3KooWKnEqMfYo9zvfHmqTLpLdiHXPe4SVqUWcWHDJdFGrSmcA',
|
peerId: '12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR',
|
||||||
};
|
};
|
||||||
|
|
||||||
// Relay running on local machine
|
|
||||||
//const relay = {
|
|
||||||
// multiaddr: '/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
|
||||||
// peerId: '12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
|
||||||
//};
|
|
||||||
|
|
||||||
const getRelayTime = () => {
|
const getRelayTime = () => {
|
||||||
const script = `
|
const script = `
|
||||||
(xor
|
(xor
|
||||||
|
@ -1,36 +1,36 @@
|
|||||||
{
|
{
|
||||||
"name": "@fluencelabs/js-client.api",
|
"name": "@fluencelabs/js-client.api",
|
||||||
"version": "0.11.6",
|
"version": "0.11.6",
|
||||||
"description": "JS Client API",
|
"description": "JS Client API",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10",
|
"node": ">=10",
|
||||||
"pnpm": ">=3"
|
"pnpm": ">=3"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"source": "src/index.js",
|
"source": "src/index.js",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"umd:main": "dist/index.umd.js",
|
"umd:main": "dist/index.umd.js",
|
||||||
"module": "dist/index.mjs",
|
"module": "dist/index.mjs",
|
||||||
"exports": {
|
"exports": {
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"require": "./dist/index.js",
|
"require": "./dist/index.js",
|
||||||
"default": "./dist/index.modern.mjs"
|
"default": "./dist/index.modern.mjs"
|
||||||
},
|
},
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "microbundle --generateTypes false src/index.ts && dts-bundle-generator --config dtsbundle.cjs"
|
"build": "microbundle --generateTypes false src/index.ts && dts-bundle-generator --config dtsbundle.cjs"
|
||||||
},
|
},
|
||||||
"repository": "https://github.com/fluencelabs/fluence-js",
|
"repository": "https://github.com/fluencelabs/fluence-js",
|
||||||
"author": "Fluence Labs",
|
"author": "Fluence Labs",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/interfaces": "0.7.5"
|
"@fluencelabs/interfaces": "0.7.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fluencelabs/avm": "0.35.4",
|
"@fluencelabs/avm": "https://github.com/fluencelabs/js-client/raw/feat/add-signatures/avm-0.39.1-feat-VM-276-aquavm-keypair-e2816f6-1588-1.0.tgz",
|
||||||
"@fluencelabs/marine-js": "0.3.45",
|
"@fluencelabs/marine-js": "0.3.45",
|
||||||
"microbundle": "0.15.1",
|
"microbundle": "0.15.1",
|
||||||
"dts-bundle-generator": "7.2.0"
|
"dts-bundle-generator": "7.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/js-peer": "0.8.9",
|
"@fluencelabs/js-peer": "0.8.9",
|
||||||
"@fluencelabs/interfaces": "0.7.5",
|
"@fluencelabs/interfaces": "0.7.5",
|
||||||
"@fluencelabs/avm": "0.35.4",
|
"@fluencelabs/avm": "https://github.com/fluencelabs/js-client/raw/feat/add-signatures/avm-0.39.1-feat-VM-276-aquavm-keypair-e2816f6-1588-1.0.tgz",
|
||||||
"@fluencelabs/marine-js": "0.3.45",
|
"@fluencelabs/marine-js": "0.3.45",
|
||||||
"platform": "1.3.6"
|
"platform": "1.3.6"
|
||||||
},
|
},
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"process": "0.11.10"
|
"process": "0.11.10"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fluencelabs/avm": "0.35.4",
|
"@fluencelabs/avm": "https://github.com/fluencelabs/js-client/raw/feat/add-signatures/avm-0.39.1-feat-VM-276-aquavm-keypair-e2816f6-1588-1.0.tgz",
|
||||||
"@fluencelabs/marine-js": "0.3.45",
|
"@fluencelabs/marine-js": "0.3.45",
|
||||||
"@types/node": "16.11.59",
|
"@types/node": "16.11.59",
|
||||||
"@types/jest": "28.1.0",
|
"@types/jest": "28.1.0",
|
||||||
|
@ -18,7 +18,7 @@ import { ClientPeer, makeClientPeerConfig } from '@fluencelabs/js-peer/dist/clie
|
|||||||
import { callAquaFunction } from '@fluencelabs/js-peer/dist/compilerSupport/callFunction.js';
|
import { callAquaFunction } from '@fluencelabs/js-peer/dist/compilerSupport/callFunction.js';
|
||||||
import { registerService } from '@fluencelabs/js-peer/dist/compilerSupport/registerService.js';
|
import { registerService } from '@fluencelabs/js-peer/dist/compilerSupport/registerService.js';
|
||||||
import { MarineBasedAvmRunner } from '@fluencelabs/js-peer/dist/jsPeer/avm.js';
|
import { MarineBasedAvmRunner } from '@fluencelabs/js-peer/dist/jsPeer/avm.js';
|
||||||
import { MarineBackgroundRunner } from '@fluencelabs/js-peer/dist/marine/worker';
|
import { MarineBackgroundRunner } from '@fluencelabs/js-peer/dist/marine/worker/index.js';
|
||||||
import { InlinedWorkerLoader, InlinedWasmLoader } from '@fluencelabs/js-peer/dist/marine/deps-loader/common.js';
|
import { InlinedWorkerLoader, InlinedWasmLoader } from '@fluencelabs/js-peer/dist/marine/deps-loader/common.js';
|
||||||
|
|
||||||
const createClient = async (relay: RelayOptions, config: ClientConfig): Promise<IFluenceClient> => {
|
const createClient = async (relay: RelayOptions, config: ClientConfig): Promise<IFluenceClient> => {
|
||||||
|
@ -18,7 +18,7 @@ import { ClientPeer, makeClientPeerConfig } from '@fluencelabs/js-peer/dist/clie
|
|||||||
import { callAquaFunction } from '@fluencelabs/js-peer/dist/compilerSupport/callFunction.js';
|
import { callAquaFunction } from '@fluencelabs/js-peer/dist/compilerSupport/callFunction.js';
|
||||||
import { registerService } from '@fluencelabs/js-peer/dist/compilerSupport/registerService.js';
|
import { registerService } from '@fluencelabs/js-peer/dist/compilerSupport/registerService.js';
|
||||||
import { MarineBasedAvmRunner } from '@fluencelabs/js-peer/dist/jsPeer/avm.js';
|
import { MarineBasedAvmRunner } from '@fluencelabs/js-peer/dist/jsPeer/avm.js';
|
||||||
import { MarineBackgroundRunner } from '@fluencelabs/js-peer/dist/marine/worker';
|
import { MarineBackgroundRunner } from '@fluencelabs/js-peer/dist/marine/worker/index.js';
|
||||||
import { WasmLoaderFromUrl, WorkerLoaderFromUrl } from '@fluencelabs/js-peer/dist/marine/deps-loader/web.js';
|
import { WasmLoaderFromUrl, WorkerLoaderFromUrl } from '@fluencelabs/js-peer/dist/marine/deps-loader/web.js';
|
||||||
|
|
||||||
const defaultNames = {
|
const defaultNames = {
|
||||||
|
@ -1,56 +1,56 @@
|
|||||||
{
|
{
|
||||||
"name": "@fluencelabs/interfaces",
|
"name": "@fluencelabs/interfaces",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.7.5",
|
"version": "0.7.5",
|
||||||
"description": "Interfaces",
|
"description": "Interfaces",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"typings": "./dist/index.d.ts",
|
"typings": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"import": "./dist/index.js",
|
"import": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/index.d.ts"
|
||||||
|
},
|
||||||
|
"./fluenceClient": {
|
||||||
|
"import": "./dist/fluenceClient.js",
|
||||||
|
"types": "./dist/fluenceClient.d.ts"
|
||||||
|
},
|
||||||
|
"./compilerSupport": {
|
||||||
|
"import": "./dist/compilerSupport.js",
|
||||||
|
"types": "./dist/compilerSupport.d.ts"
|
||||||
|
},
|
||||||
|
"./dist/fluenceClient": {
|
||||||
|
"import": "./dist/fluenceClient.js",
|
||||||
|
"types": "./dist/fluenceClient.d.ts"
|
||||||
|
},
|
||||||
|
"./dist/compilerSupport": {
|
||||||
|
"import": "./dist/compilerSupport.js",
|
||||||
|
"types": "./dist/compilerSupport.d.ts"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"./fluenceClient": {
|
"typesVersions": {
|
||||||
"import": "./dist/fluenceClient.js",
|
"*": {
|
||||||
"types": "./dist/fluenceClient.d.ts"
|
"fluenceClient.d.ts": [
|
||||||
|
"./dist/fluenceClient.d.ts"
|
||||||
|
],
|
||||||
|
"compilerSupport.d.ts": [
|
||||||
|
"./dist/compilerSupport.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"./compilerSupport": {
|
"engines": {
|
||||||
"import": "./dist/compilerSupport.js",
|
"node": ">=10",
|
||||||
"types": "./dist/compilerSupport.d.ts"
|
"pnpm": ">=3"
|
||||||
},
|
},
|
||||||
"./dist/fluenceClient": {
|
"scripts": {
|
||||||
"import": "./dist/fluenceClient.js",
|
"build": "tsc"
|
||||||
"types": "./dist/fluenceClient.d.ts"
|
|
||||||
},
|
},
|
||||||
"./dist/compilerSupport": {
|
"repository": "https://github.com/fluencelabs/fluence-js",
|
||||||
"import": "./dist/compilerSupport.js",
|
"author": "Fluence Labs",
|
||||||
"types": "./dist/compilerSupport.d.ts"
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"@multiformats/multiaddr": "11.3.0",
|
||||||
|
"@fluencelabs/avm": "https://github.com/fluencelabs/js-client/raw/feat/add-signatures/avm-0.39.1-feat-VM-276-aquavm-keypair-e2816f6-1588-1.0.tgz",
|
||||||
|
"@fluencelabs/marine-js": "0.3.45"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"typesVersions": {
|
|
||||||
"*": {
|
|
||||||
"fluenceClient.d.ts": [
|
|
||||||
"./dist/fluenceClient.d.ts"
|
|
||||||
],
|
|
||||||
"compilerSupport.d.ts": [
|
|
||||||
"./dist/compilerSupport.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10",
|
|
||||||
"pnpm": ">=3"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"build": "tsc"
|
|
||||||
},
|
|
||||||
"repository": "https://github.com/fluencelabs/fluence-js",
|
|
||||||
"author": "Fluence Labs",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {},
|
|
||||||
"devDependencies": {
|
|
||||||
"@multiformats/multiaddr": "11.3.0",
|
|
||||||
"@fluencelabs/avm": "0.35.4",
|
|
||||||
"@fluencelabs/marine-js": "0.3.45"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/interfaces": "0.7.5",
|
"@fluencelabs/interfaces": "0.7.5",
|
||||||
"@fluencelabs/avm": "0.35.4",
|
"@fluencelabs/avm": "https://github.com/fluencelabs/js-client/raw/feat/add-signatures/avm-0.39.1-feat-VM-276-aquavm-keypair-e2816f6-1588-1.0.tgz",
|
||||||
"@fluencelabs/marine-js": "0.3.45",
|
"@fluencelabs/marine-js": "0.3.45",
|
||||||
"multiformats": "11.0.1",
|
"multiformats": "11.0.1",
|
||||||
"debug": "4.3.4",
|
"debug": "4.3.4",
|
||||||
|
@ -1,18 +1,7 @@
|
|||||||
// Uncomment to test on dev nodes
|
|
||||||
// import { krasnodar } from '@fluencelabs/fluence-network-environment';
|
|
||||||
// export const nodes = krasnodar;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* start docker container to run integration tests locally:
|
|
||||||
|
|
||||||
docker run --rm -e RUST_LOG="info" -p 1210:1210 -p 4310:4310 fluencelabs/fluence -t 1210 -w 4310 -k gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj --local
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const nodes = [
|
export const nodes = [
|
||||||
{
|
{
|
||||||
multiaddr: '/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
multiaddr: '/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR',
|
||||||
peerId: '12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
peerId: '12D3KooWBM3SdXWqGaawQDGQ6JprtwswEg3FWGvGhmgmMez1vRbR',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
import { KeyPair } from '../keypair/index.js';
|
import { KeyPair } from '../keypair/index.js';
|
||||||
|
|
||||||
import type { PeerIdB58 } from '@fluencelabs/interfaces';
|
import type { PeerIdB58 } from '@fluencelabs/interfaces';
|
||||||
|
import { KeyPairFormat } from '@fluencelabs/avm';
|
||||||
import {
|
import {
|
||||||
cloneWithNewData,
|
cloneWithNewData,
|
||||||
getActualTTL,
|
getActualTTL,
|
||||||
@ -297,7 +298,7 @@ export abstract class FluencePeer {
|
|||||||
log_particle.trace('id %s. data: %j', item.particle.id, {
|
log_particle.trace('id %s. data: %j', item.particle.id, {
|
||||||
initPeerId: item.particle.initPeerId,
|
initPeerId: item.particle.initPeerId,
|
||||||
timestamp: item.particle.timestamp,
|
timestamp: item.particle.timestamp,
|
||||||
tttl: item.particle.ttl,
|
ttl: item.particle.ttl,
|
||||||
signature: item.particle.signature,
|
signature: item.particle.signature,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -389,6 +390,9 @@ export abstract class FluencePeer {
|
|||||||
currentPeerId: this.keyPair.getPeerId(),
|
currentPeerId: this.keyPair.getPeerId(),
|
||||||
timestamp: item.particle.timestamp,
|
timestamp: item.particle.timestamp,
|
||||||
ttl: item.particle.ttl,
|
ttl: item.particle.ttl,
|
||||||
|
keyFormat: KeyPairFormat.Ed25519,
|
||||||
|
particleId: item.particle.id,
|
||||||
|
secretKeyBytes: this.keyPair.toEd25519PrivateKey(),
|
||||||
},
|
},
|
||||||
item.particle.script,
|
item.particle.script,
|
||||||
prevData,
|
prevData,
|
||||||
|
7586
pnpm-lock.yaml
generated
7586
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user