-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added autoup script to automaticallytake down the network as needed, …
…and then install or upgrade as appropriate.
- Loading branch information
Showing
60 changed files
with
14,055 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
bin_dir="$(cd "$(dirname $BASH_SOURCE)"; pwd)" | ||
root_dir="$bin_dir/.." | ||
export OBSIDIAN_COMPILER_DIR="$root_dir" | ||
|
||
network_framework="${root_dir}/network-framework" | ||
|
||
cd ${network_framework} | ||
|
||
${root_dir}/network-framework/autoup.sh $@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
COMPOSE_PROJECT_NAME=net | ||
IMAGE_TAG=latest | ||
CHAINCODE_DIRECTORY=GenericsStateVariables | ||
|
||
CHAINCODE_DIRECTORY=/Users/mcoblenz/code/Obsidian/evaluation/pilot6/auction-exercises/build/Auction | ||
CHAINCODE_NAME=Auction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
# This script invokes either up.sh or upgrade.sh, depending on whether the network is running. | ||
|
||
function checkNetworkIsUp() { | ||
CLI=$(docker ps -f name=cli -q) | ||
if [ -n "$CLI" ]; then | ||
NETWORKISUP=1 | ||
else | ||
echo "no network" | ||
NETWORKISUP=0 | ||
fi | ||
|
||
} | ||
|
||
function printHelp() { | ||
echo "autoup.sh conditionally starts a new Fabric network or upgrades an existing one." | ||
echo "Usage: " | ||
echo " autoup.sh -s <chaincodedirectory>" | ||
echo " -s <chaincodedirectory> - the path to the chaincode directory" | ||
} | ||
|
||
CD=default | ||
|
||
while getopts "h?c:t:d:f:s:l:i:v:n:" opt; do | ||
case "$opt" in | ||
h | \?) | ||
printHelp | ||
exit 0 | ||
;; | ||
c) | ||
CHANNEL_NAME=$OPTARG | ||
;; | ||
t) | ||
CLI_TIMEOUT=$OPTARG | ||
;; | ||
d) | ||
CLI_DELAY=$OPTARG./ | ||
;; | ||
f) | ||
COMPOSE_FILE=$OPTARG | ||
;; | ||
s) | ||
CD=${OPTARG} | ||
;; | ||
l) | ||
LANGUAGE=$OPTARG | ||
;; | ||
i) | ||
IMAGETAG=$(go env GOARCH)"-"$OPTARG | ||
;; | ||
v) | ||
VERBOSE=true | ||
;; | ||
n) | ||
if [ -n "$INIT" ]; then | ||
INIT="${INIT},\"${OPTARG}\"" | ||
else | ||
INIT="\"${OPTARG}\"" | ||
fi | ||
;; | ||
esac | ||
done | ||
|
||
checkNetworkIsUp | ||
NETWORKDIR=$(dirname $BASH_SOURCE) | ||
|
||
# Find out if this is the same chaincode path as before. | ||
FOUND=$(grep -c -e "^${CD}$" .env) | ||
if [ $? -eq 0 ]; then #same chaincode path as before | ||
if [ $NETWORKISUP -ne 0 ]; then | ||
echo "network is up; upgrading" | ||
${NETWORKDIR}/upgrade.sh | ||
else | ||
echo "network down; starting" | ||
${NETWORKDIR}/up.sh $@ | ||
fi | ||
else | ||
echo "different chaincode; restarting" | ||
${NETWORKDIR}/down.sh | ||
${NETWORKDIR}/up.sh $@ | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
144 changes: 144 additions & 0 deletions
144
obs-vscode-extension/node_modules/@types/node/async_hooks.d.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.