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
Copy file name to clipboardExpand all lines: README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,57 +1,78 @@
1
1
# Blockchain RPC Exporter
2
+
2
3
The exporter is used to scrape metrics from blockchain RPC endpoints. The purpose of this exporter is to perform black-box testing on RPC endpoints.
4
+
3
5
## Metrics
6
+
4
7
Exporter currently supports all EVM-compatible chains. In addition, there is limited support for the following chains:
8
+
5
9
- Cardano (wss)
6
10
- Conflux (wss)
7
11
- Solana (https & wss)
8
12
- Bitcoin (https)
9
13
- Dogecoin (https)
10
14
- Filecoin (https)
11
15
- Starknet (https)
16
+
- Aptos (https)
17
+
- XRPL (https)
12
18
13
19
## Available Metrics
14
20
15
21
# Disclaimer
22
+
16
23
Please note that this tool is in the early development stage and should not be used to influence critical business decisions.
17
24
The project in its current form suits our short-term needs and will receive limited support. We encourage you to fork the project and extend it with additional functionality you might need.
18
25
19
26
## Development
27
+
20
28
You should install [pre-commit](https://pre-commit.com/) so that automated linting and formatting checks are performed before each commit.
21
29
22
30
Run:
31
+
23
32
```bash
24
33
pip install pre-commit
25
34
pre-commit install
26
35
```
36
+
27
37
### Running locally
38
+
28
39
1. Make sure you have python3 installed (>3.11)
29
40
2. Set up your python environment
41
+
30
42
```bash
31
43
pip3 install virtualenv
32
44
virtualenv venv
33
45
source venv/bin/activate
34
46
pip install -r requirements.txt
35
47
pip install -r requirements-dev.txt
36
48
```
49
+
37
50
1. Generate valid exporter config and validation file. For example see [config example](config/exporter_example/config.yml) and [validation example](config/exporter_example/validation.yml).
38
51
2. Export paths of generated configuration files relative to `src/exporter.py`:
52
+
39
53
```bash
40
54
export VALIDATION_FILE_PATH="validation.yml"# For example if we saved validation config file in src/validation.yml
41
55
export CONFIG_FILE_PATH="config.yml"# For example if we saved config file in src/config.yml
42
56
```
57
+
43
58
3. Finally you can run the exporter
59
+
44
60
```bash
45
61
python exporter.py
46
62
```
63
+
47
64
### Run with docker-compose
65
+
48
66
1. Generate valid exporter config and validation file. For example see [config example](config/exporter_example/config.yml) and [validation example](config/exporter_example/validation.yml).
49
67
2. Export paths of generated configuration files relative to `docker-compose.yml`:
68
+
50
69
```bash
51
70
export VALIDATION_FILE_PATH="src/validation.yml"# For example if we saved validation config file in src/validation.yml
52
71
export CONFIG_FILE_PATH="src/config.yml"# For example if we saved config file in src/config.yml
Testing is performed using [pytest](https://docs.pytest.org/) run by [coverage.py](https://coverage.readthedocs.io/) to generate test coverage reporting.
65
87
[pylint](https://pylint.readthedocs.io/) is used to lint the pyhton code.
66
88
These dependencies can be found in the [requirements-dev.txt](requirements-dev.txt) file. Unit testing and linting is performed on every commit push to the repository. 90% test coverage and no linter errors/warnings are a requirement for the tests to pass.
67
89
68
90
#### Testing Locally (venv)
91
+
69
92
Tests can be run locally in the virtual environment.
93
+
70
94
1. Run the unit tests with coverage.py from within the `src` directory.
95
+
71
96
```bash
72
97
coverage run --branch -m pytest
73
98
```
99
+
74
100
2. Generate the coverage report. To view the report open the generated `index.html` file in a browser.
101
+
75
102
```bash
76
103
coverage html
77
104
```
105
+
78
106
3. Run the linter to find any errors/warnings.
107
+
79
108
```bash
80
109
pylint src/*py
81
110
```
82
111
83
112
#### Testing Locally (docker)
113
+
84
114
The tests and linter can be run using docker by building the `test` docker stage.
0 commit comments