4 Years 1000x Multicurrency Rotation Containerized Real World Framework
1 | # rotation strategy |
Why Containerized Deployment
Containers is the most popular technology of the current Internet technology, based on containers will be isolated from environmental resources to achieve rapid deployment of operations and maintenance. Simply put, I have published more live code, but after each announcement, there is always the boss because the python version is inconsistent, less installed a dependency package, package version is inconsistent or operating system differences that lead to strategy anomalies, such as the strategy does not run up, run up and inconsistent with the expected results.
And with the container, you can completely copy the boss (clone) my deployment environment, all you have to do is with their own API key, knock a line of code, and then the money machine up, happy?
30s Rapid Containerized Deployment
1 Code for uploading attachments
Upload the code to the server, here you can use whatever transfer tool you want, no special requirements.
2 Install the docker environment
1 | curl -fsSL https://get.docker.com -o get-docker.sh |
If you are using centos, you need to run one more line.
Start the docker daemon process sudo systemctl start docker
Keep docker on boot sudo systemctl enable docker
3 Modifying configuration files
The configuration file is in the .env file, where you can configure the API and exception alert robot. Note that here .env is a hidden file, Linux/Mac ls -a can be viewed, windows system set to show hidden files can be.
1 | DINGDING_ROBOT_ID = '' |
Alert bots are assigned to whichever bot the owner uses, and the program detects this automatically. If they are all assigned, the bots are actually instantiated according to the priority of dingding>tg>wechat.
The strategy’s leverage configuration defaults to 2x leverage.
4 Containerized Build Deployment
Switch to the project directory
cd MultiCoinRotation
Compile build image multicoinrotation:1.0.0 with image name and version number
docker build -t multicoinrotation:1.0.0 .
start the container -d run it in background, –name specify the container name
docker run -it -d --name=multicoinrotation multicoinrotation:1.0.0
Live Disk Operations
This can be accomplished with the help of common docker commands, a few of which are listed below.
1 | docker ps # view running containers |
View the log of the most used, here are the details.
1 | $ docker logs [OPTIONS] CONTAINER |
View the log after a specified time, showing only the last 100 lines:
$ docker logs -f -t --since="2018-02-08" --tail=100 CONTAINER_ID
View the last 30 minutes of logs for.
$ docker logs --since 30m CONTAINER_ID
View logs after a certain time:
$ docker logs -t --since="2018-02-08T13:23:37" CONTAINER_ID
View logs for a certain time period:
$ docker logs -t --since="2018-02-08T13:23:37" --until "2018-02-09T12:23:37" CONTAINER_ID
attachment:
https://github.com/zqwuming/blogimage/blob/main/asset/MultiCoinRotation-main.zip