fix the different modules issue with workspaces and npm 7

This commit is contained in:
Pavel Murygin 2021-09-10 00:39:14 +03:00
parent 08ab2a0ac4
commit 38c3afb545
4 changed files with 3426 additions and 3562 deletions

View File

@ -1,30 +1,37 @@
# IPFS code execution example # IPFS code execution example
This example showcases 2 things: This example showcases 2 things:
1. how it's possible to store .wasm modules on IPFS, then deploy them to Fluence as a service 1. how it's possible to store .wasm modules on IPFS, then deploy them to Fluence as a service
2. ability to process IPFS files via a Fluence service. In this example, we get a size of a file 2. ability to process IPFS files via a Fluence service. In this example, we get a size of a file
## Learn about AquaIPFS ## Learn about AquaIPFS
See [Aqua Book](https://doc.fluence.dev/aqua-book/libraries/aqua-ipfs). See [Aqua Book](https://doc.fluence.dev/aqua-book/libraries/aqua-ipfs).
## How to run & use this example ## How to run & use this example
You need npm v7 or later to run the examples
### Web example ### Web example
1. Run it 1. Run it
``` ```
cd web
npm i npm i
npm start npm start -w web
``` ```
2. Press "deploy" 2. Press "deploy"
3. Copy WASM service CID and press "get_size" 3. Copy WASM service CID and press "get_size"
### NodeJS example ### NodeJS example
``` ```
cd nodejs
npm i npm i
npm start npm start -w nodejs
``` ```
## Aqua implementation ## Aqua implementation
The business logic is implemented in Aqua in [process.aqua](aqua/aqua/process.aqua)
The business logic is implemented in Aqua in [process.aqua](aqua/aqua/process.aqua)

View File

@ -4,8 +4,8 @@
"description": "An example of executing WASM code from IPFS over IPFS files", "description": "An example of executing WASM code from IPFS over IPFS files",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"postinstall": "../service/scripts/build.sh && npm run build", "postinstall": "../service/scripts/build.sh",
"compile-aqua": "aqua -i aqua -o src", "compile-aqua": "aqua -m ../node_modules -i aqua -o src",
"build": "npm run compile-aqua && tsc" "build": "npm run compile-aqua && tsc"
}, },
"keywords": [ "keywords": [

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,10 @@
"name": "aqua-ipfs-integration", "name": "aqua-ipfs-integration",
"workspaces": [ "workspaces": [
"aqua", "aqua",
"nodjes", "nodejs",
"web" "web"
] ],
"scripts": {
"build": "npm run build -w aqua -w nodejs -w web"
}
} }