Skip to content

Commit 4e351ca

Browse files
authored
Merge pull request #114 from filecoin-project/feat/create-metrics-db
Feat/create metrics db
2 parents 831f33e + 96e69a6 commit 4e351ca

File tree

25 files changed

+604
-194
lines changed

25 files changed

+604
-194
lines changed

.github/workflows/deploy_to_staging.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- name: Run tests
1818
env:
1919
GH_PRIVATE_KEY: ${{ secrets.GH_STAGING_PRIVATE_KEY }}
20+
DB_URL: ${{secrets.STAGING_DB_URL}}
2021
run: cargo test -- --nocapture
2122

2223
deploy_to_staging:
@@ -63,7 +64,8 @@ jobs:
6364
"8080": "HTTP"
6465
},
6566
"environment": {
66-
"GH_PRIVATE_KEY": "${{secrets.GH_STAGING_PRIVATE_KEY}}"
67+
"GH_PRIVATE_KEY": "${{secrets.GH_STAGING_PRIVATE_KEY}}",
68+
"DB_URL": "${{secrets.STAGING_DB_URL}}"
6769
}
6870
}
6971
}' > containers.json

.github/workflows/end_to_end_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ jobs:
1717
- name: Run tests
1818
env:
1919
GH_PRIVATE_KEY: ${{ secrets.GH_STAGING_PRIVATE_KEY }}
20+
DB_URL: ${{secrets.STAGING_DB_URL}}
2021
run: cargo test -- --nocapture

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
members = [
44
"fplus-lib",
55
"fplus-http-server",
6-
"fplus-cli"
6+
"fplus-cli",
7+
"fplus-database"
78
]
89

910
resolver = "2"

fplus-database/Cargo.toml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "fplus-database"
3-
authors = ["jbesraa", "kokal33"]
4-
version = "0.1.3"
3+
authors = ["clriesco", "kokal33", "alexmcon"]
4+
version = "1.0.19"
55
edition = "2021"
66
description = "FPlus main database module"
77
license = "MIT OR Apache-2.0"
@@ -10,7 +10,16 @@ repository = "https://github.com/filecoin-project/filplus-backend/tree/publish-t
1010
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1111

1212
[dependencies]
13-
actix-web = "4.4.0"
13+
dotenv = "0.15.0"
14+
env_logger = "0.10.0"
15+
futures = "0.3.28"
16+
sea-orm ={ version = "0.12", features = [ "sqlx-postgres", "runtime-tokio-native-tls", "macros" ] }
1417
anyhow = "1.0.75"
15-
mongodb = {version = "2.7.0", features = ["openssl-tls"]}
16-
serde = "1.0.188"
18+
tokio = { version = "1", features = ["full"] }
19+
log = "0.4.20"
20+
chrono = "0.4.26"
21+
once_cell = "1.8"
22+
serde = { version = "1.0.164", features = ["derive", "std",
23+
"serde_derive", "alloc", "rc"] }
24+
serial_test = "3.0.0"
25+

fplus-database/src/config.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use log::warn;
2+
3+
/**
4+
* Get an environment variable or a default value
5+
*
6+
* # Arguments
7+
* @param key: &str - The environment variable key
8+
* @param default: &str - The default value
9+
*
10+
* # Returns
11+
* @return String - The value of the environment variable or the default value
12+
*/
13+
pub fn get_env_var_or_default(key: &str, default: &str) -> String {
14+
match std::env::var(key) {
15+
Ok(val) => val,
16+
Err(_) => {
17+
warn!("{} not set, using default value: {}", key, default);
18+
default.to_string()
19+
}
20+
}
21+
}

fplus-database/src/core/collections/govteam.rs

Lines changed: 0 additions & 40 deletions
This file was deleted.

fplus-database/src/core/collections/logs.rs

Lines changed: 0 additions & 41 deletions
This file was deleted.

fplus-database/src/core/collections/mod.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.

fplus-database/src/core/collections/notary.rs

Lines changed: 0 additions & 41 deletions
This file was deleted.

fplus-database/src/core/common.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)