Merge branch 'npm-workspaces' into new-js-sdk-api

This commit is contained in:
Pavel Murygin 2021-09-10 13:06:06 +03:00
commit cd1f1723f3
6 changed files with 39255 additions and 13 deletions

View File

@ -1,30 +1,37 @@
# IPFS code execution example
This example showcases 2 things:
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
## Learn about AquaIPFS
See [Aqua Book](https://doc.fluence.dev/aqua-book/libraries/aqua-ipfs).
## How to run & use this example
You need npm v7 or later to run the examples
### Web example
1. Run it
```
cd web
npm i
npm start
npm start -w web
```
2. Press "deploy"
3. Copy WASM service CID and press "get_size"
### NodeJS example
```
cd nodejs
npm i
npm start
npm start -w nodejs
```
## 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",
"main": "dist/index.js",
"scripts": {
"postinstall": "../service/scripts/build.sh && npm run build",
"compile-aqua": "aqua -i aqua -o src",
"postinstall": "../service/scripts/build.sh",
"compile-aqua": "aqua -m ../node_modules -i aqua -o src",
"build": "npm run compile-aqua && tsc"
},
"keywords": [
@ -22,16 +22,16 @@
"license": "MIT",
"dependencies": {
"@fluencelabs/aqua-ipfs": "0.4.2",
"@fluencelabs/fluence": "0.11.0",
"@fluencelabs/aqua-lib": "0.1.14",
"@fluencelabs/fluence": "0.11.0",
"@fluencelabs/fluence-network-environment": "1.0.10",
"ipfs-http-client": "^50.1.2",
"it-all": "^1.0.5",
"uint8arrays": "^2.1.5",
"multiaddr": "^10.0.0"
"multiaddr": "^10.0.0",
"uint8arrays": "^2.1.5"
},
"devDependencies": {
"@fluencelabs/aqua": "^0.3.0-224",
"@fluencelabs/aqua": "^0.3.0-225",
"typescript": "^3.9.5"
}
}

View File

@ -3,7 +3,7 @@
* This file is auto-generated. Do not edit manually: changes may be erased.
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
* Aqua version: 0.3.0-224
* Aqua version: 0.3.0-225
*
*/
import { FluencePeer } from '@fluencelabs/fluence';

View File

@ -3,7 +3,7 @@
* This file is auto-generated. Do not edit manually: changes may be erased.
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
* Aqua version: 0.3.0-224
* Aqua version: 0.3.0-225
*
*/
import { FluencePeer } from '@fluencelabs/fluence';

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
{
"name": "aqua-ipfs-integration",
"workspaces": [
"aqua",
"nodejs",
"web"
],
"scripts": {
"build": "npm run build -w aqua -w nodejs -w web"
}
}