init multi services

This commit is contained in:
boneyard93501
2021-03-01 17:03:57 -06:00
parent 19d5fd4db6
commit 5f10fb3559
31 changed files with 1282 additions and 0 deletions

25
multi-service/scripts/build.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
mkdir -p artifacts
cd curl_adapter
fce build --release
cd ..
cd hex_converter
fce build --release
cd ..
cd block_getter
fce build --release
cd ..
cd extract_miner_address
fce build --release
cd ..
rm -f artifacts/*
cp curl_adapter/target/wasm32-wasi/release/curl_adapter.wasm artifacts/
cp hex_converter/target/wasm32-wasi/release/hex_converter.wasm artifacts/
cp block_getter/target/wasm32-wasi/release/block_getter.wasm artifacts/
cp extract_miner_address/target/wasm32-wasi/release/extract_miner_address.wasm artifacts/

View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
# check `fcli` and `fldist` tools are installed or install them
(command -v fce || cargo install fcli) >/dev/null
(command -v fldist || npm install -g @fluencelabs/fldist) >/dev/null
# build .wasm
(
cd backend
fce build --release
)
# check it .wasm was built
WASM="backend/target/wasm32-wasi/release/curl_template.wasm"
test -f "$WASM" || echo >&2 "Couldn't find $WASM"
# create a service from that .wasm
CONFIG="$(pwd)/backend/BackendConfig.json"
fldist new_service --modules "$WASM:$CONFIG" --name curl_template