Skip to content

Commit

Permalink
chore: add install_all_deps.sh; upgrade sqlx; change persist policy t…
Browse files Browse the repository at this point in the history
…o MQ only (#72)
  • Loading branch information
lispc authored Feb 8, 2021
1 parent 7949366 commit 3a39676
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 10 deletions.
20 changes: 12 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ crossbeam-channel = "0.5.0"
rdkafka = { version = "0.25.0", features = ["cmake-build"] }
nix = "0.19.1"
anyhow = "1.0.38"
sqlx = { git = "https://github.com/launchbadge/sqlx.git", features=["runtime-tokio-rustls", "postgres", "chrono", "decimal", "json", "migrate" ] }
sqlx = { version = "0.5.1", features=["runtime-tokio-rustls", "postgres", "chrono", "decimal", "json", "migrate" ] }
chrono = { version = "0.4.19", features = ["serde"] }
rust_decimal = { version = "1.10.1", features = ["postgres", "bytes", "byteorder"] }
rust_decimal_macros = "1.10.1"
Expand Down
48 changes: 48 additions & 0 deletions scripts/install_all_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
set -xu

function install_rust() {
echo 'install rust'
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
}

function install_docker() {
echo 'install docker'
curl -fsSL https://get.docker.com | bash
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
sudo systemctl start docker
sudo systemctl enable docker
}

function install_docker_compose() {
echo 'install docker compose'
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
}

function install_node() {
echo 'install node'
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install 'lts/*'
nvm use 'lts/*'
npm install --global yarn
}

function install_sys_deps() {
echo 'install system deps'
sudo apt install libpq-dev cmake gcc g++ postgresql-client-12
}

function install_all() {
install_sys_deps
install_rust
install_docker
install_docker_compose
install_node
}

install_all
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl Default for Settings {
debug: false,
db_log: Default::default(),
db_history: Default::default(),
history_persist_policy: PersistPolicy::Both,
history_persist_policy: PersistPolicy::ToMessage,
assets: Vec::new(),
markets: Vec::new(),
consumer_group: "kline_data_fetcher".to_string(),
Expand Down

0 comments on commit 3a39676

Please sign in to comment.