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
* update toolchain to nightly and fix `cargo clippy` installation error
* fix clippy errors
* update to `.await` and fix cargo errors/warnings
* clean up some files
* Clean up some files and some not needed dependencies
* update .travis.yml to use latest nightly
* follower - merge fix for `.await`
* fix cargo fmt
* add rust-toolchain for sentry only, until `.await` is merged
* clean up `sentry`
* make sentry build again
* cargo-make 0.22.2 fixes the installation of clippy so remove the custom task override
* update `futures-preview` to `alpha.19`
* sentry - add the `adapter` along side `futures-preview`, `hyper`, `regex` and `tokio`
* sentry - add the cli options, load config and make a 404 Not found response.
* sentry - add `serde` & `serde_urlencoded`
* sentry - routes - channel - list channel WIP
* sentry - move `fn not_found` & `fn bad_request` to lib
* sentry - Cargo.toml - add `unstable-stream` feature for `hyper`
* sentry - more to channels list and channel create endpoints
* sentry - fix some issues and clean up code
* sentry - Cargo.toml - add `chrono`
* primitives - remove channel::ChannelListParams
* sentry - ChannelListQuery
* sentry - better error response handling & move channel list & create code to own modules
* sentry - Fix changes required because of the merge & `clippy` warnings
* sentry - remove `rust-toolchain`
* fix `rustfmt`
* improve `Adapter`, `EthereumAdapter` & `DummyAdapter`
* sentry - Application struct
* Fix `EthereumAdapter` and fix `clippy` warnings
* fix import
* primitives - big_num - fix `clippy` warnings about `to_owned()`
* primitives - add `slog` and impl own PrefixCompactFormat
* primitives - re-export `slog_async::Async` & `slog_term::TermDecorator`
* sentry - working logging for the `Application`:
- use the re-exported from `primitives` `slog` structs & traits
- Cargo.toml - remove `slog-term` & `slog-async` since we use the re-exported once
* sentry - use `error!` for server error & suppress `clustered` warning for not using it now
* Use patch instead of `git` url & branch in the `primitives` `Cargo.toml`
* sentry - add listening to port on `Application::run`
* sentry - add missing `info` import
* Fix some merge problems and re-add the `Send` trait bound for the `Adapter`
* sentry - Cargo.toml - add `redis`
* sentry - register `db` module and add `REDIS_URL` to it
* sentry - function for creating `redis` async connection
* [WIP] sentry - access - check_access - rules that are applicable
* primitives - config - use `RateLimit` from `event_submission` module
* primitives - use `std::time::Duration` for `RateLimit.time_frame`
- primitives - Cargo.toml - add `serde_millis`
- primitives - `RateLimit.time_frame` to `Duration`
* primitives - Cargo.toml - reorder dependencies
* sentry - access - finish up `check_access`
* Clean up README files
* sentry - db - fix wrong merge & change to SharedConnection
* sentry - db - `expect()` instead of `unwrap()`
* sentry - access - take reference to `RateLimit`
* sentry - Cargo.toml - `redis` to version `0.13.1-alpha`
- Cargo.toml - `redis` patch for WIP branch of `async_await_api`
* [+test] sentry - access - check_access - return Result, fix `redis` error
* [test] sentry - access - check_access - finish the last test for an IP RateLimit
* Travis-ci - add `redis` service
Copy file name to clipboardExpand all lines: README.md
+22-52Lines changed: 22 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,42 +6,12 @@ Reference implementation of the [AdEx validator stack](https://github.com/adexne
6
6
7
7
Components:
8
8
9
-
* Domain crate
10
-
* Sentry - check the list of [opened issues](https://github.com/AdExNetwork/adex-validator-stack-rust/issues?q=is:open+is:issue+project:AdExNetwork/adex-validator-stack-rust/1)
11
-
* Validator worker - The validator worker(`Leader` or `Follower`) that validates/proposes new states.
12
-
* memory-repository - Generic helper crate for creating InMemory repositories for testing.
13
-
* adapter - Adapter trait for `sign`, `verify` and `validate_channel` with Dummy implementation for testing.
9
+
* Sentry
10
+
* Validator worker
11
+
* Adapter
12
+
* AdView manager
14
13
15
-
**Note:** Please refer to the README.md of the component for a more detailed overview of it.
16
-
17
-
## Domain
18
-
Contains all the Domain `Aggregates`, `Entities`, `Value Objects`, interfaces (traits) and `Domain Error`.
19
-
The interfaces(traits) include The `RepositoryFuture` and the `Aggregates`/`Entities` traits for the repositories.
20
-
21
-
All the structs have defined (de)serialization. The also have incorporated domain rules, e.g.
22
-
`TargetingTag.score` (the `Score` struct) should be with a value between `0` and `100`.
23
-
This means that once we have a `Score` object, we are guaranteed to have a valid object everywhere.
24
-
25
-
The `Repository` traits are meant to help you create the correct abstractions in the underlying application,
26
-
as every application has different requirements for the way and things it will fetch.
27
-
28
-
## Sentry & Validator worker
29
-
30
-
Split into 3 layer - Domain, Infrastructure & Application.
31
-
- Domain - the domain objects/structs that are defining the business rules and constraints.
32
-
- Infrastructure - specific implementations of e.g. Repositories, Logging and etc.
33
-
like `Memory__Repository`, `Api__Repository` and so on.
34
-
- Application - all the application specific logic, which means services, structs and etc. that use the Domain and it's
35
-
traits to achieve the task at hand. For example: In sentry we have the `resource`s, there we define the
36
-
`channel_create`. Which handles the request, validates it and uses the `ChannelRepository` trait to
37
-
`add` the new Channel and returns the appropriate Response. It is not however limited to Request -> Response.
38
-
39
-
## Testing setup
40
-
41
-
### Rust setup
42
-
43
-
- Requires `nightly 2019-05-08`, because of the new syntax for `await` and our `tower-web` dependency fails to build.
44
-
We've setup `rust-toolchain` but you can manually override it as well with `rustup override set nightly-2019-05-08`.
14
+
## Local & Testing setup
45
15
46
16
#### Linux
47
17
- The crate `openssl-sys` requires `libssl-dev` and `pkg-config` for Ubuntu.
@@ -53,32 +23,30 @@ We've setup `rust-toolchain` but you can manually override it as well with `rust
53
23
-`$HOME/docker/volumes/postgres` - your local storage for postgres (persist the data when we remove the container)
54
24
-`POSTGRES_PASSWORD=docker` - the password of `postgres` user
55
25
56
-
### Run Sentry Rest API
26
+
### Run Redis:
57
27
58
-
`DATABASE_URL=postgresql://postgres:docker@localhost:5432/sentry cargo run --bin sentry`
28
+
`dockerrun --name some-redis -d redis`
59
29
60
-
### Run Validator Worker
30
+
### Run automated tests
61
31
62
-
`cargo run --bin validator`
32
+
Since we have integration tests that require Redis & Postgres,
33
+
you need to be running those in order to run the automated tests:
63
34
64
-
For the available options:
35
+
`cargo make test`
65
36
66
-
`cargo run --bin validator -- --help`
37
+
### Run Sentry Rest API
67
38
68
-
#### Environment variables:
39
+
* With the DummyAdapter(replace the `DummyIdentity`):
69
40
70
-
**NOTE: Currently we use `.env` file to define values for those environment variables.
71
-
We need to see if we want configuration files per binary instead.**
41
+
`export PORT=8006; cargo run -p sentry -- -a dummy -i DummyIdentity`
72
42
73
-
##### Sentry:
74
-
-`DATABASE_URL` - The url of the Postgres database used for production.
75
-
-`SENTRY_CHANNEL_LIST_LIMIT` - the limit per page for listing channels from the `/channel/list` request.
43
+
* With the EthereumAdapter:
76
44
77
-
##### Validator:
78
-
-`VALIDATOR_TICKS_WAIT_TIME` - The time for a whole cycle(tick) of the validator worker to get & loop channels,
79
-
validate and send statuses and etc.
80
-
-`VALIDATOR_SENTRY_URL` - The url of the Sentry API that should be used
81
-
-`VALIDATOR_VALIDATION_TICK_TIMEOUT` - The maximum time for validation of a single channel as a `Leader` or `Follower`
45
+
TODO
46
+
47
+
### Run Validator Worker
48
+
49
+
TODO
82
50
83
51
## Development environment
84
52
@@ -89,5 +57,7 @@ as well as on CI. For a complete list of out-of-the-box commands you can check
89
57
Locally it's enough to ensure that `cargo make` command (it will execute the default dev. command) is passing.
90
58
It will run `rustfmt` for you, it will fail on `clippy` warnings and it will run all the tests.
91
59
60
+
*Note:* You need to have setup Redis and Postgres as well.
61
+
92
62
You can related to the [Makefile.stable.toml](https://github.com/sagiegurari/cargo-make/blob/master/src/lib/Makefile.stable.toml)
0 commit comments