diff --git a/autostart_hummingbot_compose/docker-compose.yml b/autostart_hummingbot_compose/docker-compose.yml index 52d96d8..a91d1ca 100644 --- a/autostart_hummingbot_compose/docker-compose.yml +++ b/autostart_hummingbot_compose/docker-compose.yml @@ -4,6 +4,8 @@ services: image: hummingbot/hummingbot:latest volumes: - "./hummingbot_files/conf:/conf" + - "./hummingbot_files/conf/connectors:/conf/connectors" + - "./hummingbot_files/conf/strategies:/conf/strategies" - "./hummingbot_files/logs:/logs" - "./hummingbot_files/data:/data" - "./hummingbot_files/scripts:/scripts" diff --git a/bash_scripts/gateway-create.sh b/bash_scripts/gateway-create.sh index 931a819..d74f272 100755 --- a/bash_scripts/gateway-create.sh +++ b/bash_scripts/gateway-create.sh @@ -152,7 +152,7 @@ create_instance () { prompt_existing_certs_path # Launch a new instance of gateway - docker run \ + docker run -d \ --name $INSTANCE_NAME \ -p $GATEWAY_PORT:15888 \ -p $DOCS_PORT:8080 \ @@ -169,4 +169,4 @@ then else echo "Aborted" echo -fi \ No newline at end of file +fi diff --git a/bash_scripts/hummingbot-create.sh b/bash_scripts/hummingbot-create.sh index 566beb1..bd4e8d7 100755 --- a/bash_scripts/hummingbot-create.sh +++ b/bash_scripts/hummingbot-create.sh @@ -87,6 +87,8 @@ create_instance () { --name $INSTANCE_NAME \ --network host \ -v $CONF_FOLDER:/conf \ + -v $CONF_FOLDER/connectors:/conf/connectors \ + -v $CONF_FOLDER/strategies:/conf/strategies \ -v $LOGS_FOLDER:/logs \ -v $DATA_FOLDER:/data \ -v $PMM_SCRIPTS_FOLDER:/pmm_scripts \ diff --git a/bash_scripts/hummingbot-update.sh b/bash_scripts/hummingbot-update.sh index a1b920b..c049892 100755 --- a/bash_scripts/hummingbot-update.sh +++ b/bash_scripts/hummingbot-update.sh @@ -105,12 +105,14 @@ execute_docker () { docker run -itd --log-opt max-size=10m --log-opt max-file=5 \ --network host \ --name ${INSTANCES[$j]} \ - -v $CONF_FOLDER:/conf \ - -v $LOGS_FOLDER:/logs \ - -v $DATA_FOLDER:/data \ - -v $PMM_SCRIPTS_FOLDER:/pmm_scripts \ - -v $SCRIPTS_FOLDER:/scripts \ - -v $CERTS_FOLDER:/certs \ + -v ${FOLDERS[$j]}/conf:/conf \ + -v ${FOLDERS[$j]}/conf/connectors:/conf/connectors \ + -v ${FOLDERS[$j]}/conf/strategies:/conf/strategies \ + -v ${FOLDERS[$j]}/logs:/logs \ + -v ${FOLDERS[$j]}/data:/data \ + -v ${FOLDERS[$j]}/pmm-scripts:/pmm-scripts \ + -v ${FOLDERS[$j]}/scripts:/scripts \ + -v ${FOLDERS[$j]}/certs:/certs \ hummingbot/hummingbot:$TAG j=$[$j+1] # Update file ownership @@ -145,4 +147,4 @@ then else echo " Update aborted" echo -fi \ No newline at end of file +fi diff --git a/hummingbot_gateway_broker_compose/README.md b/hummingbot_gateway_broker_compose/README.md new file mode 100644 index 0000000..d1c250c --- /dev/null +++ b/hummingbot_gateway_broker_compose/README.md @@ -0,0 +1,62 @@ +# Deploy: Hummingbot + Gateway (DEX Connectors) + EMQX Message Broker (MQTT feature) + +This docker compose deployment includes Gateway and EMQX broker. Though it is +recommended to use the standalone deployments for message brokers from the [hummingbot/brokers](https://github.com/hummingbot/brokers) +repository. + +After deploying for the first time, you can navigate to the EMQX dashboard +to configure authentication and available ports at http://localhost:18083/. +The default credentials for connecting to the dashboards are `admin:public`. +For connecting your bots via MQTT, just leave the `mqtt_username` and +`mqtt_password` parameters of the bot empty. + +## How to use it + +You will need to have the certificates for the gateway and hummingbot under the folder hummingbot_files/certs. If you don't have it, don't worry, you can generate them with the client by doing the following: + +- Make sure you have docker and docker-compose installed. +- Run the following command in the terminal: + + ``` + docker-compose up -d + ``` + +- You will see that the gateway failed to start because you don't have the certificates +- Attach the instance of the bot by running: + + ``` + docker attach hummingbot_gateway_compose-bot-1 + ``` + +- Create the password +- Run the following command in the client: + + ``` + gateway generate-certs + ``` + +- When prompted enter the passphrase that you want. Is important that you change the docker-compose.yml on line 18 to the passphrase that you entered (the current passphrase is `a`). +- Exit the client and run the following command in the terminal: + + ``` + docker-compose down + ``` + +- You will see that inside the hummingbot_files/certs folder you have the certificates. +- We are ready to deploy the gateway and hummingbot, run the following command in the terminal: + + ``` + docker-compose up -d + ``` + +- If you attach the terminal of the gateway you will see that it is running. + + ``` + docker attach hummingbot_gateway_compose-gateway-1 + ``` + +- If you attach the terminal of the bot you will see that it is running and the gateway is ONLINE. + + ``` + docker attach hummingbot_gateway_compose-bot-1 + ``` diff --git a/hummingbot_gateway_broker_compose/docker-compose.yml b/hummingbot_gateway_broker_compose/docker-compose.yml new file mode 100644 index 0000000..223daa2 --- /dev/null +++ b/hummingbot_gateway_broker_compose/docker-compose.yml @@ -0,0 +1,61 @@ +version: "3.9" +services: + bot: + image: hummingbot/hummingbot:latest + volumes: + - "./hummingbot_files/conf:/conf" + - "./hummingbot_files/conf/connectors:/conf/connectors" + - "./hummingbot_files/conf/strategies:/conf/strategies" + - "./hummingbot_files/logs:/logs" + - "./hummingbot_files/data:/data" + - "./hummingbot_files/scripts:/scripts" + - "./hummingbot_files/certs:/certs" + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: 5 + tty: true + stdin_open: true + network_mode: host + + gateway: + image: hummingbot/gateway:latest + ports: + - "15888:15888" + - "8080:8080" + volumes: + - "./gateway_files/conf:/usr/src/app/conf" + - "./gateway_files/logs:/usr/src/app/logs" + - "./hummingbot_files/certs:/usr/src/app/certs" + environment: + - GATEWAY_PASSPHRASE=a + + emqx: + image: emqx:5 + restart: unless-stopped + environment: + - EMQX_NAME=emqx + - EMQX_LOADED_PLUGINS="emqx_recon,emqx_retainer,emqx_management,emqx_dashboard" + volumes: + - emqx-data:/opt/emqx/data + - emqx-log:/opt/emqx/log + - emqx-etc:/opt/emqx/etc + ports: + - "1883:1883" # mqtt:tcp + - "8883:8883" # mqtt:tcp:ssl + - "8083:8083" # mqtt:ws + - "8084:8084" # mqtt:ws:ssl + - "8081:8081" # http:management + - "18083:18083" # http:dashboard + - "61613:61613" # web-stomp gateway + healthcheck: + test: ["CMD", "/opt/emqx/bin/emqx_ctl", "status"] + interval: 5s + timeout: 25s + retries: 5 + +volumes: + emqx-data: {} + emqx-log: {} + emqx-etc: {} diff --git a/hummingbot_gateway_compose/docker-compose.yml b/hummingbot_gateway_compose/docker-compose.yml index 5672cbd..4079fc7 100644 --- a/hummingbot_gateway_compose/docker-compose.yml +++ b/hummingbot_gateway_compose/docker-compose.yml @@ -4,6 +4,8 @@ services: image: hummingbot/hummingbot:latest volumes: - "./hummingbot_files/conf:/conf" + - "./hummingbot_files/conf/connectors:/conf/connectors" + - "./hummingbot_files/conf/strategies:/conf/strategies" - "./hummingbot_files/logs:/logs" - "./hummingbot_files/data:/data" - "./hummingbot_files/scripts:/scripts" diff --git a/multiple_hummingbot_gateway_compose/docker-compose.yml b/multiple_hummingbot_gateway_compose/docker-compose.yml index 71a2f07..b9f9e11 100644 --- a/multiple_hummingbot_gateway_compose/docker-compose.yml +++ b/multiple_hummingbot_gateway_compose/docker-compose.yml @@ -4,6 +4,8 @@ services: image: hummingbot/hummingbot:latest volumes: - "./hummingbot_files/conf:/conf" + - "./hummingbot_files/conf/connectors:/conf/connectors" + - "./hummingbot_files/conf/strategies:/conf/strategies" - "./hummingbot_files/logs:/logs" - "./hummingbot_files/data:/data" - "./hummingbot_files/scripts:/scripts" @@ -21,6 +23,8 @@ services: image: hummingbot/hummingbot:latest volumes: - "./hummingbot_files/conf:/conf" + - "./hummingbot_files/conf/connectors:/conf/connectors" + - "./hummingbot_files/conf/strategies:/conf/strategies" - "./hummingbot_files/logs:/logs" - "./hummingbot_files/data:/data" - "./hummingbot_files/scripts:/scripts" diff --git a/simple_hummingbot_compose/docker-compose.yml b/simple_hummingbot_compose/docker-compose.yml index a07221d..3bff670 100644 --- a/simple_hummingbot_compose/docker-compose.yml +++ b/simple_hummingbot_compose/docker-compose.yml @@ -4,6 +4,8 @@ services: image: hummingbot/hummingbot:latest volumes: - "./hummingbot_files/conf:/conf" + - "./hummingbot_files/conf/connectors:/conf/connectors" + - "./hummingbot_files/conf/strategies:/conf/strategies" - "./hummingbot_files/logs:/logs" - "./hummingbot_files/data:/data" - "./hummingbot_files/scripts:/scripts"