Add cleanup_env scripts and update doc

pull/83/head
Baohua Yang 2017-07-10 17:24:19 +08:00
parent 3a098625a6
commit 48f5699459
8 changed files with 88 additions and 10 deletions

View File

@ -26,6 +26,7 @@ If you want to setup the environment manually, then can follow the below steps i
Pull necessary images of peer, orderer, ca, and base image. Pull necessary images of peer, orderer, ca, and base image.
```sh ```sh
$ bash scripts/cleanup_env.sh
$ bash scripts/download_images.sh $ bash scripts/download_images.sh
``` ```
@ -34,7 +35,7 @@ There are also some community [images](https://hub.docker.com/r/hyperledger/) at
### Bootup and test Fabric 1.0 ### Bootup and test Fabric 1.0
Start a fabric cluster. Start a fabric cluster.
```bash ```bash
$ bash scripts/start_fabric.sh $ bash scripts/start_fabric.sh
@ -90,7 +91,7 @@ You should see the following output:
|_____| |_| \_| |____/ |_____| |_| \_| |____/
``` ```
#### Chaincode operation #### Chaincode Operations
After initialize network, you can execute some chaincode operations, such as `query` or `invoke`, After initialize network, you can execute some chaincode operations, such as `query` or `invoke`,
and you can modify the parameters and execute this script repeatedly. and you can modify the parameters and execute this script repeatedly.
@ -122,7 +123,7 @@ UTC [main] main -> INFO 008 Exiting.....
So far, we have quickly started a fabric network successfully. So far, we have quickly started a fabric network successfully.
## Expand ## More to explore
### [Explain the steps](./docs/docker-compose-1peer-usage.md) ### [Explain the steps](./docs/docker-compose-1peer-usage.md)
@ -149,6 +150,7 @@ Will explain the usage of `cryptogen` and `configtxgen`
### [Use database couchDB](./docs/couchdb-usage.md) ### [Use database couchDB](./docs/couchdb-usage.md)
### [WIP] [kafka usage](./docs/kafka-usage.md) ### [WIP] [kafka usage](./docs/kafka-usage.md)

View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
# This script will remove all containers and hyperledger related images
# Detecting whether can import the header file to render colorful cli output
if [ -f ./header.sh ]; then
source ./header.sh
elif [ -f worker_node_setup/header.sh ]; then
source scripts/header.sh
else
alias echo_r="echo"
alias echo_g="echo"
alias echo_b="echo"
fi
echo_b "Clean up all containers..."
docker rm -f `docker ps -qa`
echo_b "Clean up all hyperledger related images..."
docker rmi $(docker images |grep 'hyperledger')
echo_g "Env cleanup done!"

View File

@ -1,6 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source scripts/header.sh # Detecting whether can import the header file to render colorful cli output
if [ -f ./header.sh ]; then
source ./header.sh
elif [ -f worker_node_setup/header.sh ]; then
source scripts/header.sh
else
alias echo_r="echo"
alias echo_g="echo"
alias echo_b="echo"
fi
ARCH=x86_64 ARCH=x86_64
BASEIMAGE_RELEASE=0.3.1 BASEIMAGE_RELEASE=0.3.1

View File

@ -1,13 +1,22 @@
#!/bin/bash #!/bin/bash
# Detecting whether can import the header file to render colorful cli output
if [ -f ./header.sh ]; then
source ./header.sh
elif [ -f worker_node_setup/header.sh ]; then
source scripts/header.sh
else
alias echo_r="echo"
alias echo_g="echo"
alias echo_b="echo"
fi
echo echo
echo " ============================================== " echo " ============================================== "
echo " ==========initialize businesschannel========== " echo " ==========initialize businesschannel========== "
echo " ============================================== " echo " ============================================== "
echo echo
source scripts/header.sh
CHANNEL_NAME="$1" CHANNEL_NAME="$1"
: ${CHANNEL_NAME:="businesschannel"} : ${CHANNEL_NAME:="businesschannel"}
: ${TIMEOUT:="60"} : ${TIMEOUT:="60"}

View File

@ -1,6 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source scripts/header.sh # Detecting whether can import the header file to render colorful cli output
if [ -f ./header.sh ]; then
source ./header.sh
elif [ -f worker_node_setup/header.sh ]; then
source scripts/header.sh
else
alias echo_r="echo"
alias echo_g="echo"
alias echo_b="echo"
fi
if [ xroot != x$(whoami) ] if [ xroot != x$(whoami) ]
then then

View File

@ -1,6 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source scripts/header.sh # Detecting whether can import the header file to render colorful cli output
if [ -f ./header.sh ]; then
source ./header.sh
elif [ -f worker_node_setup/header.sh ]; then
source scripts/header.sh
else
alias echo_r="echo"
alias echo_g="echo"
alias echo_b="echo"
fi
COMPOSE_FILE=${1:-"docker-compose-2orgs-4peers.yaml"} COMPOSE_FILE=${1:-"docker-compose-2orgs-4peers.yaml"}

View File

@ -1,6 +1,15 @@
#!/bin/bash #!/bin/bash
source scripts/header.sh # Detecting whether can import the header file to render colorful cli output
if [ -f ./header.sh ]; then
source ./header.sh
elif [ -f worker_node_setup/header.sh ]; then
source scripts/header.sh
else
alias echo_r="echo"
alias echo_g="echo"
alias echo_b="echo"
fi
CHANNEL_NAME="$1" CHANNEL_NAME="$1"
: ${CHANNEL_NAME:="businesschannel"} : ${CHANNEL_NAME:="businesschannel"}

View File

@ -1,6 +1,15 @@
#!/bin/bash #!/bin/bash
source scripts/header.sh # Detecting whether can import the header file to render colorful cli output
if [ -f ./header.sh ]; then
source ./header.sh
elif [ -f worker_node_setup/header.sh ]; then
source scripts/header.sh
else
alias echo_r="echo"
alias echo_g="echo"
alias echo_b="echo"
fi
echo echo
echo " ______ __ __ _ _____ ____ _ ______ ______ ______ _____ " echo " ______ __ __ _ _____ ____ _ ______ ______ ______ _____ "