From bd3738faf042bf50cd11a264e512892f2a1a299a Mon Sep 17 00:00:00 2001 From: LowEntropyBody Date: Mon, 31 Aug 2020 22:02:09 +0800 Subject: [PATCH] API wait 15s for chain (#55) * api depends on chain * fix error * fix depends on error * wait 15 s for chain --- README.md | 27 +++++++------------------- generator/config-gen/api-config.gen.js | 1 + scripts/crust.sh | 2 ++ 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 756b780..9998ffd 100644 --- a/README.md +++ b/README.md @@ -17,35 +17,22 @@ Official crust node service for running crust protocol. ## Install dependencies -### Install lib +### Install crust service ```shell -sudo apt install -y git jq curl wget build-essential kmod -curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun -sudo apt install docker-compose -sudo apt install -y linux-headers-`uname -r` -``` - -### Install sgx driver -```shell -sudo ./scripts/install_sgx_driver.sh +sudo ./install.sh ``` ### Generate application configuration #### Modify config.yaml -You need to modify config.yaml - -### Run the config gen script -Run ```sudo ./scripts/gen_config.sh``` Configrations and docker compose will generated in the build directory. +```shell +sudo vim /opt/crust/crust-node/config.yaml +``` -### Run docker +### Run crust service ```shell -cd build -sudo docker-compose up crust -sudo docker-compose up crust-api -sudo docker-compose up crust-sworker -sudo docker-compose up karst # if your want to start karst, please make sure fastdfs is running in your computer +sudo systemctl start crust ``` ## License diff --git a/generator/config-gen/api-config.gen.js b/generator/config-gen/api-config.gen.js index 1f9e13a..c9079a4 100644 --- a/generator/config-gen/api-config.gen.js +++ b/generator/config-gen/api-config.gen.js @@ -21,6 +21,7 @@ async function genApiComposeConfig(config) { environment: { ARGS: args, }, + depends_on: ['crust'] } } diff --git a/scripts/crust.sh b/scripts/crust.sh index ebbb9ef..89e582e 100755 --- a/scripts/crust.sh +++ b/scripts/crust.sh @@ -21,6 +21,8 @@ start() fi fi + docker-compose -f $builddir/docker-compose.yaml up -d crust + sleep 15 docker-compose -f $builddir/docker-compose.yaml up -d }