mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Renme BigchainDB to CoreChainDB
This commit is contained in:
8
pkg/scripts/Vagrantfile
vendored
8
pkg/scripts/Vagrantfile
vendored
@@ -16,9 +16,9 @@ required_plugins.each do |plugin|
|
||||
end
|
||||
|
||||
# Configuration files
|
||||
CONFIGURATION_FILE = 'bigchaindb/pkg/configuration/vars/stack-config.yml'
|
||||
HOSTS_FILE = 'bigchaindb/pkg/configuration/hosts/all'
|
||||
HOST_VARS_PATH = 'bigchaindb/pkg/configuration/host_vars'
|
||||
CONFIGURATION_FILE = 'corechaindb/pkg/configuration/vars/stack-config.yml'
|
||||
HOSTS_FILE = 'corechaindb/pkg/configuration/hosts/all'
|
||||
HOST_VARS_PATH = 'corechaindb/pkg/configuration/host_vars'
|
||||
|
||||
# Read configuration file(s)
|
||||
instances_config = YAML.load_file(File.join(File.dirname(__FILE__), CONFIGURATION_FILE))
|
||||
@@ -75,7 +75,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
config.vbguest.no_remote = true
|
||||
end
|
||||
end
|
||||
node.vm.synced_folder "bigchaindb", "/opt/stack/bigchaindb"
|
||||
node.vm.synced_folder "corechaindb", "/opt/stack/corechaindb"
|
||||
node.vm.hostname = instance
|
||||
node.vm.provision :hosts, :sync_hosts => true
|
||||
node.ssh.insert_key = true
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
[ "$(stat -c %U /data/db)" = mongodb ] || chown -R mongodb /data/db
|
||||
|
||||
# BigchainDB configuration
|
||||
bigchaindb-monit-config
|
||||
corechaindb-monit-config
|
||||
|
||||
nohup mongod --bind_ip_all > "$HOME/.bigchaindb-monit/logs/mongodb_log_$(date +%Y%m%d_%H%M%S)" 2>&1 &
|
||||
nohup mongod --bind_ip_all > "$HOME/.corechaindb-monit/logs/mongodb_log_$(date +%Y%m%d_%H%M%S)" 2>&1 &
|
||||
|
||||
# Tendermint configuration
|
||||
tendermint init
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
set -o nounset
|
||||
|
||||
# Check if directory for monit logs exists
|
||||
if [ ! -d "$HOME/.bigchaindb-monit" ]; then
|
||||
mkdir -p "$HOME/.bigchaindb-monit"
|
||||
if [ ! -d "$HOME/.corechaindb-monit" ]; then
|
||||
mkdir -p "$HOME/.corechaindb-monit"
|
||||
fi
|
||||
|
||||
monit_pid_path=${MONIT_PID_PATH:=$HOME/.bigchaindb-monit/monit_processes}
|
||||
monit_script_path=${MONIT_SCRIPT_PATH:=$HOME/.bigchaindb-monit/monit_script}
|
||||
monit_log_path=${MONIT_LOG_PATH:=$HOME/.bigchaindb-monit/logs}
|
||||
monit_pid_path=${MONIT_PID_PATH:=$HOME/.corechaindb-monit/monit_processes}
|
||||
monit_script_path=${MONIT_SCRIPT_PATH:=$HOME/.corechaindb-monit/monit_script}
|
||||
monit_log_path=${MONIT_LOG_PATH:=$HOME/.corechaindb-monit/logs}
|
||||
monitrc_path=${MONITRC_PATH:=$HOME/.monitrc}
|
||||
|
||||
function usage() {
|
||||
@@ -90,17 +90,17 @@ cat >${monit_script_path} <<EOF
|
||||
#!/bin/bash
|
||||
case \$1 in
|
||||
|
||||
start_bigchaindb)
|
||||
start_corechaindb)
|
||||
|
||||
pushd \$4
|
||||
nohup bigchaindb start > /dev/null 2>&1 &
|
||||
nohup corechaindb start > /dev/null 2>&1 &
|
||||
|
||||
echo \$! > \$2
|
||||
popd
|
||||
|
||||
;;
|
||||
|
||||
stop_bigchaindb)
|
||||
stop_corechaindb)
|
||||
|
||||
kill -2 \`cat \$2\`
|
||||
rm -f \$2
|
||||
@@ -169,18 +169,18 @@ set httpd
|
||||
port 2812
|
||||
allow localhost
|
||||
|
||||
check process bigchaindb
|
||||
with pidfile ${monit_pid_path}/bigchaindb.pid
|
||||
start program "${monit_script_path} start_bigchaindb $monit_pid_path/bigchaindb.pid ${monit_log_path} ${monit_log_path}"
|
||||
restart program "${monit_script_path} start_bigchaindb $monit_pid_path/bigchaindb.pid ${monit_log_path} ${monit_log_path}"
|
||||
stop program "${monit_script_path} stop_bigchaindb $monit_pid_path/bigchaindb.pid ${monit_log_path} ${monit_log_path}"
|
||||
check process corechaindb
|
||||
with pidfile ${monit_pid_path}/corechaindb.pid
|
||||
start program "${monit_script_path} start_corechaindb $monit_pid_path/corechaindb.pid ${monit_log_path} ${monit_log_path}"
|
||||
restart program "${monit_script_path} start_corechaindb $monit_pid_path/corechaindb.pid ${monit_log_path} ${monit_log_path}"
|
||||
stop program "${monit_script_path} stop_corechaindb $monit_pid_path/corechaindb.pid ${monit_log_path} ${monit_log_path}"
|
||||
|
||||
check process tendermint
|
||||
with pidfile ${monit_pid_path}/tendermint.pid
|
||||
start program "${monit_script_path} start_tendermint ${monit_pid_path}/tendermint.pid ${monit_log_path} ${monit_log_path}"
|
||||
restart program "${monit_script_path} start_tendermint ${monit_pid_path}/tendermint.pid ${monit_log_path} ${monit_log_path}"
|
||||
stop program "${monit_script_path} stop_tendermint ${monit_pid_path}/tendermint.pid ${monit_log_path} ${monit_log_path}"
|
||||
depends on bigchaindb
|
||||
depends on corechaindb
|
||||
|
||||
check file tendermint.out.log with path ${monit_log_path}/tendermint.out.log
|
||||
if size > 200 MB then
|
||||
@@ -12,7 +12,7 @@ umask 022
|
||||
|
||||
# defaults
|
||||
stack_branch=${STACK_BRANCH:="master"}
|
||||
stack_repo=${STACK_REPO:="bigchaindb/bigchaindb"}
|
||||
stack_repo=${STACK_REPO:="corechaindb/corechaindb"}
|
||||
stack_size=${STACK_SIZE:=4}
|
||||
stack_type=${STACK_TYPE:="docker"}
|
||||
stack_type_provider=${STACK_TYPE_PROVIDER:=""}
|
||||
@@ -42,8 +42,8 @@ if [[ -n "$NOUNSET" ]]; then
|
||||
fi
|
||||
|
||||
TOP_DIR=$(cd $(dirname "$0") && pwd)
|
||||
SCRIPTS_DIR=$TOP_DIR/bigchaindb/pkg/scripts
|
||||
CONF_DIR=$TOP_DIR/bigchaindb/pkg/configuration
|
||||
SCRIPTS_DIR=$TOP_DIR/corechaindb/pkg/scripts
|
||||
CONF_DIR=$TOP_DIR/corechaindb/pkg/configuration
|
||||
|
||||
|
||||
function usage() {
|
||||
@@ -80,11 +80,11 @@ function usage() {
|
||||
of the instance(s) spawned. (default: ${stack_box_name})
|
||||
|
||||
ENV[STACK_REPO]
|
||||
(Optional) To configure bigchaindb repo to use, set STACK_REPO environment
|
||||
(Optional) To configure corechaindb repo to use, set STACK_REPO environment
|
||||
variable. (default: ${stack_repo})
|
||||
|
||||
ENV[STACK_BRANCH]
|
||||
(Optional) To configure bigchaindb repo branch to use set STACK_BRANCH environment
|
||||
(Optional) To configure corechaindb repo branch to use set STACK_BRANCH environment
|
||||
variable. (default: ${stack_branch})
|
||||
|
||||
ENV[TM_VERSION]
|
||||
@@ -172,8 +172,8 @@ trap finish EXIT
|
||||
|
||||
export STACK_REPO=$stack_repo
|
||||
export STACK_BRANCH=$stack_branch
|
||||
echo "Using bigchaindb repo: '$STACK_REPO'"
|
||||
echo "Using bigchaindb branch '$STACK_BRANCH'"
|
||||
echo "Using corechaindb repo: '$STACK_REPO'"
|
||||
echo "Using corechaindb branch '$STACK_BRANCH'"
|
||||
|
||||
git clone https://github.com/${stack_repo}.git -b $stack_branch || true
|
||||
|
||||
@@ -185,7 +185,7 @@ if [[ $stack_type == "local" ]]; then
|
||||
fi
|
||||
|
||||
# configure stack-config.yml
|
||||
cat >$TOP_DIR/bigchaindb/pkg/configuration/vars/stack-config.yml <<EOF
|
||||
cat >$TOP_DIR/corechaindb/pkg/configuration/vars/stack-config.yml <<EOF
|
||||
---
|
||||
stack_type: "${stack_type}"
|
||||
stack_size: "${stack_size}"
|
||||
@@ -213,7 +213,7 @@ stack_type_provider="$(echo $stack_type_provider | tr '[A-Z]' '[a-z]')"
|
||||
if [[ $stack_type == "local" ]]; then
|
||||
echo "Configuring setup locally!"
|
||||
vagrant up --provider virtualbox --provision
|
||||
ansible-playbook $CONF_DIR/bigchaindb-start.yml \
|
||||
ansible-playbook $CONF_DIR/corechaindb-start.yml \
|
||||
-i $CONF_DIR/hosts/all \
|
||||
--extra-vars "operation=start home_path=${TOP_DIR}"
|
||||
elif [[ $stack_type == "cloud" && $stack_type_provider == "azure" ]]; then
|
||||
@@ -227,7 +227,7 @@ elif [[ $stack_type == "cloud" && $stack_type_provider == "azure" ]]; then
|
||||
vagrant box add azure-dummy https://github.com/azure/vagrant-azure/raw/v2.0/dummy.box \
|
||||
--provider azure --force
|
||||
vagrant up --provider azure --provision
|
||||
ansible-playbook $CONF_DIR/bigchaindb-start.yml \
|
||||
ansible-playbook $CONF_DIR/corechaindb-start.yml \
|
||||
-i $CONF_DIR/hosts/all \
|
||||
--extra-vars "operation=start home_path=/opt/stack"
|
||||
elif [[ $stack_type == "docker" ]]; then
|
||||
@@ -236,7 +236,7 @@ elif [[ $stack_type == "docker" ]]; then
|
||||
cat >$CONF_DIR/hosts/all <<EOF
|
||||
$(hostname) ansible_connection=local
|
||||
EOF
|
||||
ansible-playbook $CONF_DIR/bigchaindb-start.yml \
|
||||
ansible-playbook $CONF_DIR/corechaindb-start.yml \
|
||||
-i $CONF_DIR/hosts/all \
|
||||
--extra-vars "operation=start home_path=${TOP_DIR}"
|
||||
else
|
||||
|
||||
@@ -12,7 +12,7 @@ umask 022
|
||||
|
||||
# defaults
|
||||
stack_branch=${STACK_BRANCH:="master"}
|
||||
stack_repo=${STACK_REPO:="bigchaindb/bigchaindb"}
|
||||
stack_repo=${STACK_REPO:="corechaindb/corechaindb"}
|
||||
stack_size=${STACK_SIZE:=4}
|
||||
stack_type=${STACK_TYPE:="docker"}
|
||||
stack_type_provider=${STACK_TYPE_PROVIDER:=""}
|
||||
@@ -42,8 +42,8 @@ if [[ -n "$NOUNSET" ]]; then
|
||||
fi
|
||||
|
||||
TOP_DIR=$(cd $(dirname "$0") && pwd)
|
||||
SCRIPTS_DIR=$TOP_DIR/bigchaindb/pkg/scripts
|
||||
CONF_DIR=$TOP_DIR/bigchaindb/pkg/configuration
|
||||
SCRIPTS_DIR=$TOP_DIR/corechaindb/pkg/scripts
|
||||
CONF_DIR=$TOP_DIR/corechaindb/pkg/configuration
|
||||
|
||||
function usage() {
|
||||
cat <<EOM
|
||||
@@ -79,11 +79,11 @@ function usage() {
|
||||
of the instance(s) spawned. (default: ${stack_box_name})
|
||||
|
||||
ENV[STACK_REPO]
|
||||
(Optional) To configure bigchaindb repo to use, set STACK_REPO environment
|
||||
(Optional) To configure corechaindb repo to use, set STACK_REPO environment
|
||||
variable. (default: ${stack_repo})
|
||||
|
||||
ENV[STACK_BRANCH]
|
||||
(Optional) To configure bigchaindb repo branch to use set STACK_BRANCH environment
|
||||
(Optional) To configure corechaindb repo branch to use set STACK_BRANCH environment
|
||||
variable. (default: ${stack_branch})
|
||||
|
||||
ENV[TM_VERSION]
|
||||
@@ -180,8 +180,8 @@ trap finish EXIT
|
||||
|
||||
export STACK_REPO=$stack_repo
|
||||
export STACK_BRANCH=$stack_branch
|
||||
echo "Using bigchaindb repo: '$STACK_REPO'"
|
||||
echo "Using bigchaindb branch '$STACK_BRANCH'"
|
||||
echo "Using corechaindb repo: '$STACK_REPO'"
|
||||
echo "Using corechaindb branch '$STACK_BRANCH'"
|
||||
|
||||
git clone https://github.com/${stack_repo}.git -b ${stack_branch} || true
|
||||
|
||||
@@ -193,7 +193,7 @@ if [[ $stack_type == "local" ]]; then
|
||||
fi
|
||||
|
||||
# configure stack-config.yml
|
||||
cat >$TOP_DIR/bigchaindb/pkg/configuration/vars/stack-config.yml <<EOF
|
||||
cat >$TOP_DIR/corechaindb/pkg/configuration/vars/stack-config.yml <<EOF
|
||||
---
|
||||
stack_type: "${stack_type}"
|
||||
stack_size: "${stack_size}"
|
||||
@@ -222,7 +222,7 @@ if [[ $stack_type == "local" ]]; then
|
||||
if [[ $unstack_type == "hard" ]]; then
|
||||
vagrant destroy -f
|
||||
elif [[ $unstack_type == "soft" ]]; then
|
||||
ansible-playbook $CONF_DIR/bigchaindb-stop.yml -i $CONF_DIR/hosts/all \
|
||||
ansible-playbook $CONF_DIR/corechaindb-stop.yml -i $CONF_DIR/hosts/all \
|
||||
--extra-vars "operation=stop home_path=${TOP_DIR}"
|
||||
fi
|
||||
elif [[ $stack_type == "cloud" && $stack_type_provider == "azure" ]]; then
|
||||
@@ -230,7 +230,7 @@ elif [[ $stack_type == "cloud" && $stack_type_provider == "azure" ]]; then
|
||||
if [[ $unstack_type == "hard" ]]; then
|
||||
vagrant destroy -f
|
||||
elif [[ $unstack_type == "soft" ]]; then
|
||||
ansible-playbook $CONF_DIR/bigchaindb-stop.yml -i $CONF_DIR/hosts/all \
|
||||
ansible-playbook $CONF_DIR/corechaindb-stop.yml -i $CONF_DIR/hosts/all \
|
||||
--extra-vars "operation=stop home_path=${TOP_DIR}"
|
||||
fi
|
||||
elif [[ $stack_type == "docker" ]]; then
|
||||
@@ -240,7 +240,7 @@ elif [[ $stack_type == "docker" ]]; then
|
||||
$(hostname) ansible_connection=local
|
||||
EOF
|
||||
|
||||
ansible-playbook $CONF_DIR/bigchaindb-stop.yml -i $CONF_DIR/hosts/all \
|
||||
ansible-playbook $CONF_DIR/corechaindb-stop.yml -i $CONF_DIR/hosts/all \
|
||||
--extra-vars "operation=stop home_path=${TOP_DIR}"
|
||||
else
|
||||
echo "Invalid Stack Type OR Provider"
|
||||
|
||||
Reference in New Issue
Block a user