assemblyscript step0 run.sh

This commit is contained in:
folex
2019-08-16 19:06:44 +03:00
parent 48aebaba15
commit ca5b9a9c54
9 changed files with 44 additions and 13 deletions

View File

@ -1,5 +1,5 @@
{
"name": "example-project",
"name": "fluid",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
@ -62,11 +62,6 @@
"source-map-support": "^0.5.12"
}
},
"assemblyscript-json": {
"version": "github:fluencelabs/assemblyscript-json#a177d4b61fe1fb5e096d73019ea9bc4af5599a6a",
"from": "github:fluencelabs/assemblyscript-json#update-as1",
"dev": true
},
"assemblyscript-sdk": {
"version": "github:fluencelabs/assemblyscript-sdk#1c5a552b5babb4d4c01e0f748165d4904dd38489",
"from": "github:fluencelabs/assemblyscript-sdk",

View File

@ -1,5 +1,5 @@
{
"name": "example-project",
"name": "fluid",
"version": "1.0.0",
"main": "index.js",
"scripts": {

View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e
mkdir -p wasm
# Build fluid WASM module
echo "Building..."
npm --silent install
npm --quiet run flbuild
cp build/*.wasm ./wasm/
echo
# Run it all on 30000 port with default Fluence API
echo "Running..."
docker rm -f frun &>/dev/null || true
echo 'docker run -d --name frun --rm -v "$(pwd)/wasm:/code" -p 30000:30000 fluencelabs/frun:latest'
docker run -d --name frun --rm -v "$(pwd)/wasm:/code" -p 30000:30000 fluencelabs/frun:latest >/dev/null
echo
# Wait for app to be initialized
sleep 1 && (docker logs -f frun 2>&1 &) | grep -q initialized && sleep 1
# Send our username to the application
REQUEST="$USER"
echo -e "Sending request: $REQUEST"
echo "curl -s 'http://localhost:30000/apps/1/tx' --data $'sessionId/0\n'"$REQUEST" --compressed"
echo
RESPONSE=$(curl -s 'http://localhost:30000/apps/1/tx' --data $'sessionId/0\n'"$REQUEST" --compressed | jq -r .result.data | base64 -D)
echo -e "$RESPONSE\n"
# Remove frun container
echo -e "Stopping..."
docker rm -f frun >/dev/null

View File

@ -1,5 +1,5 @@
{
"name": "example-project",
"name": "fluid",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,

View File

@ -1,5 +1,5 @@
{
"name": "example-project",
"name": "fluid",
"version": "1.0.0",
"main": "index.js",
"scripts": {

View File

@ -1,5 +1,5 @@
{
"name": "example-project",
"name": "fluid",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,

View File

@ -1,5 +1,5 @@
{
"name": "example-project",
"name": "fluid",
"version": "1.0.0",
"main": "index.js",
"scripts": {

View File

@ -1,5 +1,5 @@
{
"name": "example-project",
"name": "fluid",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,

View File

@ -1,5 +1,5 @@
{
"name": "example-project",
"name": "fluid",
"version": "1.0.0",
"main": "index.js",
"scripts": {