diff --git a/.github/workflows/check-deploy.yml b/.github/workflows/check-deploy.yml index 4946a35..2de126e 100644 --- a/.github/workflows/check-deploy.yml +++ b/.github/workflows/check-deploy.yml @@ -59,17 +59,5 @@ jobs: (call %init_peer_id% (returnService "run") [result]) ) ') - working-directory: call_parameters - - - name: "Check curl_template deployment" - run: | - set -x - export NODE="/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3" - SERVICE_ID=`./deploy.sh` - fldist --node-addr $NODE run_air -d '{"service_id": "'$SERVICE_ID'"}' -p <(echo ' - (seq - (call relay (service_id "request") ["https://fluence.network/join.html"] result) - (call %init_peer_id% (returnService "run") [result]) - ) - ') - working-directory: curl_template + working-directory: marine-examples/call_parameters + diff --git a/Readme.md b/Readme.md index 74ec331..50b109b 100644 --- a/Readme.md +++ b/Readme.md @@ -1,8 +1,11 @@ # Examples This repo holds a collection of examples on how to build distributed applications with the Fluence stack. -If you encounter issues, please post an Issue or open a PR. If you want to contribute an example, please contact us by opening an Issue or a draft PR. See the [contribution rules](https://github.com/fluencelabs/fluence/blob/master/CONTRIBUTING.md). + +The `aqua-examples` directory contains examples demonstrating the use of Aqua to compose decentralized applications from distributed services, whereas the `marine-examples` directory contains examples with respect to the development of Rust Wasm modules. + +If you encounter a problem, please post an Issue or open a PR. If you want to contribute an example, please contact us by opening an Issue or a draft PR. See the [contribution rules](https://github.com/fluencelabs/fluence/blob/master/CONTRIBUTING.md). ## License -Unless otherwise indicated, the applicable license is [Apache 2.0](https://github.com/fluencelabs/fluence/blob/master/LICENSE). \ No newline at end of file +Unless otherwise indicated, the applicable license is [Apache 2.0](https://github.com/fluencelabs/fluence/blob/master/LICENSE). diff --git a/echo-greeter/Readme.md b/aqua-examples/echo-greeter/Readme.md similarity index 100% rename from echo-greeter/Readme.md rename to aqua-examples/echo-greeter/Readme.md diff --git a/echo-greeter/aqua-compiled/echo_greeter.echo.air b/aqua-examples/echo-greeter/aqua-compiled/echo_greeter.echo.air similarity index 100% rename from echo-greeter/aqua-compiled/echo_greeter.echo.air rename to aqua-examples/echo-greeter/aqua-compiled/echo_greeter.echo.air diff --git a/echo-greeter/aqua-compiled/echo_greeter.echo_greeting_par.air b/aqua-examples/echo-greeter/aqua-compiled/echo_greeter.echo_greeting_par.air similarity index 100% rename from echo-greeter/aqua-compiled/echo_greeter.echo_greeting_par.air rename to aqua-examples/echo-greeter/aqua-compiled/echo_greeter.echo_greeting_par.air diff --git a/echo-greeter/aqua-compiled/echo_greeter.echo_greeting_seq.air b/aqua-examples/echo-greeter/aqua-compiled/echo_greeter.echo_greeting_seq.air similarity index 100% rename from echo-greeter/aqua-compiled/echo_greeter.echo_greeting_seq.air rename to aqua-examples/echo-greeter/aqua-compiled/echo_greeter.echo_greeting_seq.air diff --git a/echo-greeter/aqua-compiled/echo_greeter.greeting.air b/aqua-examples/echo-greeter/aqua-compiled/echo_greeter.greeting.air similarity index 100% rename from echo-greeter/aqua-compiled/echo_greeter.greeting.air rename to aqua-examples/echo-greeter/aqua-compiled/echo_greeter.greeting.air diff --git a/echo-greeter/aqua-compiled/echo_greeter.ts b/aqua-examples/echo-greeter/aqua-compiled/echo_greeter.ts similarity index 100% rename from echo-greeter/aqua-compiled/echo_greeter.ts rename to aqua-examples/echo-greeter/aqua-compiled/echo_greeter.ts diff --git a/echo-greeter/aqua-scripts/echo_greeter.aqua b/aqua-examples/echo-greeter/aqua-scripts/echo_greeter.aqua similarity index 100% rename from echo-greeter/aqua-scripts/echo_greeter.aqua rename to aqua-examples/echo-greeter/aqua-scripts/echo_greeter.aqua diff --git a/echo-greeter/configs/Config.toml b/aqua-examples/echo-greeter/configs/Config.toml similarity index 100% rename from echo-greeter/configs/Config.toml rename to aqua-examples/echo-greeter/configs/Config.toml diff --git a/echo-greeter/configs/echo_service_cfg.json b/aqua-examples/echo-greeter/configs/echo_service_cfg.json similarity index 100% rename from echo-greeter/configs/echo_service_cfg.json rename to aqua-examples/echo-greeter/configs/echo_service_cfg.json diff --git a/echo-greeter/configs/greeting_cfg.json b/aqua-examples/echo-greeter/configs/greeting_cfg.json similarity index 100% rename from echo-greeter/configs/greeting_cfg.json rename to aqua-examples/echo-greeter/configs/greeting_cfg.json diff --git a/echo-greeter/configs/utilities_cfg.json b/aqua-examples/echo-greeter/configs/utilities_cfg.json similarity index 100% rename from echo-greeter/configs/utilities_cfg.json rename to aqua-examples/echo-greeter/configs/utilities_cfg.json diff --git a/call_parameters/.gitignore b/aqua-examples/echo-greeter/echo-service/.gitignore similarity index 100% rename from call_parameters/.gitignore rename to aqua-examples/echo-greeter/echo-service/.gitignore diff --git a/echo-greeter/echo-service/Cargo.toml b/aqua-examples/echo-greeter/echo-service/Cargo.toml similarity index 100% rename from echo-greeter/echo-service/Cargo.toml rename to aqua-examples/echo-greeter/echo-service/Cargo.toml diff --git a/echo-greeter/echo-service/Config.toml b/aqua-examples/echo-greeter/echo-service/Config.toml similarity index 100% rename from echo-greeter/echo-service/Config.toml rename to aqua-examples/echo-greeter/echo-service/Config.toml diff --git a/echo-greeter/echo-service/build.sh b/aqua-examples/echo-greeter/echo-service/build.sh similarity index 100% rename from echo-greeter/echo-service/build.sh rename to aqua-examples/echo-greeter/echo-service/build.sh diff --git a/echo-greeter/echo-service/src/main.rs b/aqua-examples/echo-greeter/echo-service/src/main.rs similarity index 100% rename from echo-greeter/echo-service/src/main.rs rename to aqua-examples/echo-greeter/echo-service/src/main.rs diff --git a/echo-greeter/echo-service/.gitignore b/aqua-examples/echo-greeter/greeting/.gitignore similarity index 100% rename from echo-greeter/echo-service/.gitignore rename to aqua-examples/echo-greeter/greeting/.gitignore diff --git a/echo-greeter/greeting/Cargo.toml b/aqua-examples/echo-greeter/greeting/Cargo.toml similarity index 100% rename from echo-greeter/greeting/Cargo.toml rename to aqua-examples/echo-greeter/greeting/Cargo.toml diff --git a/echo-greeter/greeting/Config.toml b/aqua-examples/echo-greeter/greeting/Config.toml similarity index 100% rename from echo-greeter/greeting/Config.toml rename to aqua-examples/echo-greeter/greeting/Config.toml diff --git a/echo-greeter/greeting/build.sh b/aqua-examples/echo-greeter/greeting/build.sh similarity index 100% rename from echo-greeter/greeting/build.sh rename to aqua-examples/echo-greeter/greeting/build.sh diff --git a/echo-greeter/greeting/src/main.rs b/aqua-examples/echo-greeter/greeting/src/main.rs similarity index 100% rename from echo-greeter/greeting/src/main.rs rename to aqua-examples/echo-greeter/greeting/src/main.rs diff --git a/echo-greeter/scripts/build_all.sh b/aqua-examples/echo-greeter/scripts/build_all.sh similarity index 100% rename from echo-greeter/scripts/build_all.sh rename to aqua-examples/echo-greeter/scripts/build_all.sh diff --git a/echo-greeter/greeting/.gitignore b/aqua-examples/echo-greeter/secure-greeter/.gitignore similarity index 100% rename from echo-greeter/greeting/.gitignore rename to aqua-examples/echo-greeter/secure-greeter/.gitignore diff --git a/echo-greeter/secure-greeter/Cargo.toml b/aqua-examples/echo-greeter/secure-greeter/Cargo.toml similarity index 100% rename from echo-greeter/secure-greeter/Cargo.toml rename to aqua-examples/echo-greeter/secure-greeter/Cargo.toml diff --git a/echo-greeter/secure-greeter/Config.toml b/aqua-examples/echo-greeter/secure-greeter/Config.toml similarity index 100% rename from echo-greeter/secure-greeter/Config.toml rename to aqua-examples/echo-greeter/secure-greeter/Config.toml diff --git a/echo-greeter/secure-greeter/air-scripts/air_greet.clj b/aqua-examples/echo-greeter/secure-greeter/air-scripts/air_greet.clj similarity index 100% rename from echo-greeter/secure-greeter/air-scripts/air_greet.clj rename to aqua-examples/echo-greeter/secure-greeter/air-scripts/air_greet.clj diff --git a/echo-greeter/secure-greeter/build.sh b/aqua-examples/echo-greeter/secure-greeter/build.sh similarity index 100% rename from echo-greeter/secure-greeter/build.sh rename to aqua-examples/echo-greeter/secure-greeter/build.sh diff --git a/echo-greeter/secure-greeter/configs/secure_greeter_cfg.json b/aqua-examples/echo-greeter/secure-greeter/configs/secure_greeter_cfg.json similarity index 100% rename from echo-greeter/secure-greeter/configs/secure_greeter_cfg.json rename to aqua-examples/echo-greeter/secure-greeter/configs/secure_greeter_cfg.json diff --git a/echo-greeter/secure-greeter/src/auth.rs b/aqua-examples/echo-greeter/secure-greeter/src/auth.rs similarity index 100% rename from echo-greeter/secure-greeter/src/auth.rs rename to aqua-examples/echo-greeter/secure-greeter/src/auth.rs diff --git a/echo-greeter/secure-greeter/src/main.rs b/aqua-examples/echo-greeter/secure-greeter/src/main.rs similarity index 100% rename from echo-greeter/secure-greeter/src/main.rs rename to aqua-examples/echo-greeter/secure-greeter/src/main.rs diff --git a/echo-greeter/utilities/.gitignore b/aqua-examples/echo-greeter/utilities/.gitignore similarity index 100% rename from echo-greeter/utilities/.gitignore rename to aqua-examples/echo-greeter/utilities/.gitignore diff --git a/echo-greeter/utilities/Cargo.toml b/aqua-examples/echo-greeter/utilities/Cargo.toml similarity index 100% rename from echo-greeter/utilities/Cargo.toml rename to aqua-examples/echo-greeter/utilities/Cargo.toml diff --git a/echo-greeter/utilities/Config.toml b/aqua-examples/echo-greeter/utilities/Config.toml similarity index 100% rename from echo-greeter/utilities/Config.toml rename to aqua-examples/echo-greeter/utilities/Config.toml diff --git a/echo-greeter/utilities/aqua-compiled/utilities.increment_u32.air b/aqua-examples/echo-greeter/utilities/aqua-compiled/utilities.increment_u32.air similarity index 100% rename from echo-greeter/utilities/aqua-compiled/utilities.increment_u32.air rename to aqua-examples/echo-greeter/utilities/aqua-compiled/utilities.increment_u32.air diff --git a/echo-greeter/utilities/aqua-compiled/utilities.increment_u64.air b/aqua-examples/echo-greeter/utilities/aqua-compiled/utilities.increment_u64.air similarity index 100% rename from echo-greeter/utilities/aqua-compiled/utilities.increment_u64.air rename to aqua-examples/echo-greeter/utilities/aqua-compiled/utilities.increment_u64.air diff --git a/echo-greeter/utilities/aqua-compiled/utilities.splitter.air b/aqua-examples/echo-greeter/utilities/aqua-compiled/utilities.splitter.air similarity index 100% rename from echo-greeter/utilities/aqua-compiled/utilities.splitter.air rename to aqua-examples/echo-greeter/utilities/aqua-compiled/utilities.splitter.air diff --git a/echo-greeter/utilities/aqua-compiled/utilities.splitter_u32.air b/aqua-examples/echo-greeter/utilities/aqua-compiled/utilities.splitter_u32.air similarity index 100% rename from echo-greeter/utilities/aqua-compiled/utilities.splitter_u32.air rename to aqua-examples/echo-greeter/utilities/aqua-compiled/utilities.splitter_u32.air diff --git a/echo-greeter/utilities/aqua-compiled/utilities.splitter_u64.air b/aqua-examples/echo-greeter/utilities/aqua-compiled/utilities.splitter_u64.air similarity index 100% rename from echo-greeter/utilities/aqua-compiled/utilities.splitter_u64.air rename to aqua-examples/echo-greeter/utilities/aqua-compiled/utilities.splitter_u64.air diff --git a/echo-greeter/utilities/aqua-scripts/utilities.aqua b/aqua-examples/echo-greeter/utilities/aqua-scripts/utilities.aqua similarity index 100% rename from echo-greeter/utilities/aqua-scripts/utilities.aqua rename to aqua-examples/echo-greeter/utilities/aqua-scripts/utilities.aqua diff --git a/echo-greeter/utilities/scripts/build.sh b/aqua-examples/echo-greeter/utilities/scripts/build.sh similarity index 100% rename from echo-greeter/utilities/scripts/build.sh rename to aqua-examples/echo-greeter/utilities/scripts/build.sh diff --git a/echo-greeter/utilities/src/main.rs b/aqua-examples/echo-greeter/utilities/src/main.rs similarity index 100% rename from echo-greeter/utilities/src/main.rs rename to aqua-examples/echo-greeter/utilities/src/main.rs diff --git a/ts-oracle/Cargo.toml b/aqua-examples/ts-oracle/Cargo.toml similarity index 100% rename from ts-oracle/Cargo.toml rename to aqua-examples/ts-oracle/Cargo.toml diff --git a/ts-oracle/Config.toml b/aqua-examples/ts-oracle/Config.toml similarity index 100% rename from ts-oracle/Config.toml rename to aqua-examples/ts-oracle/Config.toml diff --git a/ts-oracle/Readme.md b/aqua-examples/ts-oracle/Readme.md similarity index 100% rename from ts-oracle/Readme.md rename to aqua-examples/ts-oracle/Readme.md diff --git a/ts-oracle/air-scripts/timestamp_getter.ts_getter.air b/aqua-examples/ts-oracle/air-scripts/timestamp_getter.ts_getter.air similarity index 100% rename from ts-oracle/air-scripts/timestamp_getter.ts_getter.air rename to aqua-examples/ts-oracle/air-scripts/timestamp_getter.ts_getter.air diff --git a/ts-oracle/air-scripts/ts_getter.ts b/aqua-examples/ts-oracle/air-scripts/ts_getter.ts similarity index 100% rename from ts-oracle/air-scripts/ts_getter.ts rename to aqua-examples/ts-oracle/air-scripts/ts_getter.ts diff --git a/ts-oracle/air-scripts/ts_getter.ts_getter.air b/aqua-examples/ts-oracle/air-scripts/ts_getter.ts_getter.air similarity index 100% rename from ts-oracle/air-scripts/ts_getter.ts_getter.air rename to aqua-examples/ts-oracle/air-scripts/ts_getter.ts_getter.air diff --git a/ts-oracle/air-scripts/ts_getter.ts_oracle.air b/aqua-examples/ts-oracle/air-scripts/ts_getter.ts_oracle.air similarity index 100% rename from ts-oracle/air-scripts/ts_getter.ts_oracle.air rename to aqua-examples/ts-oracle/air-scripts/ts_getter.ts_oracle.air diff --git a/ts-oracle/aqua-scripts/builtin.aqua b/aqua-examples/ts-oracle/aqua-scripts/builtin.aqua similarity index 100% rename from ts-oracle/aqua-scripts/builtin.aqua rename to aqua-examples/ts-oracle/aqua-scripts/builtin.aqua diff --git a/ts-oracle/aqua-scripts/timestamp_getter.aqua b/aqua-examples/ts-oracle/aqua-scripts/timestamp_getter.aqua similarity index 100% rename from ts-oracle/aqua-scripts/timestamp_getter.aqua rename to aqua-examples/ts-oracle/aqua-scripts/timestamp_getter.aqua diff --git a/ts-oracle/aqua-scripts/ts_getter.aqua b/aqua-examples/ts-oracle/aqua-scripts/ts_getter.aqua similarity index 100% rename from ts-oracle/aqua-scripts/ts_getter.aqua rename to aqua-examples/ts-oracle/aqua-scripts/ts_getter.aqua diff --git a/ts-oracle/artifacts/service_info.txt b/aqua-examples/ts-oracle/artifacts/service_info.txt similarity index 100% rename from ts-oracle/artifacts/service_info.txt rename to aqua-examples/ts-oracle/artifacts/service_info.txt diff --git a/ts-oracle/artifacts/ts_oracle_cfg.json b/aqua-examples/ts-oracle/artifacts/ts_oracle_cfg.json similarity index 100% rename from ts-oracle/artifacts/ts_oracle_cfg.json rename to aqua-examples/ts-oracle/artifacts/ts_oracle_cfg.json diff --git a/ts-oracle/scripts/build.sh b/aqua-examples/ts-oracle/scripts/build.sh similarity index 100% rename from ts-oracle/scripts/build.sh rename to aqua-examples/ts-oracle/scripts/build.sh diff --git a/ts-oracle/src/main.rs b/aqua-examples/ts-oracle/src/main.rs similarity index 100% rename from ts-oracle/src/main.rs rename to aqua-examples/ts-oracle/src/main.rs diff --git a/ts-oracle/src/stats.rs b/aqua-examples/ts-oracle/src/stats.rs similarity index 100% rename from ts-oracle/src/stats.rs rename to aqua-examples/ts-oracle/src/stats.rs diff --git a/curl_template/.gitignore b/archived/curl_template/.gitignore similarity index 100% rename from curl_template/.gitignore rename to archived/curl_template/.gitignore diff --git a/curl_template/README.md b/archived/curl_template/README.md similarity index 100% rename from curl_template/README.md rename to archived/curl_template/README.md diff --git a/curl_template/backend/BackendConfig.json b/archived/curl_template/backend/BackendConfig.json similarity index 100% rename from curl_template/backend/BackendConfig.json rename to archived/curl_template/backend/BackendConfig.json diff --git a/curl_template/backend/Cargo.toml b/archived/curl_template/backend/Cargo.toml similarity index 100% rename from curl_template/backend/Cargo.toml rename to archived/curl_template/backend/Cargo.toml diff --git a/curl_template/backend/src/main.rs b/archived/curl_template/backend/src/main.rs similarity index 100% rename from curl_template/backend/src/main.rs rename to archived/curl_template/backend/src/main.rs diff --git a/curl_template/deploy.sh b/archived/curl_template/deploy.sh similarity index 100% rename from curl_template/deploy.sh rename to archived/curl_template/deploy.sh diff --git a/curl_template/frontend/.gitignore b/archived/curl_template/frontend/.gitignore similarity index 100% rename from curl_template/frontend/.gitignore rename to archived/curl_template/frontend/.gitignore diff --git a/curl_template/frontend/.prettierrc.js b/archived/curl_template/frontend/.prettierrc.js similarity index 100% rename from curl_template/frontend/.prettierrc.js rename to archived/curl_template/frontend/.prettierrc.js diff --git a/curl_template/frontend/README.md b/archived/curl_template/frontend/README.md similarity index 100% rename from curl_template/frontend/README.md rename to archived/curl_template/frontend/README.md diff --git a/curl_template/frontend/package-lock.json b/archived/curl_template/frontend/package-lock.json similarity index 100% rename from curl_template/frontend/package-lock.json rename to archived/curl_template/frontend/package-lock.json diff --git a/curl_template/frontend/package.json b/archived/curl_template/frontend/package.json similarity index 100% rename from curl_template/frontend/package.json rename to archived/curl_template/frontend/package.json diff --git a/curl_template/frontend/public/favicon.ico b/archived/curl_template/frontend/public/favicon.ico similarity index 100% rename from curl_template/frontend/public/favicon.ico rename to archived/curl_template/frontend/public/favicon.ico diff --git a/curl_template/frontend/public/index.html b/archived/curl_template/frontend/public/index.html similarity index 100% rename from curl_template/frontend/public/index.html rename to archived/curl_template/frontend/public/index.html diff --git a/curl_template/frontend/public/logo192.png b/archived/curl_template/frontend/public/logo192.png similarity index 100% rename from curl_template/frontend/public/logo192.png rename to archived/curl_template/frontend/public/logo192.png diff --git a/curl_template/frontend/public/logo512.png b/archived/curl_template/frontend/public/logo512.png similarity index 100% rename from curl_template/frontend/public/logo512.png rename to archived/curl_template/frontend/public/logo512.png diff --git a/curl_template/frontend/public/manifest.json b/archived/curl_template/frontend/public/manifest.json similarity index 100% rename from curl_template/frontend/public/manifest.json rename to archived/curl_template/frontend/public/manifest.json diff --git a/curl_template/frontend/public/robots.txt b/archived/curl_template/frontend/public/robots.txt similarity index 100% rename from curl_template/frontend/public/robots.txt rename to archived/curl_template/frontend/public/robots.txt diff --git a/curl_template/frontend/src/components/App.scss b/archived/curl_template/frontend/src/components/App.scss similarity index 100% rename from curl_template/frontend/src/components/App.scss rename to archived/curl_template/frontend/src/components/App.scss diff --git a/curl_template/frontend/src/components/App.tsx b/archived/curl_template/frontend/src/components/App.tsx similarity index 100% rename from curl_template/frontend/src/components/App.tsx rename to archived/curl_template/frontend/src/components/App.tsx diff --git a/curl_template/frontend/src/fluence.ts b/archived/curl_template/frontend/src/fluence.ts similarity index 100% rename from curl_template/frontend/src/fluence.ts rename to archived/curl_template/frontend/src/fluence.ts diff --git a/curl_template/frontend/src/index.scss b/archived/curl_template/frontend/src/index.scss similarity index 100% rename from curl_template/frontend/src/index.scss rename to archived/curl_template/frontend/src/index.scss diff --git a/curl_template/frontend/src/index.tsx b/archived/curl_template/frontend/src/index.tsx similarity index 100% rename from curl_template/frontend/src/index.tsx rename to archived/curl_template/frontend/src/index.tsx diff --git a/curl_template/frontend/src/react-app-env.d.ts b/archived/curl_template/frontend/src/react-app-env.d.ts similarity index 100% rename from curl_template/frontend/src/react-app-env.d.ts rename to archived/curl_template/frontend/src/react-app-env.d.ts diff --git a/curl_template/frontend/src/setupTests.ts b/archived/curl_template/frontend/src/setupTests.ts similarity index 100% rename from curl_template/frontend/src/setupTests.ts rename to archived/curl_template/frontend/src/setupTests.ts diff --git a/curl_template/frontend/tsconfig.json b/archived/curl_template/frontend/tsconfig.json similarity index 100% rename from curl_template/frontend/tsconfig.json rename to archived/curl_template/frontend/tsconfig.json diff --git a/curl_template/repl_config.toml b/archived/curl_template/repl_config.toml similarity index 100% rename from curl_template/repl_config.toml rename to archived/curl_template/repl_config.toml diff --git a/curl_template/request.air b/archived/curl_template/request.air similarity index 100% rename from curl_template/request.air rename to archived/curl_template/request.air diff --git a/curl_template/script.air b/archived/curl_template/script.air similarity index 100% rename from curl_template/script.air rename to archived/curl_template/script.air diff --git a/echo-greeter/secure-greeter/.gitignore b/archived/ether-price-getter/.gitignore similarity index 100% rename from echo-greeter/secure-greeter/.gitignore rename to archived/ether-price-getter/.gitignore diff --git a/ether-price-getter/Config.toml b/archived/ether-price-getter/Config.toml similarity index 100% rename from ether-price-getter/Config.toml rename to archived/ether-price-getter/Config.toml diff --git a/ether-price-getter/Readme.md b/archived/ether-price-getter/Readme.md similarity index 100% rename from ether-price-getter/Readme.md rename to archived/ether-price-getter/Readme.md diff --git a/ether-price-getter/air-scripts/get_eth_price.clj b/archived/ether-price-getter/air-scripts/get_eth_price.clj similarity index 100% rename from ether-price-getter/air-scripts/get_eth_price.clj rename to archived/ether-price-getter/air-scripts/get_eth_price.clj diff --git a/ether-price-getter/build.sh b/archived/ether-price-getter/build.sh similarity index 100% rename from ether-price-getter/build.sh rename to archived/ether-price-getter/build.sh diff --git a/ether-price-getter/curl_adapter/.gitignore b/archived/ether-price-getter/curl_adapter/.gitignore similarity index 100% rename from ether-price-getter/curl_adapter/.gitignore rename to archived/ether-price-getter/curl_adapter/.gitignore diff --git a/ether-price-getter/curl_adapter/Cargo.toml b/archived/ether-price-getter/curl_adapter/Cargo.toml similarity index 100% rename from ether-price-getter/curl_adapter/Cargo.toml rename to archived/ether-price-getter/curl_adapter/Cargo.toml diff --git a/ether-price-getter/curl_adapter/src/main.rs b/archived/ether-price-getter/curl_adapter/src/main.rs similarity index 100% rename from ether-price-getter/curl_adapter/src/main.rs rename to archived/ether-price-getter/curl_adapter/src/main.rs diff --git a/ether-price-getter/curl_cfg.json b/archived/ether-price-getter/curl_cfg.json similarity index 100% rename from ether-price-getter/curl_cfg.json rename to archived/ether-price-getter/curl_cfg.json diff --git a/ether-price-getter/ether_price_getter/.gitignore b/archived/ether-price-getter/ether_price_getter/.gitignore similarity index 100% rename from ether-price-getter/ether_price_getter/.gitignore rename to archived/ether-price-getter/ether_price_getter/.gitignore diff --git a/ether-price-getter/ether_price_getter/Cargo.toml b/archived/ether-price-getter/ether_price_getter/Cargo.toml similarity index 100% rename from ether-price-getter/ether_price_getter/Cargo.toml rename to archived/ether-price-getter/ether_price_getter/Cargo.toml diff --git a/ether-price-getter/ether_price_getter/src/eth_price_getter.rs b/archived/ether-price-getter/ether_price_getter/src/eth_price_getter.rs similarity index 100% rename from ether-price-getter/ether_price_getter/src/eth_price_getter.rs rename to archived/ether-price-getter/ether_price_getter/src/eth_price_getter.rs diff --git a/ether-price-getter/ether_price_getter/src/fce_results.rs b/archived/ether-price-getter/ether_price_getter/src/fce_results.rs similarity index 100% rename from ether-price-getter/ether_price_getter/src/fce_results.rs rename to archived/ether-price-getter/ether_price_getter/src/fce_results.rs diff --git a/ether-price-getter/ether_price_getter/src/main.rs b/archived/ether-price-getter/ether_price_getter/src/main.rs similarity index 100% rename from ether-price-getter/ether_price_getter/src/main.rs rename to archived/ether-price-getter/ether_price_getter/src/main.rs diff --git a/ether-price-getter/ether_price_getter_cfg.json b/archived/ether-price-getter/ether_price_getter_cfg.json similarity index 100% rename from ether-price-getter/ether_price_getter_cfg.json rename to archived/ether-price-getter/ether_price_getter_cfg.json diff --git a/fluence-cuckoo/Readme.md b/archived/fluence-cuckoo/Readme.md similarity index 100% rename from fluence-cuckoo/Readme.md rename to archived/fluence-cuckoo/Readme.md diff --git a/ether-price-getter/.gitignore b/archived/fluence-cuckoo/cuckoo-filter/.gitignore similarity index 100% rename from ether-price-getter/.gitignore rename to archived/fluence-cuckoo/cuckoo-filter/.gitignore diff --git a/fluence-cuckoo/cuckoo-filter/Cargo.toml b/archived/fluence-cuckoo/cuckoo-filter/Cargo.toml similarity index 100% rename from fluence-cuckoo/cuckoo-filter/Cargo.toml rename to archived/fluence-cuckoo/cuckoo-filter/Cargo.toml diff --git a/fluence-cuckoo/cuckoo-filter/Config.toml b/archived/fluence-cuckoo/cuckoo-filter/Config.toml similarity index 100% rename from fluence-cuckoo/cuckoo-filter/Config.toml rename to archived/fluence-cuckoo/cuckoo-filter/Config.toml diff --git a/fluence-cuckoo/cuckoo-filter/air-scripts/cuckoo_create_cf.clj b/archived/fluence-cuckoo/cuckoo-filter/air-scripts/cuckoo_create_cf.clj similarity index 100% rename from fluence-cuckoo/cuckoo-filter/air-scripts/cuckoo_create_cf.clj rename to archived/fluence-cuckoo/cuckoo-filter/air-scripts/cuckoo_create_cf.clj diff --git a/fluence-cuckoo/cuckoo-filter/air-scripts/cuckoo_service_info.clj b/archived/fluence-cuckoo/cuckoo-filter/air-scripts/cuckoo_service_info.clj similarity index 100% rename from fluence-cuckoo/cuckoo-filter/air-scripts/cuckoo_service_info.clj rename to archived/fluence-cuckoo/cuckoo-filter/air-scripts/cuckoo_service_info.clj diff --git a/fluence-cuckoo/cuckoo-filter/build.sh b/archived/fluence-cuckoo/cuckoo-filter/build.sh similarity index 100% rename from fluence-cuckoo/cuckoo-filter/build.sh rename to archived/fluence-cuckoo/cuckoo-filter/build.sh diff --git a/fluence-cuckoo/cuckoo-filter/cuckoo_cfg.json b/archived/fluence-cuckoo/cuckoo-filter/cuckoo_cfg.json similarity index 100% rename from fluence-cuckoo/cuckoo-filter/cuckoo_cfg.json rename to archived/fluence-cuckoo/cuckoo-filter/cuckoo_cfg.json diff --git a/fluence-cuckoo/cuckoo-filter/src/main.rs b/archived/fluence-cuckoo/cuckoo-filter/src/main.rs similarity index 100% rename from fluence-cuckoo/cuckoo-filter/src/main.rs rename to archived/fluence-cuckoo/cuckoo-filter/src/main.rs diff --git a/fluence-cuckoo/cuckoo-filter/test.sh b/archived/fluence-cuckoo/cuckoo-filter/test.sh similarity index 100% rename from fluence-cuckoo/cuckoo-filter/test.sh rename to archived/fluence-cuckoo/cuckoo-filter/test.sh diff --git a/multi-service/Block-Getter-Config.toml b/archived/multi-service/Block-Getter-Config.toml similarity index 100% rename from multi-service/Block-Getter-Config.toml rename to archived/multi-service/Block-Getter-Config.toml diff --git a/multi-service/Block-Getter-with-Converter-Config.toml b/archived/multi-service/Block-Getter-with-Converter-Config.toml similarity index 100% rename from multi-service/Block-Getter-with-Converter-Config.toml rename to archived/multi-service/Block-Getter-with-Converter-Config.toml diff --git a/multi-service/Config.toml b/archived/multi-service/Config.toml similarity index 100% rename from multi-service/Config.toml rename to archived/multi-service/Config.toml diff --git a/multi-service/air-scripts/add_stored_service.clj b/archived/multi-service/air-scripts/add_stored_service.clj similarity index 100% rename from multi-service/air-scripts/add_stored_service.clj rename to archived/multi-service/air-scripts/add_stored_service.clj diff --git a/multi-service/air-scripts/am_i_owner.clj b/archived/multi-service/air-scripts/am_i_owner.clj similarity index 100% rename from multi-service/air-scripts/am_i_owner.clj rename to archived/multi-service/air-scripts/am_i_owner.clj diff --git a/multi-service/air-scripts/curl_req.clj b/archived/multi-service/air-scripts/curl_req.clj similarity index 100% rename from multi-service/air-scripts/curl_req.clj rename to archived/multi-service/air-scripts/curl_req.clj diff --git a/multi-service/air-scripts/ethqlite_block_committer.clj b/archived/multi-service/air-scripts/ethqlite_block_committer.clj similarity index 100% rename from multi-service/air-scripts/ethqlite_block_committer.clj rename to archived/multi-service/air-scripts/ethqlite_block_committer.clj diff --git a/multi-service/air-scripts/ethqlite_init.clj b/archived/multi-service/air-scripts/ethqlite_init.clj similarity index 100% rename from multi-service/air-scripts/ethqlite_init.clj rename to archived/multi-service/air-scripts/ethqlite_init.clj diff --git a/multi-service/air-scripts/ethqlite_owner.clj b/archived/multi-service/air-scripts/ethqlite_owner.clj similarity index 100% rename from multi-service/air-scripts/ethqlite_owner.clj rename to archived/multi-service/air-scripts/ethqlite_owner.clj diff --git a/multi-service/air-scripts/ethqlite_reset.clj b/archived/multi-service/air-scripts/ethqlite_reset.clj similarity index 100% rename from multi-service/air-scripts/ethqlite_reset.clj rename to archived/multi-service/air-scripts/ethqlite_reset.clj diff --git a/multi-service/air-scripts/ethqlite_roundtrip.clj b/archived/multi-service/air-scripts/ethqlite_roundtrip.clj similarity index 100% rename from multi-service/air-scripts/ethqlite_roundtrip.clj rename to archived/multi-service/air-scripts/ethqlite_roundtrip.clj diff --git a/multi-service/air-scripts/get_address.clj b/archived/multi-service/air-scripts/get_address.clj similarity index 100% rename from multi-service/air-scripts/get_address.clj rename to archived/multi-service/air-scripts/get_address.clj diff --git a/multi-service/air-scripts/get_block_simple.clj b/archived/multi-service/air-scripts/get_block_simple.clj similarity index 100% rename from multi-service/air-scripts/get_block_simple.clj rename to archived/multi-service/air-scripts/get_block_simple.clj diff --git a/multi-service/air-scripts/get_latest_block.clj b/archived/multi-service/air-scripts/get_latest_block.clj similarity index 100% rename from multi-service/air-scripts/get_latest_block.clj rename to archived/multi-service/air-scripts/get_latest_block.clj diff --git a/multi-service/air-scripts/get_latest_block_simple.clj b/archived/multi-service/air-scripts/get_latest_block_simple.clj similarity index 100% rename from multi-service/air-scripts/get_latest_block_simple.clj rename to archived/multi-service/air-scripts/get_latest_block_simple.clj diff --git a/multi-service/air-scripts/hex2int.clj b/archived/multi-service/air-scripts/hex2int.clj similarity index 100% rename from multi-service/air-scripts/hex2int.clj rename to archived/multi-service/air-scripts/hex2int.clj diff --git a/multi-service/air-scripts/latest_reward_block.clj b/archived/multi-service/air-scripts/latest_reward_block.clj similarity index 100% rename from multi-service/air-scripts/latest_reward_block.clj rename to archived/multi-service/air-scripts/latest_reward_block.clj diff --git a/multi-service/air-scripts/list_stored_services.clj b/archived/multi-service/air-scripts/list_stored_services.clj similarity index 100% rename from multi-service/air-scripts/list_stored_services.clj rename to archived/multi-service/air-scripts/list_stored_services.clj diff --git a/multi-service/air-scripts/multi_block_processor.clj b/archived/multi-service/air-scripts/multi_block_processor.clj similarity index 100% rename from multi-service/air-scripts/multi_block_processor.clj rename to archived/multi-service/air-scripts/multi_block_processor.clj diff --git a/multi-service/air-scripts/remove_stored_service.clj b/archived/multi-service/air-scripts/remove_stored_service.clj similarity index 100% rename from multi-service/air-scripts/remove_stored_service.clj rename to archived/multi-service/air-scripts/remove_stored_service.clj diff --git a/multi-service/air-scripts/sqlite_tester.clj b/archived/multi-service/air-scripts/sqlite_tester.clj similarity index 100% rename from multi-service/air-scripts/sqlite_tester.clj rename to archived/multi-service/air-scripts/sqlite_tester.clj diff --git a/multi-service/air-scripts/test_air.clj b/archived/multi-service/air-scripts/test_air.clj similarity index 100% rename from multi-service/air-scripts/test_air.clj rename to archived/multi-service/air-scripts/test_air.clj diff --git a/multi-service/block_getter/.gitignore b/archived/multi-service/block_getter/.gitignore similarity index 100% rename from multi-service/block_getter/.gitignore rename to archived/multi-service/block_getter/.gitignore diff --git a/multi-service/block_getter/Cargo.toml b/archived/multi-service/block_getter/Cargo.toml similarity index 100% rename from multi-service/block_getter/Cargo.toml rename to archived/multi-service/block_getter/Cargo.toml diff --git a/multi-service/block_getter/src/eth_block_getters.rs b/archived/multi-service/block_getter/src/eth_block_getters.rs similarity index 100% rename from multi-service/block_getter/src/eth_block_getters.rs rename to archived/multi-service/block_getter/src/eth_block_getters.rs diff --git a/multi-service/block_getter/src/main.rs b/archived/multi-service/block_getter/src/main.rs similarity index 100% rename from multi-service/block_getter/src/main.rs rename to archived/multi-service/block_getter/src/main.rs diff --git a/multi-service/config/block_getter_cfg.json b/archived/multi-service/config/block_getter_cfg.json similarity index 100% rename from multi-service/config/block_getter_cfg.json rename to archived/multi-service/config/block_getter_cfg.json diff --git a/multi-service/config/curl_cfg.json b/archived/multi-service/config/curl_cfg.json similarity index 100% rename from multi-service/config/curl_cfg.json rename to archived/multi-service/config/curl_cfg.json diff --git a/multi-service/config/extract_miner_address_cfg.json b/archived/multi-service/config/extract_miner_address_cfg.json similarity index 100% rename from multi-service/config/extract_miner_address_cfg.json rename to archived/multi-service/config/extract_miner_address_cfg.json diff --git a/multi-service/config/hex_converter_cfg.json b/archived/multi-service/config/hex_converter_cfg.json similarity index 100% rename from multi-service/config/hex_converter_cfg.json rename to archived/multi-service/config/hex_converter_cfg.json diff --git a/multi-service/config/my_keypair.json b/archived/multi-service/config/my_keypair.json similarity index 100% rename from multi-service/config/my_keypair.json rename to archived/multi-service/config/my_keypair.json diff --git a/multi-service/curl_adapter/.gitignore b/archived/multi-service/curl_adapter/.gitignore similarity index 100% rename from multi-service/curl_adapter/.gitignore rename to archived/multi-service/curl_adapter/.gitignore diff --git a/multi-service/curl_adapter/Cargo.toml b/archived/multi-service/curl_adapter/Cargo.toml similarity index 100% rename from multi-service/curl_adapter/Cargo.toml rename to archived/multi-service/curl_adapter/Cargo.toml diff --git a/multi-service/curl_adapter/src/main.rs b/archived/multi-service/curl_adapter/src/main.rs similarity index 100% rename from multi-service/curl_adapter/src/main.rs rename to archived/multi-service/curl_adapter/src/main.rs diff --git a/multi-service/ethqlite/.gitignore b/archived/multi-service/ethqlite/.gitignore similarity index 100% rename from multi-service/ethqlite/.gitignore rename to archived/multi-service/ethqlite/.gitignore diff --git a/multi-service/ethqlite/Cargo.toml b/archived/multi-service/ethqlite/Cargo.toml similarity index 100% rename from multi-service/ethqlite/Cargo.toml rename to archived/multi-service/ethqlite/Cargo.toml diff --git a/multi-service/ethqlite/Config.toml b/archived/multi-service/ethqlite/Config.toml similarity index 100% rename from multi-service/ethqlite/Config.toml rename to archived/multi-service/ethqlite/Config.toml diff --git a/multi-service/ethqlite/build.sh b/archived/multi-service/ethqlite/build.sh similarity index 100% rename from multi-service/ethqlite/build.sh rename to archived/multi-service/ethqlite/build.sh diff --git a/multi-service/ethqlite/ethqlite_cfg.json b/archived/multi-service/ethqlite/ethqlite_cfg.json similarity index 100% rename from multi-service/ethqlite/ethqlite_cfg.json rename to archived/multi-service/ethqlite/ethqlite_cfg.json diff --git a/multi-service/ethqlite/sqlite3_cfg.json b/archived/multi-service/ethqlite/sqlite3_cfg.json similarity index 100% rename from multi-service/ethqlite/sqlite3_cfg.json rename to archived/multi-service/ethqlite/sqlite3_cfg.json diff --git a/multi-service/ethqlite/src/auth.rs b/archived/multi-service/ethqlite/src/auth.rs similarity index 100% rename from multi-service/ethqlite/src/auth.rs rename to archived/multi-service/ethqlite/src/auth.rs diff --git a/multi-service/ethqlite/src/crud.rs b/archived/multi-service/ethqlite/src/crud.rs similarity index 100% rename from multi-service/ethqlite/src/crud.rs rename to archived/multi-service/ethqlite/src/crud.rs diff --git a/multi-service/ethqlite/src/main.rs b/archived/multi-service/ethqlite/src/main.rs similarity index 100% rename from multi-service/ethqlite/src/main.rs rename to archived/multi-service/ethqlite/src/main.rs diff --git a/multi-service/extract_miner_address/Cargo.toml b/archived/multi-service/extract_miner_address/Cargo.toml similarity index 100% rename from multi-service/extract_miner_address/Cargo.toml rename to archived/multi-service/extract_miner_address/Cargo.toml diff --git a/multi-service/extract_miner_address/src/main.rs b/archived/multi-service/extract_miner_address/src/main.rs similarity index 100% rename from multi-service/extract_miner_address/src/main.rs rename to archived/multi-service/extract_miner_address/src/main.rs diff --git a/multi-service/hex_converter/.gitignore b/archived/multi-service/hex_converter/.gitignore similarity index 100% rename from multi-service/hex_converter/.gitignore rename to archived/multi-service/hex_converter/.gitignore diff --git a/multi-service/hex_converter/Cargo.toml b/archived/multi-service/hex_converter/Cargo.toml similarity index 100% rename from multi-service/hex_converter/Cargo.toml rename to archived/multi-service/hex_converter/Cargo.toml diff --git a/multi-service/hex_converter/src/main.rs b/archived/multi-service/hex_converter/src/main.rs similarity index 100% rename from multi-service/hex_converter/src/main.rs rename to archived/multi-service/hex_converter/src/main.rs diff --git a/multi-service/scripts/build.sh b/archived/multi-service/scripts/build.sh similarity index 100% rename from multi-service/scripts/build.sh rename to archived/multi-service/scripts/build.sh diff --git a/multi-service/scripts/deploy.sh b/archived/multi-service/scripts/deploy.sh similarity index 100% rename from multi-service/scripts/deploy.sh rename to archived/multi-service/scripts/deploy.sh diff --git a/multi-service/simple_range_func/.gitignore b/archived/multi-service/simple_range_func/.gitignore similarity index 100% rename from multi-service/simple_range_func/.gitignore rename to archived/multi-service/simple_range_func/.gitignore diff --git a/multi-service/simple_range_func/Cargo.toml b/archived/multi-service/simple_range_func/Cargo.toml similarity index 100% rename from multi-service/simple_range_func/Cargo.toml rename to archived/multi-service/simple_range_func/Cargo.toml diff --git a/multi-service/simple_range_func/src/main.rs b/archived/multi-service/simple_range_func/src/main.rs similarity index 100% rename from multi-service/simple_range_func/src/main.rs rename to archived/multi-service/simple_range_func/src/main.rs diff --git a/web3-examples/web-frontend/.gitignore b/archived/web3-examples/web-frontend/.gitignore similarity index 100% rename from web3-examples/web-frontend/.gitignore rename to archived/web3-examples/web-frontend/.gitignore diff --git a/web3-examples/web-frontend/.prettierrc.js b/archived/web3-examples/web-frontend/.prettierrc.js similarity index 100% rename from web3-examples/web-frontend/.prettierrc.js rename to archived/web3-examples/web-frontend/.prettierrc.js diff --git a/web3-examples/web-frontend/README.md b/archived/web3-examples/web-frontend/README.md similarity index 100% rename from web3-examples/web-frontend/README.md rename to archived/web3-examples/web-frontend/README.md diff --git a/web3-examples/web-frontend/package-lock.json b/archived/web3-examples/web-frontend/package-lock.json similarity index 100% rename from web3-examples/web-frontend/package-lock.json rename to archived/web3-examples/web-frontend/package-lock.json diff --git a/web3-examples/web-frontend/package.json b/archived/web3-examples/web-frontend/package.json similarity index 100% rename from web3-examples/web-frontend/package.json rename to archived/web3-examples/web-frontend/package.json diff --git a/web3-examples/web-frontend/public/favicon.ico b/archived/web3-examples/web-frontend/public/favicon.ico similarity index 100% rename from web3-examples/web-frontend/public/favicon.ico rename to archived/web3-examples/web-frontend/public/favicon.ico diff --git a/web3-examples/web-frontend/public/index.html b/archived/web3-examples/web-frontend/public/index.html similarity index 100% rename from web3-examples/web-frontend/public/index.html rename to archived/web3-examples/web-frontend/public/index.html diff --git a/web3-examples/web-frontend/public/logo192.png b/archived/web3-examples/web-frontend/public/logo192.png similarity index 100% rename from web3-examples/web-frontend/public/logo192.png rename to archived/web3-examples/web-frontend/public/logo192.png diff --git a/web3-examples/web-frontend/public/logo512.png b/archived/web3-examples/web-frontend/public/logo512.png similarity index 100% rename from web3-examples/web-frontend/public/logo512.png rename to archived/web3-examples/web-frontend/public/logo512.png diff --git a/web3-examples/web-frontend/public/manifest.json b/archived/web3-examples/web-frontend/public/manifest.json similarity index 100% rename from web3-examples/web-frontend/public/manifest.json rename to archived/web3-examples/web-frontend/public/manifest.json diff --git a/web3-examples/web-frontend/public/robots.txt b/archived/web3-examples/web-frontend/public/robots.txt similarity index 100% rename from web3-examples/web-frontend/public/robots.txt rename to archived/web3-examples/web-frontend/public/robots.txt diff --git a/web3-examples/web-frontend/src/components/App.scss b/archived/web3-examples/web-frontend/src/components/App.scss similarity index 100% rename from web3-examples/web-frontend/src/components/App.scss rename to archived/web3-examples/web-frontend/src/components/App.scss diff --git a/web3-examples/web-frontend/src/components/App.tsx b/archived/web3-examples/web-frontend/src/components/App.tsx similarity index 100% rename from web3-examples/web-frontend/src/components/App.tsx rename to archived/web3-examples/web-frontend/src/components/App.tsx diff --git a/web3-examples/web-frontend/src/fluence.ts b/archived/web3-examples/web-frontend/src/fluence.ts similarity index 100% rename from web3-examples/web-frontend/src/fluence.ts rename to archived/web3-examples/web-frontend/src/fluence.ts diff --git a/web3-examples/web-frontend/src/index.scss b/archived/web3-examples/web-frontend/src/index.scss similarity index 100% rename from web3-examples/web-frontend/src/index.scss rename to archived/web3-examples/web-frontend/src/index.scss diff --git a/web3-examples/web-frontend/src/index.tsx b/archived/web3-examples/web-frontend/src/index.tsx similarity index 100% rename from web3-examples/web-frontend/src/index.tsx rename to archived/web3-examples/web-frontend/src/index.tsx diff --git a/web3-examples/web-frontend/src/react-app-env.d.ts b/archived/web3-examples/web-frontend/src/react-app-env.d.ts similarity index 100% rename from web3-examples/web-frontend/src/react-app-env.d.ts rename to archived/web3-examples/web-frontend/src/react-app-env.d.ts diff --git a/web3-examples/web-frontend/src/setupTests.ts b/archived/web3-examples/web-frontend/src/setupTests.ts similarity index 100% rename from web3-examples/web-frontend/src/setupTests.ts rename to archived/web3-examples/web-frontend/src/setupTests.ts diff --git a/web3-examples/web-frontend/tsconfig.json b/archived/web3-examples/web-frontend/tsconfig.json similarity index 100% rename from web3-examples/web-frontend/tsconfig.json rename to archived/web3-examples/web-frontend/tsconfig.json diff --git a/web3-examples/web3-examples/.gitignore b/archived/web3-examples/web3-examples/.gitignore similarity index 100% rename from web3-examples/web3-examples/.gitignore rename to archived/web3-examples/web3-examples/.gitignore diff --git a/web3-examples/web3-examples/Config.toml b/archived/web3-examples/web3-examples/Config.toml similarity index 100% rename from web3-examples/web3-examples/Config.toml rename to archived/web3-examples/web3-examples/Config.toml diff --git a/web3-examples/web3-examples/Readme.md b/archived/web3-examples/web3-examples/Readme.md similarity index 100% rename from web3-examples/web3-examples/Readme.md rename to archived/web3-examples/web3-examples/Readme.md diff --git a/web3-examples/web3-examples/build.sh b/archived/web3-examples/web3-examples/build.sh similarity index 100% rename from web3-examples/web3-examples/build.sh rename to archived/web3-examples/web3-examples/build.sh diff --git a/web3-examples/web3-examples/curl_adapter/.gitignore b/archived/web3-examples/web3-examples/curl_adapter/.gitignore similarity index 100% rename from web3-examples/web3-examples/curl_adapter/.gitignore rename to archived/web3-examples/web3-examples/curl_adapter/.gitignore diff --git a/web3-examples/web3-examples/curl_adapter/Cargo.toml b/archived/web3-examples/web3-examples/curl_adapter/Cargo.toml similarity index 100% rename from web3-examples/web3-examples/curl_adapter/Cargo.toml rename to archived/web3-examples/web3-examples/curl_adapter/Cargo.toml diff --git a/web3-examples/web3-examples/curl_adapter/Config.json b/archived/web3-examples/web3-examples/curl_adapter/Config.json similarity index 100% rename from web3-examples/web3-examples/curl_adapter/Config.json rename to archived/web3-examples/web3-examples/curl_adapter/Config.json diff --git a/web3-examples/web3-examples/curl_adapter/src/main.rs b/archived/web3-examples/web3-examples/curl_adapter/src/main.rs similarity index 100% rename from web3-examples/web3-examples/curl_adapter/src/main.rs rename to archived/web3-examples/web3-examples/curl_adapter/src/main.rs diff --git a/web3-examples/web3-examples/docs/Frontend.md b/archived/web3-examples/web3-examples/docs/Frontend.md similarity index 100% rename from web3-examples/web3-examples/docs/Frontend.md rename to archived/web3-examples/web3-examples/docs/Frontend.md diff --git a/web3-examples/web3-examples/facade/.gitignore b/archived/web3-examples/web3-examples/facade/.gitignore similarity index 100% rename from web3-examples/web3-examples/facade/.gitignore rename to archived/web3-examples/web3-examples/facade/.gitignore diff --git a/web3-examples/web3-examples/facade/Cargo.toml b/archived/web3-examples/web3-examples/facade/Cargo.toml similarity index 100% rename from web3-examples/web3-examples/facade/Cargo.toml rename to archived/web3-examples/web3-examples/facade/Cargo.toml diff --git a/web3-examples/web3-examples/facade/src/data_processing.rs b/archived/web3-examples/web3-examples/facade/src/data_processing.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/data_processing.rs rename to archived/web3-examples/web3-examples/facade/src/data_processing.rs diff --git a/web3-examples/web3-examples/facade/src/data_processing_tests.rs b/archived/web3-examples/web3-examples/facade/src/data_processing_tests.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/data_processing_tests.rs rename to archived/web3-examples/web3-examples/facade/src/data_processing_tests.rs diff --git a/web3-examples/web3-examples/facade/src/eth_calls.rs b/archived/web3-examples/web3-examples/facade/src/eth_calls.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/eth_calls.rs rename to archived/web3-examples/web3-examples/facade/src/eth_calls.rs diff --git a/web3-examples/web3-examples/facade/src/eth_calls_tests.rs b/archived/web3-examples/web3-examples/facade/src/eth_calls_tests.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/eth_calls_tests.rs rename to archived/web3-examples/web3-examples/facade/src/eth_calls_tests.rs diff --git a/web3-examples/web3-examples/facade/src/eth_filter_test.rs b/archived/web3-examples/web3-examples/facade/src/eth_filter_test.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/eth_filter_test.rs rename to archived/web3-examples/web3-examples/facade/src/eth_filter_test.rs diff --git a/web3-examples/web3-examples/facade/src/eth_filters.rs b/archived/web3-examples/web3-examples/facade/src/eth_filters.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/eth_filters.rs rename to archived/web3-examples/web3-examples/facade/src/eth_filters.rs diff --git a/web3-examples/web3-examples/facade/src/eth_hashers.rs b/archived/web3-examples/web3-examples/facade/src/eth_hashers.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/eth_hashers.rs rename to archived/web3-examples/web3-examples/facade/src/eth_hashers.rs diff --git a/web3-examples/web3-examples/facade/src/eth_type_test.rs b/archived/web3-examples/web3-examples/facade/src/eth_type_test.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/eth_type_test.rs rename to archived/web3-examples/web3-examples/facade/src/eth_type_test.rs diff --git a/web3-examples/web3-examples/facade/src/eth_utils.rs b/archived/web3-examples/web3-examples/facade/src/eth_utils.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/eth_utils.rs rename to archived/web3-examples/web3-examples/facade/src/eth_utils.rs diff --git a/web3-examples/web3-examples/facade/src/fce_results.rs b/archived/web3-examples/web3-examples/facade/src/fce_results.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/fce_results.rs rename to archived/web3-examples/web3-examples/facade/src/fce_results.rs diff --git a/web3-examples/web3-examples/facade/src/jsonrpc_helpers.rs b/archived/web3-examples/web3-examples/facade/src/jsonrpc_helpers.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/jsonrpc_helpers.rs rename to archived/web3-examples/web3-examples/facade/src/jsonrpc_helpers.rs diff --git a/web3-examples/web3-examples/facade/src/main.rs b/archived/web3-examples/web3-examples/facade/src/main.rs similarity index 100% rename from web3-examples/web3-examples/facade/src/main.rs rename to archived/web3-examples/web3-examples/facade/src/main.rs diff --git a/curl_template/backend/Cargo.lock b/curl_template/backend/Cargo.lock deleted file mode 100644 index 8e18b43..0000000 --- a/curl_template/backend/Cargo.lock +++ /dev/null @@ -1,262 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "libc", - "num-integer", - "num-traits", - "time", - "winapi", -] - -[[package]] -name = "curl_template" -version = "0.1.0" -dependencies = [ - "fluence", -] - -[[package]] -name = "fluence" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b09e1cd11a51ba4d169db347d009fe41ece2714eef4d5df720343733a1d5a6" -dependencies = [ - "fluence-sdk-main", - "marine-macro", - "marine-timestamp-macro", - "serde", -] - -[[package]] -name = "fluence-sdk-main" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68d93cde99e1494e11755a39b93863333397245c9959c774fe3bebd9e4143879" -dependencies = [ - "log", - "marine-macro", - "serde", -] - -[[package]] -name = "getrandom" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "itoa" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" - -[[package]] -name = "libc" -version = "0.2.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "marine-macro" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63d927851847cc3dd9e3bd0f10bdeb313859d4822d5b5f650d9d34d461ed419" -dependencies = [ - "marine-macro-impl", -] - -[[package]] -name = "marine-macro-impl" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb504be4a90e229ab453c7369cc8a9063acec819f3397802eea719cd0a232be1" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn", - "uuid", -] - -[[package]] -name = "marine-timestamp-macro" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5994c7db5567d21609f2a2e5a40d9d4564f86c17ca35b2d77007152619b9d7fc" -dependencies = [ - "chrono", - "quote", -] - -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "serde" -version = "1.0.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43535db9747a4ba938c0ce0a98cc631a46ebf943c9e1d604e091df6007620bf6" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "syn" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6498a9efc342871f91cc2d0d694c674368b4ceb40f62b65a7a08c3792935e702" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "time" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi", - "winapi", -] - -[[package]] -name = "unicode-xid" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" - -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/echo-greeter/echo-service/Cargo.lock b/echo-greeter/echo-service/Cargo.lock deleted file mode 100644 index 886894e..0000000 --- a/echo-greeter/echo-service/Cargo.lock +++ /dev/null @@ -1,261 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "libc", - "num-integer", - "num-traits", - "time", - "winapi", -] - -[[package]] -name = "echo-service" -version = "0.1.0" -dependencies = [ - "log", - "marine-rs-sdk", -] - -[[package]] -name = "getrandom" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "itoa" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" - -[[package]] -name = "libc" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "marine-macro" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd64d5febc6b2ed709a4461c510c1429dc6e4cfcbd6ca0d88463911630acd67b" -dependencies = [ - "marine-macro-impl", -] - -[[package]] -name = "marine-macro-impl" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c644127c4a9a3345434116f6887f8522c51bddde599b51d7d312aa8b2ecfaa54" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn", - "uuid", -] - -[[package]] -name = "marine-rs-sdk" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb421eb08e8b8cef726a73a0c10bff45b43c41a85aa965de14487cea373883bb" -dependencies = [ - "marine-macro", - "marine-rs-sdk-main", - "marine-timestamp-macro", - "serde", -] - -[[package]] -name = "marine-rs-sdk-main" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95c49b5893d8689589219e07cf67421cc415dc5f219ad0e9c197a9a050b5dd4f" -dependencies = [ - "log", - "marine-macro", - "serde", -] - -[[package]] -name = "marine-timestamp-macro" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ae1a5630bd9b652a77405750c3c37a5fdcfcdc679818bf7d970871ae28f7e6" -dependencies = [ - "chrono", - "quote", -] - -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "serde" -version = "1.0.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "syn" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fe99c6bd8b1cc636890bcc071842de909d902c81ac7dab53ba33c421ab8ffb" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "time" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi", - "winapi", -] - -[[package]] -name = "unicode-xid" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" - -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/echo-greeter/secure-greeter/Cargo.lock b/echo-greeter/secure-greeter/Cargo.lock deleted file mode 100644 index 44ccbc4..0000000 --- a/echo-greeter/secure-greeter/Cargo.lock +++ /dev/null @@ -1,261 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "libc", - "num-integer", - "num-traits", - "time", - "winapi", -] - -[[package]] -name = "getrandom" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "itoa" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" - -[[package]] -name = "libc" -version = "0.2.97" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "marine-macro" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd64d5febc6b2ed709a4461c510c1429dc6e4cfcbd6ca0d88463911630acd67b" -dependencies = [ - "marine-macro-impl", -] - -[[package]] -name = "marine-macro-impl" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c644127c4a9a3345434116f6887f8522c51bddde599b51d7d312aa8b2ecfaa54" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn", - "uuid", -] - -[[package]] -name = "marine-rs-sdk" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb421eb08e8b8cef726a73a0c10bff45b43c41a85aa965de14487cea373883bb" -dependencies = [ - "marine-macro", - "marine-rs-sdk-main", - "marine-timestamp-macro", - "serde", -] - -[[package]] -name = "marine-rs-sdk-main" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95c49b5893d8689589219e07cf67421cc415dc5f219ad0e9c197a9a050b5dd4f" -dependencies = [ - "log", - "marine-macro", - "serde", -] - -[[package]] -name = "marine-timestamp-macro" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ae1a5630bd9b652a77405750c3c37a5fdcfcdc679818bf7d970871ae28f7e6" -dependencies = [ - "chrono", - "quote", -] - -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "secure-greeter" -version = "0.1.0" -dependencies = [ - "log", - "marine-rs-sdk", -] - -[[package]] -name = "serde" -version = "1.0.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "syn" -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "time" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi", - "winapi", -] - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/ipfs-node/Config.toml b/ipfs-node/Config.toml deleted file mode 100644 index c5e30c6..0000000 --- a/ipfs-node/Config.toml +++ /dev/null @@ -1,17 +0,0 @@ -modules_dir = "artifacts/" - -[[module]] - name = "ipfs_effector" - mem_pages_count = 100 - logger_enabled = true - - [module.mounted_binaries] - ipfs = "/usr/local/bin/ipfs" - - [module.wasi] - envs = { "IPFS_ADDR" = "/dns4/relay02.fluence.dev/tcp/15001", "timeout" = "1s" } - -[[module]] - name = "ipfs_pure" - mem_pages_count = 100 - logger_enabled = true diff --git a/ipfs-node/build.sh b/ipfs-node/build.sh deleted file mode 100755 index f758a91..0000000 --- a/ipfs-node/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -o errexit -o nounset -o pipefail - -# This script builds all subprojects and puts all created Wasm modules in one dir -cd effector -cargo update --aggressive -marine build --release - -cd ../pure -cargo update --aggressive -marine build --release - -cd .. -mkdir -p artifacts -rm -f artifacts/*.wasm -cp effector/target/wasm32-wasi/release/ipfs_effector.wasm artifacts/ -cp pure/target/wasm32-wasi/release/ipfs_pure.wasm artifacts/ diff --git a/ipfs-node/effector/Cargo.toml b/ipfs-node/effector/Cargo.toml deleted file mode 100644 index 606cda4..0000000 --- a/ipfs-node/effector/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "ipfs-effector" -version = "0.1.0" -authors = ["Fluence Labs"] -edition = "2018" -publish = false - -[[bin]] -name = "ipfs_effector" -path = "src/main.rs" - -[dependencies] -marine-rs-sdk = { version = "0.6.10", features = ["logger"] } -log = "0.4.14" \ No newline at end of file diff --git a/ipfs-node/effector/src/main.rs b/ipfs-node/effector/src/main.rs deleted file mode 100644 index f83b23b..0000000 --- a/ipfs-node/effector/src/main.rs +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2020 Fluence Labs Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#![allow(improper_ctypes)] - -mod path; - -use crate::path::to_full_path; - -use marine_rs_sdk::marine; -use marine_rs_sdk::module_manifest; -use marine_rs_sdk::MountedBinaryResult; -use marine_rs_sdk::WasmLoggerBuilder; - -const RESULT_FILE_PATH: &str = "/tmp/ipfs_rpc_file"; -const IPFS_ADDR_ENV_NAME: &str = "IPFS_ADDR"; -const TIMEOUT_ENV_NAME: &str = "timeout"; - -module_manifest!(); - -pub fn main() { - WasmLoggerBuilder::new() - .with_log_level(log::LevelFilter::Info) - .build() - .unwrap(); -} - -/// Put file from specified path to IPFS and return its hash. -#[marine] -pub fn put(file_path: String) -> String { - log::info!("put called with file path {}", file_path); - - let file_path = to_full_path(file_path); - - let timeout = std::env::var(TIMEOUT_ENV_NAME).unwrap_or_else(|_| "1s".to_string()); - let cmd = vec![ - String::from("add"), - String::from("--timeout"), - timeout, - String::from("-Q"), - file_path, - ]; - - let ipfs_result = ipfs(cmd); - ipfs_result - .into_std() - .unwrap() - .unwrap_or_else(std::convert::identity) -} - -/// Get file by provided hash from IPFS, saves it to a temporary file and returns a path to it. -#[marine] -pub fn get(hash: String) -> String { - log::info!("get called with hash {}", hash); - - let result_file_path = to_full_path(RESULT_FILE_PATH); - - let timeout = std::env::var(TIMEOUT_ENV_NAME).unwrap_or_else(|_| "1s".to_string()); - let cmd = vec![ - String::from("get"), - String::from("--timeout"), - timeout, - String::from("-o"), - result_file_path, - hash, - ]; - - ipfs(cmd); - RESULT_FILE_PATH.to_string() -} - -#[marine] -pub fn get_address() -> String { - match std::env::var(IPFS_ADDR_ENV_NAME) { - Ok(addr) => addr, - Err(e) => format!( - "getting {} env variable failed with error {:?}", - IPFS_ADDR_ENV_NAME, e - ), - } -} - -#[marine] -#[link(wasm_import_module = "host")] -extern "C" { - /// Execute provided cmd as a parameters of ipfs cli, return result. - pub fn ipfs(cmd: Vec) -> MountedBinaryResult; -} diff --git a/ipfs-node/effector/src/path.rs b/ipfs-node/effector/src/path.rs deleted file mode 100644 index 3fa025d..0000000 --- a/ipfs-node/effector/src/path.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2020 Fluence Labs Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -pub(super) fn to_full_path(cmd: S) -> String -where - S: Into, -{ - use std::path::Component; - use std::path::Path; - - let cmd = cmd.into(); - let path = Path::new(&cmd); - - let mut components = path.components(); - let is_absolute = components.next() == Some(Component::RootDir); - - if !is_absolute { - return cmd; - } - - let parent = match components.next() { - Some(Component::Normal(path)) => path.to_str().unwrap(), - _ => return cmd, - }; - - match std::env::var(parent) { - Ok(to_dir) => { - let mut full_path = std::path::PathBuf::from(to_dir); - - // TODO: optimize this - #[allow(clippy::while_let_on_iterator)] - while let Some(component) = components.next() { - full_path.push(component); - } - full_path.to_string_lossy().into_owned() - } - Err(_) => cmd, - } -} diff --git a/ipfs-node/pure/Cargo.toml b/ipfs-node/pure/Cargo.toml deleted file mode 100644 index a82d393..0000000 --- a/ipfs-node/pure/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "ipfs-pure" -version = "0.1.0" -authors = ["Fluence Labs"] -edition = "2018" -publish = false - -[[bin]] -name = "ipfs_pure" -path = "src/main.rs" - -[dependencies] -marine-rs-sdk = { version = "0.6.10", features = ["logger"] } -log = "0.4.14" \ No newline at end of file diff --git a/ipfs-node/pure/src/main.rs b/ipfs-node/pure/src/main.rs deleted file mode 100644 index 7a28624..0000000 --- a/ipfs-node/pure/src/main.rs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2020 Fluence Labs Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#![allow(improper_ctypes)] - -use marine_rs_sdk::marine; -use marine_rs_sdk::module_manifest; -use marine_rs_sdk::WasmLoggerBuilder; - -use std::fs; -use std::path::PathBuf; - -const RPC_TMP_FILEPATH: &str = "/tmp/ipfs_rpc_file"; - -module_manifest!(); - -pub fn main() { - WasmLoggerBuilder::new() - .with_log_level(log::LevelFilter::Info) - .build() - .unwrap(); -} - -#[marine] -pub fn invoke() -> String { - "IPFS_RPC wasm example, it allows to:\ninvoke\nput\nget".to_string() -} - -#[marine] -pub fn put(file_content: Vec) -> String { - log::info!("put called with {:?}", file_content); - - let rpc_tmp_filepath = RPC_TMP_FILEPATH.to_string(); - - let r = fs::write(PathBuf::from(rpc_tmp_filepath.clone()), file_content); - if let Err(e) = r { - return format!("file can't be written: {}", e); - } - - ipfs_put(rpc_tmp_filepath) -} - -#[marine] -pub fn get(hash: String) -> Vec { - log::info!("get called with hash: {}", hash); - - let file_path = ipfs_get(hash); - fs::read(file_path).unwrap_or_else(|_| b"error while reading file".to_vec()) -} - -#[marine] -#[link(wasm_import_module = "ipfs_effector")] -extern "C" { - /// Put provided file to ipfs, return ipfs hash of the file. - #[link_name = "put"] - pub fn ipfs_put(file_path: String) -> String; - - /// Get file from ipfs by hash. - #[link_name = "get"] - pub fn ipfs_get(hash: String) -> String; -} diff --git a/marine-examples/README.md b/marine-examples/README.md new file mode 100644 index 0000000..7a4e984 --- /dev/null +++ b/marine-examples/README.md @@ -0,0 +1,568 @@ +# Marine Examples + +## Overview + +Fluence services are composed from Wasm modules written in Rust and configuration files. The examples in this directory illustrate how to construct a variety of modules and services. If you are not accessing the examples from the Fluence devcontainer, see the [Setup Environment](https://doc.fluence.dev/docs/tutorials_tutorials/recipes_setting_up) section of the Fluence documentation. + +**Services** are logical constructs derived from Wasm modules and the associated linking and configuration data, which describe how modules are linked with each other and how they interact, if at all, with the outside world. The instantiation of a service from Wasm modules takes place on the peer-to-peer network, i.e. at the node level. More specifically, **blueprints** are json documents that provide the necessary information to build, i.e. link, a service from Wasm modules. See Figure 1 for a stylized representation of module and service creation. + +Figure 1: Module And Service Creation With The Marine Toolchain + +```mermaid + stateDiagram + state "Rust Marine Code" as Code + state "Build wasm32-wasi Module" as Build + state "Test Wasm App With Cargo" as Test + state "REPL Locally Interact With Modules" as Repl + state "Module Configuration" as Config + state "Service Configuration" as Service + state "Deploy To Network" as Deploy + + [*] --> Code + Code --> Build + Build --> Repl + Config --> Repl + Config --> Test + Build --> Test + Build --> Deploy + Service --> Deploy +``` + +Wasm modules can also be accessed locally through the Marine REPL and tested with `cargo test`. + +## Greeting Example + +This is a very simple service comprised of a single Wasam module, where the module only has one function, `greeting`. Fundamentally, this example illustrates how to build a function as a service (FaaS) for peer-to-peer deployment, with the exciting purpose of providing a *hello world* experience. + +The Rust code for our greeting function is straight forward with the exception of the `#[marine]` macro (1). This macro, among other things, ensures for Wasm Interface Type checking and compilation and is critical for Rust code to compile to the desired wasm32-wasi target. + +```rust +use marine_rs_sdk::marine; +use marine_rs_sdk::module_manifest; + +module_manifest!(); + +pub fn main() {} + +#[marine] // <- 1 +pub fn greeting(name: String) -> String { + format!("Hi, {}", name) +} + +#[cfg(test)] +mod tests { + use marine_rs_sdk_test::marine_test; + + #[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")] // <- 2 + fn empty_string() { + let actual = greeting.greeting(String::new()); // <- 3 + assert_eq!(actual, "Hi, "); + } + + #[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")] + fn non_empty_string() { + let actual = greeting.greeting("name".to_string()); + assert_eq!(actual, "Hi, name"); + } +} +``` + +The test section is also pretty standard except for the macro (2). But looks can be deceiving. While the tests are run with the familiar `cargo test`, the actual code tested is **not** the Rust code from the body but from the Wasm module. The macro facilitates the import and execution of the Wasm module in the artifacts directory and the Config.toml file and then accesses the test function through the module namespace (3). Hence, the code needs to be compiled to the Wasm module before running the test. + +Let's have a look at the Config.toml file, which describes that only one module is linked by specifying the location of the module (1), the name (2), the desired memory allocation (#) and the logging (4) preference. + +```toml +modules_dir = "artifacts/" # <- 1 + +[[module]] + name = "greeting" # <- 2 + mem_pages_count = 1 # <- 3 + logger_enabled = false # <- 4 +``` + +In order to compile the example, which copies the Wasm module to the artifacts directory. + +```bash +cd greeting +./build.sh +``` + +Now that we have a module and a config file, we can locally inspect and test: + +```bash + mrepl Config.toml +Welcome to the Marine REPL (version 0.8.0) +Minimal supported versions + sdk: 0.6.0 + interface-types: 0.20.0 + +app service was created with service id = 05af8670-7168-4ecd-b3e4-9579e0c66a25 +elapsed time 59.013893ms + +1> interface +Loaded modules interface: + +greeting: + fn greeting(name: string) -> string +``` + +Which allows us to call our greeting function: + +```bash +2> call greeting greeting ["Mundo"] +result: String("Hi, Mundo") + elapsed time: 827.042µs +``` + +Of course, we can also run `cargo test`: + +```bash +cargo +nightly test + Compiling proc-macro2 v1.0.27 + + Finished test [unoptimized + debuginfo] target(s) in 48.67s + Running unittests (target/debug/deps/greeting-52daae689012e571) + +running 2 tests +test tests::non_empty_string ... ok +test tests::empty_string ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.89 +``` + +Now that we have a function service, we can deploy it to the network. + +```bash +fldist --node-id ?? new_service --ms artifacts: +``` + +For a detailed introduction to and review of Fluence, see the [documentation](https://doc.fluence.dev/docs/). + +## Records Example + +This example illustrates the use of the [records type](https://github.com/fluencelabs/interface-types/blob/master/crates/it-types/src/types.rs) both as a pure and an effector module. Pure modules are comprised of functions without side-effects, whereas effector modules contain at least one function with side-effect. The TestRecord struct imported by both the pure and effector code is defined in the `test-record`. + +Since we have multiple modules comprising the service, the config file needs to reflect the multi module dependency: + +```toml +# Config.toml +modules_dir = "artifacts/" + +[[module]] + name = "records_effector" + mem_pages_count = 1 + logger_enabled = true + +[[module]] + name = "records_pure" + mem_pages_count = 1 + logger_enabled = true +``` + +Please note that since the `TestRecord` struct is imported by both the pure and effector module there is no need to include it directly in the config specification. + +Our linking scheme defined in Config.toml is fully reflected when we run the modules in the REPL: + +```bash +mrepl Config.toml +Welcome to the Marine REPL (version 0.8.0) +Minimal supported versions + sdk: 0.6.0 + interface-types: 0.20.0 + +app service was created with service id = 502d7df7-24fd-43ad-a2ba-204b9506376b +elapsed time 97.129666ms + +1> i +Loaded modules interface: +data TestRecord: + field_0: bool + field_1: i8 + field_2: i16 + field_3: i32 + field_4: i64 + field_5: u8 + field_6: u16 + field_7: u32 + field_8: u64 + field_9: f32 + field_10: f64 + field_11: string + field_12: []u8 + +records_pure: + fn invoke() -> TestRecord +records_effector: + fn mutate_struct(test_record: TestRecord) -> TestRecord + +2> +``` + +You can build, inspect and test the project as outlined in the [Greeting Example](#Greeting-Example). + +## SQLite Example + +[SQLite](https://www.sqlite.org/index.html) is an ubiquitous persistence solution also available on the Fluence stack. Unlike basic compute modules, creating an SQLite service is a little more intricate. In order to create the service, we need two dependencies: An SQLite Wasm module and an SQLite adapter, where the adapter is a [WASM IT compliant](https://crates.io/crates/marine-sqlite-connector) [sqlite](https://github.com/stainless-steel/sqlite) package implementation. The SQLite Wasm module can be obtain from the repo as a [release](https://github.com/fluencelabs/sqlite/releases/tag/v0.14.0_w) or compiled from [code](https://github.com/fluencelabs/sqlite). For the purpose of this example, we use the release version -- see `build.sh`. + +As a result, our service is comprised of two modules: the SQLite Wasm module and our sqlite module. The Rust code, see `src/main.rs` is pretty standard fare but our config file changes signficiantly: + +```toml +# Config.toml +modules_dir = "artifacts/" + +[[module]] <- 1 + name = "sqlite3" + mem_pages_count = 100 + logger_enabled = false + + [module.wasi] + preopened_files = ["/tmp"] + mapped_dirs = { "tmp" = "/tmp" } + +[[module]] <- 2 + name = "sqlite_test" + mem_pages_count = 1 + logger_enabled = false + + [module.wasi] + preopened_files = ["/tmp"] + mapped_dirs = { "tmp" = "/tmp" } +``` + +1. The first module specification is the SQLIte Wasm module we downloaded from the repo. We allocate sizable mem-pages and disable our logger. We furst specify the wasi submodule that allows the Wasm module to write outside the sandbox, i.e., to the host node, for the SQLite db file. We also map our host directory to the Wasm module +2. We list our `sqlite_test` Wasm module and here too add the wasi submodule with parameters identical to the ones user in the prior SQLite Wasm module specification. + +The local file access is critical if we want to use SQLite for or ethan just an in-memory solution and the mapped directory `tmp` needs to be used in our code module, `sqlite_test`. For example, + +```rust +// src/main.rs +// +#[marine] +pub fn test3() { + let db_path = "/tmp/users.sqlite"; // <- Note that the path dir needs to match the mapped dir from Config.toml + let connection = marine_sqlite_connector::open(db_path).expect("db should be opened"); + + connection + .execute( + " + CREATE TABLE IF NOT EXISTS users (name TEXT, age INTEGER); + INSERT INTO users VALUES ('Alice', 42); + INSERT INTO users VALUES ('Bob', 69); + ", + ) + .expect("table should be created successfully"); + + let connection = marine_sqlite_connector::open(db_path).expect("db should be opened"); + let cursor = connection.prepare("SELECT * FROM users").unwrap().cursor(); + + println!("table size is: {:?}", cursor.count()); +} +// +``` + +You can build, inspect and test the project as outlined in the [Greeting Example](#Greeting-Example). + +## URL Downloader Example + +Our service makes a url call and persists the response to a file. Pretty straight forward, right? Due to the limitations of Wasm, sockets are not available and storage is also not part of the Wasm sandbox per se. In this example, we illustrate the necessary steps required to achieve our goal. For this we need a + +* Facade module +* cUrl module +* Storage module + +A facade module is the main module + +### cUrl Module + +While we don't have a socket available, we can use a wrapper to access the node's cUrl binary: + +```rust +// curl_adapter +// main.rs +use marine_rs_sdk::marine; +use marine_rs_sdk::module_manifest; + +use marine_rs_sdk::MountedBinaryResult; +use marine_rs_sdk::WasmLoggerBuilder; + +module_manifest!(); + +/// Log level can be changed by `RUST_LOG` env as well. +pub fn main() { + WasmLoggerBuilder::new().build().unwrap(); +} + +#[marine] +pub fn download(url: String) -> String { // <- 2 + log::info!("download called with url {}\n", url); + + let result = curl(vec![url]); + + String::from_utf8(result.stdout).unwrap() +} + +/// Permissions in `Config.toml` should exist to use host functions. +#[marine] +#[link(wasm_import_module = "host")] // <- 1 +extern "C" { + fn curl(cmd: Vec) -> MountedBinaryResult; +} +``` + +By + +1. linking an external binary, cUrl, c-style into a marine interface +2. using the `download` function to wrap curl binary and expose it as a public function + +Compiling this crate gives us a `curl_adapter.wasm` module exposing the `download` function we can use either directly or as part of a multi-module service. For the `download` function to actually work, we need to reflect the unique structure of our solution in the config file as well: + +```toml +# Config.toml +# + +[[module]] # <- 1 + name = "curl_adapter" + logger_enabled = true + + [module.mounted_binaries] # <- 2 + curl = "/usr/bin/curl" + +# +``` + +In our config file we + +1. specify our basic module information including module name and logging preferences and +2. add a sub module referencing the mounted binary and command line call for cUrl, which specifies the Wasm module has access to the named host binary. + +You can build, inspect and test the project as outlined in the [Greeting Example](#Greeting-Example). + +### Local Storage + +Sometimes in-memory storage is not enough, a database solution too much and file storage just right. Since we're again have to use the Wasm sandbox to write to the node, we need to again have that reflected in our Rust code and configuration. Unlike the cUrl example, we don't need to rely on an external binary to write to file but need to rely on an available read/write directory (1). + +```rust +// local-storage dir +// main.rs +use marine_rs_sdk::marine; +use marine_rs_sdk::module_manifest; +use marine_rs_sdk::WasmLoggerBuilder; + +use std::fs; +use std::path::PathBuf; + +module_manifest!(); + +const SITES_DIR: &str = "/sites/"; // <- 1 + +/// Log level can be changed by `RUST_LOG` env as well. +pub fn main() { + WasmLoggerBuilder::new().build().unwrap(); +} + +/// You can read or write files from the file system if there is permission to use directories described in `Config.toml`. +#[marine] +pub fn put(name: String, file_content: Vec) -> String { + log::info!("put called with file name {}\n", name); + let rpc_tmp_filepath = format!("{}{}", SITES_DIR, name); + + let result = fs::write(PathBuf::from(rpc_tmp_filepath.clone()), file_content); + if let Err(e) = result { + return format!("file can't be written: {}", e); + } + + String::from("Ok") +} + +#[marine] +pub fn get(file_name: String) -> Vec { + log::info!("get called with file name: {}\n", file_name); + + let tmp_filepath = format!("{}{}", SITES_DIR, file_name); + + fs::read(tmp_filepath).unwrap_or_else(|_| b"error while reading file".to_vec()) +} +``` + +The majority of the heavy lifting for read-write operations is happening in the configuration file: + +```toml +# Config.toml +# +[[module]] # <- 1 + name = "local_storage" + logger_enabled = true + + [module.wasi] # <- 2 + preopened_files = ["./sites"] + # this is where files will be stored + mapped_dirs = { "sites" = "./sites" } +# +``` + +As always, we declare our module name and logging preference but then add the Wasi submodule not only specifying the directory mapping for the node's file system to the Wasm module, remember `const SITES_DIR: &str = "/sites/";` ?, but also permissioning the Wasm module to access host storage. + +### Facade Module + +The facade module is our entry to our download-n-save feature, thus being the main entry point to our + +```rust +use marine_rs_sdk::marine; +use marine_rs_sdk::module_manifest; +use marine_rs_sdk::WasmLoggerBuilder; + +module_manifest!(); + +pub fn main() { + WasmLoggerBuilder::new().build().unwrap(); +} + +/// Combining of modules: `curl` and `local_storage`. +/// Calls `curl` and stores returned result into a file. +#[marine] +pub fn get_n_save(url: String, file_name: String) -> String { + log::info!("get_n_save called with {} {}\n", url, file_name); + + let result = download(url); + file_put(file_name, result.into_bytes()); + + String::from("Ok") +} + +/// Importing `curl` module +#[marine] // <- 1 +#[link(wasm_import_module = "curl_adapter")] +extern "C" { + pub fn download(url: String) -> String; +} + +/// Importing `local_storage` module +#[marine] +#[link(wasm_import_module = "local_storage")] // <- 1 +extern "C" { + #[link_name = "get"] + pub fn file_get(file_name: String) -> Vec; + + #[link_name = "put"] + pub fn file_put(name: String, file_content: Vec) -> String; +} +``` + +Basically, `get_n_save` uses the `download` function from the `curl_adapter` module and the `get` and `put` functions from the `local_storage` module to accomplish our goal. Since our Wasm modules [share nothing'](https://en.wikipedia.org/wiki/Shared-nothing_architecture), we need to somehow make available what's needed. Since we are dealing with Wasm modules, the usual Rust import process clearly won't work. Instead, we link public functions from other Wasm modules with the `#[link(wasm_import_module = "???")]` macro. Please note the (1) and (2) are not (directly) dealing with the facade module's access to host functionality. That is, we specify explicitly what's shared from one module to another. + +Of course, that makes for a simple config specification for the facade module: + +```toml +# Config.toml +# +[[module]] + name = "facade" + logger_enabled = true +``` + +With our facade module in place, we can explore the fully linked solution in the REPL: + +```bash +mrepl Config.toml +Welcome to the Marine REPL (version 0.8.0) +Minimal supported versions + sdk: 0.6.0 + interface-types: 0.20.0 + +app service was created with service id = 4d8ff671-a4da-4ff6-b757-0498aa0b14ce +elapsed time 129.739488ms + +1> interface +Loaded modules interface: + +local_storage: <- 1 + fn get(file_name: string) -> []u8 + fn put(name: string, file_content: []u8) -> string +curl_adapter: <- 2 + fn download(url: string) -> string +facade: <- 3 + fn get_n_save(url: string, file_name: string) -> string + +2> +``` + +We see our three modules (1, 2, 3) and their respective public functions, which we can test on a per module basis and as the facade service aggregate. For example: + +```bash +2> call curl_adapter download ["https://fluence.network"] +result: String("\n\n\n\n\n \n