mirror of
https://github.com/fluencelabs/examples
synced 2024-12-04 19:20:17 +00:00
fix check deploy
This commit is contained in:
parent
178cc42847
commit
d7c31f38d8
37
.github/workflows/check-deploy.yml
vendored
37
.github/workflows/check-deploy.yml
vendored
@ -51,13 +51,34 @@ jobs:
|
||||
- name: "Check call_parameters 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 "call_parameters") [] result)
|
||||
(call %init_peer_id% (returnService "run") [result])
|
||||
)
|
||||
')
|
||||
NODE="/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3"
|
||||
SERVICE_ID=`./deploy.sh $NODE`
|
||||
|
||||
echo "
|
||||
service CallParameters:
|
||||
call_parameters() -> string
|
||||
|
||||
func call(service_id: string) -> string:
|
||||
on HOST_PEER_ID:
|
||||
CallParameters service_id
|
||||
r <- CallParameters.call_parameters()
|
||||
<- r
|
||||
" > /tmp/call.aqua
|
||||
RESULT=$(aqua run --addr $NODE --sk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo= -f 'call(service_id)' -d '{"service_id": "'$SERVICE_ID'"}' --input /tmp/call.aqua)
|
||||
|
||||
EXPECTED_PEER_ID=$(echo -e "$RESULT" | sed -n '1p' | grep -o '12D3.*')
|
||||
RESULT_PEER_ID=$(echo -e "$RESULT" | sed -n '2p' | tr -d \")
|
||||
if [ "$EXPECTED_PEER_ID" -neq "$RESULT_PEER_ID" ]; then
|
||||
echo "Expected $EXPECTED_PEER_ID, got $RESULT_PEER_ID"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RESULT_SERVICE_ID=$(echo -e "$RESULT" | sed -n '3p')
|
||||
if [ "$SERVICE_ID" -neq "$RESULT_SERVICE_ID" ]; then
|
||||
echo "Expected $SERVICE_ID, got $RESULT_SERVICE_ID"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
aqua dist remove --addr $NODE --sk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo= --id "$SERVICE_ID"
|
||||
working-directory: marine-examples/call_parameters
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -o errexit -o nounset -o pipefail
|
||||
|
||||
if [[ -z "${NODE:-}" ]]; then
|
||||
NODE_ADDR=""
|
||||
./build.sh
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
NODE="$1"
|
||||
else
|
||||
NODE_ADDR="--node-addr $NODE"
|
||||
echo "Expected single argument: node multiaddress. Got $# arguments."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./build.sh
|
||||
|
||||
# check it .wasm was built
|
||||
WASM="artifacts/call_parameters.wasm"
|
||||
@ -15,5 +17,5 @@ test -f "$WASM" || echo >&2 "Couldn't find $WASM"
|
||||
|
||||
# create a service from that .wasm
|
||||
CONFIG="config.json"
|
||||
SERVICE_ID=$(fldist new_service $NODE_ADDR --modules "$WASM:$CONFIG" --name call_parameters | head -n1 | sed -e 's/service id: //')
|
||||
SERVICE_ID=$(aqua dist deploy --sk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo= --data-path config.json --service call_parameters --addr "$NODE" | tail -n 1 | tr -d \")
|
||||
echo $SERVICE_ID
|
||||
|
Loading…
Reference in New Issue
Block a user