2021-08-12 18:03:19 +03:00
|
|
|
# IPFS code execution example
|
2021-07-21 11:37:25 +03:00
|
|
|
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
|
|
|
|
|
2021-08-12 18:03:19 +03:00
|
|
|
## Learn about AquaIPFS
|
|
|
|
See [Aqua Book](https://doc.fluence.dev/aqua-book/libraries/aqua-ipfs).
|
|
|
|
|
|
|
|
## How to run & use this example
|
|
|
|
### Web example
|
2021-07-21 11:37:25 +03:00
|
|
|
1. Run it
|
|
|
|
```
|
|
|
|
cd web
|
|
|
|
npm i
|
|
|
|
npm start
|
|
|
|
```
|
|
|
|
|
|
|
|
2. Press "deploy"
|
|
|
|
3. Copy WASM service CID and press "get_size"
|
|
|
|
|
2021-08-12 18:03:19 +03:00
|
|
|
### NodeJS example
|
|
|
|
```
|
|
|
|
cd nodejs
|
|
|
|
npm i
|
|
|
|
npm start
|
|
|
|
```
|
|
|
|
|
2021-07-21 11:37:25 +03:00
|
|
|
## Aqua implementation
|
2021-08-12 18:03:19 +03:00
|
|
|
The business logic is implemented in Aqua in [process.aqua](aqua/src/process.aqua)
|
2021-07-21 11:37:25 +03:00
|
|
|
|