You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`$HOME/docker/volumes/postgres` - your local storage for postgres (persist the data when we remove the container)
25
-
-`POSTGRES_PASSWORD=docker` - the password of `postgres` user
38
+
-`POSTGRES_PASSWORD=postgres` - the password of `postgres` user
26
39
27
-
### Run Redis:
40
+
### Running Redis
28
41
29
-
`docker run --name some-redis -d redis`
42
+
`docker run --rm --name adex-validator-redis -d redis`
30
43
31
-
### Run automated tests
44
+
### Running Sentry Rest API
32
45
33
-
Since we have integration tests that require Redis & Postgres,
34
-
you need to be running those in order to run the automated tests:
46
+
For a full list of all available CLI options on Sentry run `--help`:
35
47
36
-
`cargo make test`
48
+
```bash
49
+
cargo run -p sentry -- --help
50
+
```
51
+
52
+
Starting the Sentry API in will always run migrations, this will make sure the database is always up to date with the latest migrations, before starting and exposing the web server.
53
+
54
+
In `development` ( [`ENV` environment variable](#environment-variables) ) it will seed the database as well.
55
+
56
+
#### Using the `Ethereum Adapter`
57
+
58
+
The password for the Keystore file can be set using the [environment variable `KEYSTORE_PWD`](#adapter).
59
+
60
+
- Leader
61
+
```bash
62
+
POSTGRES_DB="sentry_leader" PORT=8006 cargo run -p sentry -- \
For full list, check out [primitives/src/util/tests/prep_db.rs#L29-L43](./primitives/src/util/tests/prep_db.rs#L29-L43)
98
+
99
+
#### Environment variables
37
100
38
-
### Run Sentry Rest API
101
+
- `ENV` - `production` or `development`;*default*: `development` - passing this env. variable will use the default configuration paths - [`docs/config/dev.toml`](./docs/config/dev.toml) (for `development`) or [`docs/config/prod.toml`](./docs/config/prod.toml) (for `production`). Otherwise you can pass your own configuration file path to the binary (check `cargo run -p sentry --help`for more information). In `development` it will make sure Sentry to seed the database.
102
+
- `PORT` - *default*: `8005` - The local port that Sentry API will be accessible at
103
+
- `ANALYTICS_RECORDER` - accepts any non-zero value - whether or not to start the `Analytics recorder` that will track analytics stats for payout events (`IMPRESSION`&`CLICK`)
104
+
##### Adapter
105
+
- `KEYSTORE_PWD` - Password for the `Keystore file`, only available when using `Ethereum Adapter` (`--adapter ethereum`)
39
106
40
-
* With the DummyAdapter(replace the `DummyIdentity`):
- `ENV`: `production` or `development` ( *default* ) - passing this env. variable will use the default configuration paths - [`docs/config/dev.toml`](./docs/config/dev.toml) (for `development`) or [`docs/config/prod.toml`](./docs/config/prod.toml) (for `production`). Otherwise you can pass your own configuration file path to the binary (check `cargo run -p sentry --help`for more information). In `development` it will make sure Sentry to seed the database.
183
+
- `PORT` - The local port that Sentry API will accessible at
184
+
185
+
##### Adapter
186
+
- `KEYSTORE_PWD` - Password for the `Keystore file`, only available when using `Ethereum Adapter` (`--adapter ethereum`)
56
187
57
188
## Development environment
58
189
59
-
We use [cargo-make](https://github.com/sagiegurari/cargo-make) for running the checks and build project locally
60
-
as well as on CI. For a complete list of out-of-the-box commands you can check
190
+
We use [`cargo-make`](https://github.com/sagiegurari/cargo-make#overview) for running automated checks (tests, builds, formatting, code linting, etc.) and building the project locally
191
+
as well as on our Continuous Integration (CI). For a complete list of out-of-the-box commands you can check
Locally it's enough to ensure that `cargo make` command (it will execute the default dev. command) is passing.
64
-
It will run `rustfmt` for you, it will fail on `clippy` warnings and it will run all the tests.
194
+
### Local development
195
+
196
+
Locally it's enough to ensure that the default development command is executing successfully:
197
+
198
+
```bash
199
+
cargo make
200
+
```
201
+
202
+
It will run `rustfmt` for you as well as `clippy` (it will fail on warnings) and it will run all the tests thanks to `cargo` (doc tests, unit tests, integration tests, etc.).
65
203
66
-
*Note:* You need to have setup Redis and Postgres as well.
204
+
This will also run the [Automated tests](#automated-tests), so you must have `Redis` & `Postgres` running.
205
+
206
+
#### Automated tests
207
+
208
+
This requires [`cargo-make`](https://github.com/sagiegurari/cargo-make#overview) and since we have integration tests that require `Redis` ([see `Running Redis`](#running-redis)) & `Postgres` (see [`Running Postgres`](#running-postgres)), you need to be running those in order to run the automated tests:
209
+
210
+
`cargo make test`
67
211
68
-
You can related to the [Makefile.stable.toml](https://github.com/sagiegurari/cargo-make/blob/master/src/lib/Makefile.stable.toml)
212
+
You can relate to the [`Makefile.stable.toml`](https://github.com/sagiegurari/cargo-make/blob/master/src/lib/Makefile.stable.toml)
0 commit comments