mirror of
https://github.com/fluencelabs/registry.git
synced 2025-04-24 09:42:14 +00:00
feat: use non-npm Fluence CLI (#302)
* feat: use non-npm Fluence CLI * Replace nox version * Setup fcli in cargo tests * Fix * remove npx --------- Co-authored-by: Anatoly Laskaris <github_me@nahsi.dev>
This commit is contained in:
parent
2405f41702
commit
d77fd12b4d
5
.github/workflows/snapshot.yml
vendored
5
.github/workflows/snapshot.yml
vendored
@ -54,6 +54,11 @@ jobs:
|
||||
with:
|
||||
artifact-name: marine
|
||||
|
||||
- name: Setup fcli
|
||||
uses: fluencelabs/setup-fluence@v1
|
||||
with:
|
||||
version: stage
|
||||
|
||||
- name: Import secrets
|
||||
if: inputs.snapshot == true
|
||||
uses: hashicorp/vault-action@v2.7.3
|
||||
|
17
.github/workflows/tests.yml
vendored
17
.github/workflows/tests.yml
vendored
@ -10,11 +10,11 @@ on:
|
||||
nox-image:
|
||||
description: "nox image tag"
|
||||
type: string
|
||||
default: "fluencelabs/nox:unstable_minimal"
|
||||
default: "fluencelabs/nox:unstable"
|
||||
fcli-version:
|
||||
description: "@fluencelabs/cli version"
|
||||
type: string
|
||||
default: "null"
|
||||
default: "stage"
|
||||
cargo-dependencies:
|
||||
description: "Cargo dependencies map"
|
||||
type: string
|
||||
@ -76,14 +76,11 @@ jobs:
|
||||
run: npm install
|
||||
working-directory: aqua-tests
|
||||
|
||||
- name: Set fcli version
|
||||
if: inputs.fcli-version != 'null'
|
||||
uses: fluencelabs/github-actions/npm-set-dependency@main
|
||||
- name: Setup fcli
|
||||
uses: fluencelabs/setup-fluence@v1
|
||||
with:
|
||||
package: "@fluencelabs/cli"
|
||||
artifact: fcli
|
||||
version: ${{ inputs.fcli-version }}
|
||||
working-directory: aqua-tests
|
||||
flags: "--save-dev"
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: dsherret/rust-toolchain-file@v1
|
||||
@ -141,7 +138,7 @@ jobs:
|
||||
- name: Install fcli dependencies
|
||||
env:
|
||||
FLUENCE_USER_DIR: "${{ github.workspace }}/tmp/.fluence"
|
||||
run: npx fluence dep i --no-input
|
||||
run: fluence dep i --no-input
|
||||
working-directory: aqua-tests
|
||||
|
||||
- name: Print fcli version
|
||||
@ -162,7 +159,7 @@ jobs:
|
||||
cat <<SNAPSHOT >> $GITHUB_STEP_SUMMARY
|
||||
## Used versions
|
||||
\`\`\`
|
||||
$(npx fluence dep v)
|
||||
$(fluence dep v)
|
||||
\`\`\`
|
||||
SNAPSHOT
|
||||
|
||||
|
@ -7,7 +7,7 @@ dependencies:
|
||||
npm:
|
||||
"@fluencelabs/registry": 0.6.2
|
||||
```
|
||||
And then run `fluence dependency npm i`
|
||||
And then run `fluence dep npm i`
|
||||
|
||||
If you are developing from scratch without Fluence CLI, you should install it via npm:
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
"compile-aqua": "fluence aqua -i . -o ./target/typescript",
|
||||
"generate-aqua": "../service/build.sh",
|
||||
"build": "npm run compile-aqua",
|
||||
"secret": "npx fluence key new"
|
||||
"secret": "fluence key new"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -29,7 +29,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/fluencelabs/registry",
|
||||
"devDependencies": {
|
||||
"@fluencelabs/cli": "0.13.0",
|
||||
"@fluencelabs/fluence-network-environment": "1.1.2"
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import os
|
||||
import inspect
|
||||
from config import get_local
|
||||
|
||||
delegator.run("npx fluence dep npm i", block=True)
|
||||
delegator.run("fluence dep npm i", block=True)
|
||||
default_peers = json.loads(delegator.run(
|
||||
f"node ./getDefaultPeers.js", block=True).out)
|
||||
|
||||
@ -58,7 +58,7 @@ def run_aqua(func, args, relay=get_random_relay()):
|
||||
# when running one test at a time, the stack is shorter so we need to use a different index
|
||||
test_name = inspect.stack()[-32][3]
|
||||
|
||||
command = f"npx fluence run -k {test_name} --relay {relay} -f '{call}' --data '{json.dumps(data)}' --import 'node_modules' --quiet --particle-id"
|
||||
command = f"fluence run -k {test_name} --relay {relay} -f '{call}' --data '{json.dumps(data)}' --import 'node_modules' --quiet --particle-id"
|
||||
print(command)
|
||||
c = delegator.run(command, block=True)
|
||||
lines = c.out.splitlines()
|
||||
|
@ -2,6 +2,6 @@ import delegator
|
||||
|
||||
|
||||
def test_fluence_cli_version():
|
||||
c = delegator.run(f"npx fluence --version", block=True)
|
||||
c = delegator.run(f"fluence --version", block=True)
|
||||
print(f"Fluence CLI version: {c.out}")
|
||||
assert True
|
||||
|
@ -28,8 +28,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/fluencelabs/registry/issues"
|
||||
},
|
||||
"homepage": "https://github.com/fluencelabs/registry",
|
||||
"devDependencies": {
|
||||
"@fluencelabs/cli": "0.13.0"
|
||||
}
|
||||
"homepage": "https://github.com/fluencelabs/registry"
|
||||
}
|
||||
|
2
build.sh
2
build.sh
@ -11,7 +11,7 @@ DISTRO_TARGET=distro/registry-service
|
||||
mkdir -p "$DISTRO_TARGET"
|
||||
|
||||
cd ./aqua
|
||||
npx fluence aqua -i ../spell/spell.aqua --no-relay --air -o "../$DISTRO_TARGET/air"
|
||||
fluence aqua -i ../spell/spell.aqua --no-relay --air -o "../$DISTRO_TARGET/air"
|
||||
cd -
|
||||
|
||||
cp service/artifacts/registry.wasm service/artifacts/sqlite3.wasm distro/Config.toml "$DISTRO_TARGET"
|
||||
|
@ -18,13 +18,10 @@ This example shows how to use Registry to discover and call fluence services wit
|
||||
|
||||
## Set up the environment
|
||||
|
||||
1. Install the latest version of Fluence CLI:
|
||||
```sh
|
||||
npm i -g @fluencelabs/cli
|
||||
```
|
||||
1. [Install the latest version of Fluence CLI](https://github.com/fluencelabs/cli#installation-and-usage)
|
||||
2. Install Fluence project dependencies. It may take a while:
|
||||
```sh
|
||||
fluence dependency i
|
||||
fluence dep i
|
||||
```
|
||||
3. Install JS dependencies:
|
||||
```sh
|
||||
|
28403
package-lock.json
generated
28403
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@fluencelabs/cli": "0.13.0"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user