forked from hummingbot/hummingbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-web3.sh
72 lines (72 loc) · 2.19 KB
/
create-web3.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# init
function pause() {
read -p "$*"
}
# =============================================
# SCRIPT COMMANDS
echo
echo "** ✏️ Creating a new Hummingbot instance **"
echo
# Specify hummingbot version
echo "ℹ️ Press [enter] for default values."
echo
echo "➡️ Enter Hummingbot version: [latest|development] (default = \"latest\")"
read TAG
if [ "$TAG" == "" ]
then
TAG="latest"
fi
echo
# Ask the user for the name of the new instance
echo "➡️ Enter a name for your new Hummingbot instance: (default = \"hummingbot-instance\")"
read INSTANCE_NAME
if [ "$INSTANCE_NAME" == "" ];
then
INSTANCE_NAME="hummingbot-instance"
DEFAULT_FOLDER="hummingbot_files"
else
DEFAULT_FOLDER="${INSTANCE_NAME}_files"
fi
echo
echo "=> Instance name: $INSTANCE_NAME"
echo
# Ask the user for the folder location to save files
echo "➡️ Enter a folder name for your config and log files: (default = \"$DEFAULT_FOLDER\")"
read FOLDER
if [ "$FOLDER" == "" ]
then
FOLDER=$DEFAULT_FOLDER
fi
echo
echo "Creating your hummingbot instance: \"$INSTANCE_NAME\" (coinalpha/hummingbot:$TAG)"
echo
echo "Your files will be saved to:"
echo "=> instance folder: $PWD/$FOLDER"
echo "=> config files: ├── $PWD/$FOLDER/hummingbot_conf"
echo "=> log files: ├── $PWD/$FOLDER/hummingbot_logs"
echo "=> data file: ├── $PWD/$FOLDER/hummingbot_data"
echo "=> scripts files: └── $PWD/$FOLDER/hummingbot_scripts"
echo
pause Press [Enter] to continue
#
#
#
# =============================================
# EXECUTE SCRIPT
# 1) Create folder for your new instance
mkdir $FOLDER
# 2) Create folders for log and config files
mkdir $FOLDER/hummingbot_conf
mkdir $FOLDER/hummingbot_logs
mkdir $FOLDER/hummingbot_data
mkdir $FOLDER/hummingbot_scripts
# 3) Launch a new instance of hummingbot
docker run -it \
--network host \
--name $INSTANCE_NAME \
--mount "type=bind,source=$(pwd)/$FOLDER/hummingbot_conf,destination=/conf/" \
--mount "type=bind,source=$(pwd)/$FOLDER/hummingbot_logs,destination=/logs/" \
--mount "type=bind,source=$(pwd)/$FOLDER/hummingbot_data,destination=/data/" \
--mount "type=bind,source=$(pwd)/$FOLDER/hummingbot_scripts,destination=/scripts/" \
coinalpha/hummingbot:$TAG