Browse Source

storage-node: improved dev scripts

Mokhtar Naamani 4 years ago
parent
commit
6fdb0982f0

+ 10 - 6
storage-node/scripts/compose/devchain-and-ipfs-node/docker-compose.yaml

@@ -3,14 +3,18 @@ services:
   ipfs:
     image: ipfs/go-ipfs:latest
     ports:
-      - "5001:5001"
+      - "127.0.0.1:5001:5001"
     volumes:
-      - storage-node-shared-data:/data/ipfs
+      - ipfs-data:/data/ipfs
   chain:
-    image: joystream/node:2.1.2
+    image: joystream/node:latest
     ports:
-      - "9944:9944"
-    command: --dev --ws-external
+      - "127.0.0.1:9944:9944"
+    volumes:
+      - chain-data:/data
+    command: --dev --ws-external --base-path /data
 volumes:
-  storage-node-shared-data:
+  ipfs-data:
+    driver: local
+  chain-data:
     driver: local

+ 19 - 0
storage-node/scripts/run-dev-instance.sh

@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+set -e
+
+script_path="$(dirname "${BASH_SOURCE[0]}")"
+
+# stop prior run and clear volumes
+docker-compose -f ${script_path}/compose/devchain-and-ipfs-node/docker-compose.yaml down -v
+
+# Run a development joystream-node chain and ipfs daemon in the background
+# Will use latest joystream/node images,
+# and will fetch from dockerhub if not found, so build them locally if
+# you need the version from the current branch
+docker-compose -f ${script_path}/compose/devchain-and-ipfs-node/docker-compose.yaml up -d
+
+# configure the dev chain
+yarn storage-cli dev-init && yarn storage-cli dev-check
+
+# Run the server
+DEBUG=* yarn colossus dev-server

+ 7 - 0
storage-node/scripts/stop-dev-instance.sh

@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+set -e
+
+script_path="$(dirname "${BASH_SOURCE[0]}")"
+
+# stop prior run and clear volumes
+docker-compose -f ${script_path}/compose/devchain-and-ipfs-node/docker-compose.yaml down -v