Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1415 commits
Select commit Hold shift + click to select a range
d2933b5
Update engine.h
maksymkeihz Jun 25, 2025
5d3e027
updates
maksymkeihz Jun 25, 2025
cfac2a0
Update zhttpmanager.cpp
maksymkeihz Jun 25, 2025
4201b10
Update zwebsocket.cpp
maksymkeihz Jun 25, 2025
4c12135
Update zhttpmanager.cpp
maksymkeihz Jun 25, 2025
549416d
updates
maksymkeihz Jun 26, 2025
a6751de
Update cacheutil.cpp
maksymkeihz Jun 26, 2025
990fc2c
Update cacheutil.cpp
maksymkeihz Jun 27, 2025
26a6e67
Update cacheutil.cpp
maksymkeihz Jun 27, 2025
428de21
Update cacheutil.cpp
maksymkeihz Jun 27, 2025
6f51d17
updates
maksymkeihz Jun 27, 2025
07a47d3
Update cacheutil.cpp
maksymkeihz Jun 27, 2025
cf81c22
Update cacheutil.cpp
maksymkeihz Jun 27, 2025
a62f9e4
Update cacheutil.cpp
maksymkeihz Jun 28, 2025
67e7153
updates
maksymkeihz Jul 1, 2025
df24074
Update zhttpmanager.cpp
maksymkeihz Jul 1, 2025
61618c4
Create INSTALL.md
maksymkeihz Jul 2, 2025
a7d3357
updates
maksymkeihz Jul 2, 2025
19551da
updates
maksymkeihz Jul 7, 2025
fdb8e1b
Update cacheutil.cpp
maksymkeihz Jul 7, 2025
e98a84e
updates
maksymkeihz Jul 7, 2025
4f45e54
Update cacheutil.cpp
maksymkeihz Jul 7, 2025
8224d2b
Update app.cpp
maksymkeihz Jul 7, 2025
dc1f1ce
updates
maksymkeihz Jul 7, 2025
6e7006e
Update INSTALL.md
maksymkeihz Jul 7, 2025
3437475
Update INSTALL.md
maksymkeihz Jul 7, 2025
bdea806
Update INSTALL.md
maksymkeihz Jul 7, 2025
4121f1e
Update cacheutil.cpp
maksymkeihz Jul 8, 2025
6814ff0
Update cacheutil.cpp
maksymkeihz Jul 8, 2025
b45ecbf
Update cacheutil.cpp
maksymkeihz Jul 8, 2025
2455746
Update cacheutil.cpp
maksymkeihz Jul 8, 2025
6afb600
Update zhttpmanager.cpp
maksymkeihz Jul 8, 2025
b570ba2
Update cacheutil.cpp
maksymkeihz Jul 8, 2025
67afbe0
Update cacheutil.cpp
maksymkeihz Jul 8, 2025
b3deb9a
Update cacheutil.cpp
maksymkeihz Jul 8, 2025
cc76965
Update cacheutil.cpp
maksymkeihz Jul 8, 2025
d18dbff
Update cacheutil.cpp
maksymkeihz Jul 8, 2025
57d3b29
Update zhttpmanager.cpp
maksymkeihz Jul 9, 2025
ee4f9c2
updates
maksymkeihz Jul 9, 2025
4ba2432
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
779c1d3
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
75fe95d
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
8e7acc1
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
af8f540
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
4041989
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
bac0fc0
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
cf2e7b9
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
dc25a99
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
0ccd5b8
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
7b07358
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
b482042
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
50d7747
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
ec4a47d
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
6d57da5
Update cacheutil.cpp
maksymkeihz Jul 9, 2025
81dc33d
Update zhttpmanager.cpp
maksymkeihz Jul 9, 2025
8b52f92
Update zhttpmanager.cpp
maksymkeihz Jul 15, 2025
ed4cfb3
updates
maksymkeihz Jul 16, 2025
1e6fad1
Update cacheutil.cpp
maksymkeihz Jul 16, 2025
c2e687d
Update cacheutil.h
maksymkeihz Jul 16, 2025
d925756
Update cacheutil.cpp
maksymkeihz Jul 16, 2025
b219997
updates
maksymkeihz Jul 16, 2025
08a7c0b
Update cacheutil.cpp
maksymkeihz Jul 16, 2025
e10fcb6
updates
maksymkeihz Jul 16, 2025
3b3c6db
updates
maksymkeihz Jul 16, 2025
d0aa8ba
Update cacheutil.h
maksymkeihz Jul 16, 2025
4cc43f7
Update cacheutil.h
maksymkeihz Jul 16, 2025
4ef7b61
Update cacheutil.cpp
maksymkeihz Jul 16, 2025
4f76d03
updates
maksymkeihz Jul 16, 2025
a7dc216
updates
maksymkeihz Jul 16, 2025
f1eb1f7
Update zhttpmanager.cpp
maksymkeihz Jul 16, 2025
7b94dbf
updates
maksymkeihz Jul 16, 2025
d8d2a30
updates
maksymkeihz Jul 17, 2025
98c161c
Update cacheutil.cpp
maksymkeihz Jul 17, 2025
d9e5903
updates
maksymkeihz Jul 17, 2025
08b06f9
updates
maksymkeihz Jul 17, 2025
20ffafd
updates
maksymkeihz Jul 17, 2025
43c5558
Update cacheutil.cpp
maksymkeihz Jul 17, 2025
0b4ba94
updates
maksymkeihz Jul 17, 2025
d0ae3b8
Update cacheutil.h
maksymkeihz Jul 17, 2025
c5fcd56
Update cacheutil.h
maksymkeihz Jul 17, 2025
250d3ce
Update cacheutil.cpp
maksymkeihz Jul 17, 2025
1969853
Update cacheutil.cpp
maksymkeihz Jul 17, 2025
9c74c2e
Update cacheutil.cpp
maksymkeihz Jul 17, 2025
bcea6eb
Update cacheutil.h
maksymkeihz Jul 17, 2025
37e2443
Update cacheutil.cpp
maksymkeihz Jul 17, 2025
f4690fe
updates
maksymkeihz Jul 17, 2025
b19ac33
Update cacheutil.cpp
maksymkeihz Jul 17, 2025
9abe6dc
Update cacheutil.cpp
maksymkeihz Jul 17, 2025
2bdb13b
updates
maksymkeihz Jul 17, 2025
b41ae22
updates
maksymkeihz Jul 17, 2025
163a4f2
Update wscatworker.cpp
maksymkeihz Jul 17, 2025
672a7de
updates
maksymkeihz Jul 17, 2025
add84b3
Update wscatworker.cpp
maksymkeihz Jul 17, 2025
647b233
Update wscatworker.cpp
maksymkeihz Jul 17, 2025
b96ac73
updates
maksymkeihz Jul 17, 2025
69af1ab
Update wscatworker.cpp
maksymkeihz Jul 17, 2025
167bb44
Update wscatworker.cpp
maksymkeihz Jul 17, 2025
5e781e1
Update wscatworker.cpp
maksymkeihz Jul 17, 2025
ce4fd67
Update wscatworker.cpp
maksymkeihz Jul 17, 2025
74ff240
updates
maksymkeihz Jul 17, 2025
19269d9
updates
maksymkeihz Jul 17, 2025
9ec54c3
Update cacheutil.cpp
maksymkeihz Jul 17, 2025
42670f7
Update wscatworker.cpp
maksymkeihz Jul 17, 2025
47fd994
Update INSTALL.md
maksymkeihz Jul 21, 2025
63e149e
updates
maksymkeihz Jul 23, 2025
309d8bd
updates
maksymkeihz Jul 23, 2025
07a0bf5
updates
maksymkeihz Jul 23, 2025
355dc85
updates
maksymkeihz Jul 23, 2025
c329f00
Update zhttpmanager.cpp
maksymkeihz Jul 23, 2025
d0518f2
Update cacheutil.cpp
maksymkeihz Jul 23, 2025
8b4db4a
Update zhttpmanager.cpp
maksymkeihz Jul 23, 2025
cb304fc
updates
maksymkeihz Jul 23, 2025
dc19913
Update zhttpmanager.cpp
maksymkeihz Jul 23, 2025
de9f784
Update zhttpmanager.cpp
maksymkeihz Jul 23, 2025
ec030d8
Update zhttpmanager.cpp
maksymkeihz Jul 23, 2025
40f9239
Update zhttpmanager.cpp
maksymkeihz Jul 24, 2025
1380140
Update zhttpmanager.cpp
maksymkeihz Jul 24, 2025
22f52f5
Update zhttpmanager.cpp
maksymkeihz Jul 24, 2025
32a8ef3
Update cacheutil.cpp
maksymkeihz Aug 5, 2025
922c420
Update zhttpmanager.cpp
maksymkeihz Aug 5, 2025
3ae5abf
Update zhttpmanager.cpp
maksymkeihz Aug 5, 2025
32a0394
Update cacheutil.cpp
maksymkeihz Aug 5, 2025
51abaa8
updates
maksymkeihz Aug 5, 2025
e497f46
updates
maksymkeihz Aug 6, 2025
b6c4cf6
Update zhttpmanager.cpp
maksymkeihz Aug 6, 2025
69d24a2
Update zhttpmanager.cpp
maksymkeihz Aug 6, 2025
f6015be
Update zhttpmanager.cpp
maksymkeihz Aug 6, 2025
bf8d6d3
Update cacheutil.cpp
maksymkeihz Aug 6, 2025
60aa92d
Update cacheutil.cpp
maksymkeihz Aug 6, 2025
87ff56a
Update zhttpmanager.cpp
maksymkeihz Aug 6, 2025
34333c0
Update zhttpmanager.cpp
maksymkeihz Aug 6, 2025
a525bcb
Update zhttpmanager.cpp
maksymkeihz Aug 6, 2025
ce16bb7
Update cacheutil.cpp
maksymkeihz Aug 6, 2025
5fe9daf
updates
maksymkeihz Aug 6, 2025
cc3d0fd
updates
maksymkeihz Aug 6, 2025
877e14d
updates
maksymkeihz Aug 6, 2025
17cda7a
Update app.cpp
maksymkeihz Aug 6, 2025
3ef3931
updates
maksymkeihz Aug 7, 2025
e32281d
updates
maksymkeihz Aug 7, 2025
59701fb
Update wscatworker.cpp
maksymkeihz Aug 12, 2025
e4591f2
Update cacheutil.cpp
maksymkeihz Aug 12, 2025
c47edb4
Update cacheutil.cpp
maksymkeihz Aug 12, 2025
e39e05b
Update cacheutil.cpp
maksymkeihz Aug 12, 2025
e249c4c
updates
maksymkeihz Aug 12, 2025
231c8d6
updates
maksymkeihz Aug 12, 2025
c4d7f15
Update zhttpmanager.cpp
maksymkeihz Aug 12, 2025
6e913f0
Update zhttpmanager.cpp
maksymkeihz Aug 12, 2025
57763fb
updates
maksymkeihz Aug 13, 2025
a6911fe
updates
maksymkeihz Aug 13, 2025
337418e
updates
maksymkeihz Aug 13, 2025
d30b781
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
e9c116f
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
1e29fe1
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
3eafc46
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
5a73223
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
77df664
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
45027f1
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
abe6715
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
8074929
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
669b7bc
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
b79e2d1
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
b854338
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
00a6786
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
fd29589
updates
maksymkeihz Aug 14, 2025
08d2126
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
5e862dd
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
1697ec3
Update zhttpmanager.cpp
maksymkeihz Aug 14, 2025
c049896
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
2374262
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
8c648d3
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
aa98396
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
8739aca
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
a49e463
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
08661d2
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
9fb8c47
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
55b9d2a
Update cacheutil.cpp
maksymkeihz Aug 15, 2025
4f0bd01
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
96528b2
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
33235d7
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
3fd47d3
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
d2ba725
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
70b9fca
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
a95d573
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
9929df1
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
56b07ab
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
af97cd0
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
fc0719b
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
9593af7
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
9683deb
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
d5d6528
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
9722d6e
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
cfef58e
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
6a1a6c0
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
0b9fd57
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
8031753
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
c8366e8
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
085caac
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
80e9879
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
7dd480e
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
2a448eb
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
383f3a8
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
c9036b4
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
a9cb429
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
1626010
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
24b9f63
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
df6ab54
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
b02a221
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
1db2f2f
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
cba81f6
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
f684123
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
f35f233
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
b747da3
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
043cc66
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
27499ed
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
7c29f44
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
6947ec4
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
5dac3fe
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
3de3f91
Update cacheutil.cpp
maksymkeihz Aug 15, 2025
9e82b94
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
5846355
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
b200270
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
ac70d76
Update zhttpmanager.cpp
maksymkeihz Aug 15, 2025
909c7ba
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
3ba27b5
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
5f5e8ad
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
f6b0718
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
743e7c9
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
868b4bc
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
4b797b9
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
f07d91f
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
5a30418
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
a553c8c
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
e6fba1e
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
63ccdb5
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
221e9a6
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
b07007b
Update zhttpmanager.cpp
maksymkeihz Aug 16, 2025
c0a669b
updates
maksymkeihz Aug 16, 2025
fc80538
Update pushpin.conf
maksymkeihz Aug 16, 2025
8f32bfe
Update zhttpmanager.cpp
maksymkeihz Aug 21, 2025
4c5a810
Update zhttpmanager.cpp
maksymkeihz Aug 21, 2025
4c8fe75
updates
maksymkeihz Aug 22, 2025
146db0e
updates
maksymkeihz Aug 22, 2025
db235f6
Update INSTALL.md
maksymkeihz Aug 23, 2025
7ff782c
updates
maksymkeihz Sep 4, 2025
fdeb04d
Update cacheutil.cpp
maksymkeihz Sep 4, 2025
49fc364
Update cacheutil.cpp
maksymkeihz Sep 8, 2025
4937a6b
updates
maksymkeihz Sep 8, 2025
99fb162
updates
maksymkeihz Sep 8, 2025
fb0e706
Update cacheutil.cpp
maksymkeihz Sep 9, 2025
596e99f
updates
maksymkeihz Sep 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 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 @@ -30,7 +30,7 @@ libc = "0.2"
log = "0.4"
miniz_oxide = "0.6"
mio = { version = "1", features = ["os-poll", "os-ext", "net"] }
openssl = "=0.10.66"
openssl = "=0.10.70"
paste = "1.0"
rustls = "0.21"
rustls-native-certs = "0.6"
Expand Down
216 changes: 216 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
## Building from source
```sh
git clone -b cache-dev https://github.com/radiumb/pushpin.git
```

### Dependencies
---
If you’re using a recent version of Debian or Ubuntu, then all dependencies can be installed via package management:
```sh
sudo apt-get install make pkg-config rustc cargo g++ libzmq3-dev libssl-dev libboost-dev qtbase5-dev
```
If you’re on macOS, then all dependencies can be installed via Homebrew:
```sh
brew install pkg-config rust zeromq boost qt
```
### Compiling
---
Simply run make:
```sh
make
```
Optionally, you can install:
```sh
sudo make install
```

## Running
Running on Debian and Ubuntu
```sh
sudo pushpin --loglevel=2,proxy:3 --logfile=/var/log/pushpin/pushpin.log
```
loglevel=2 : only show warnings, infos. 3 : show debug messages

## Configuration
Pushpin has two primary configuration files: `pushpin.conf` and routes. The `pushpin.conf` file refers to the routes file via the routesfile field:
```sh
[proxy]
routesfile=routes
```
If a relative path is used, then the file is looked up relative to the location of `pushpin.conf`.
```sh
sudo cp examples/config/pushpin.conf /usr/local/etc/pushpin/pushpin.conf
```
```sh
sudo cp examples/config/routes /usr/local/etc/pushpin/routes
```
### pushpin.conf file
For general options, please refer to [this](https://pushpin.org/docs/configuration/#pushpinconf-file).
Options for cache are added into this file.
* <a name="cache_enable"></a>cache enable flag (false=disable, true=enable)
```
cache_enable=true
```
#### backends
* <a name="http_backend_urls"></a>http url path list of backends when failed to get response
```
http_backend_urls=http://localhost:7999/ws1,http://localhost:7999/ws2,http://localhost:7999/ws3 ...
```
* <a name="ws_backend_urls"></a>websocket url paths for cache clients to connect to pushpin
```
ws_backend_urls=ws://localhost:7999/ws1,ws://localhost:7999/ws2,ws://localhost:7999/ws3 ...
```
#### cache methods
* <a name="cache_methods"></a>cache methods
```
ws_cache_methods=author_hasKey,author_hasSessionKeys,...
ws_subscribe_methods=beefy_subscribeJustifications,chain_subscribeAllHeads,...
(* means ALL methods, ex : ws_cache_methods=*)
```
#### cache refresh
* <a name="ws_never_timeout_methods"></a>never timeout/delete methods with params<br />
ref: List of methods that are not even delete/auto-refresh if it has the valid parameters
```
ws_never_timeout_methods=chain_getBlockHash,chain_getBlock,chain_getHeader,state_queryStorageAt,...
```
* <a name="ws_refresh_shorter_methods"></a>cache auto-refresh shorter timeout methods<br />
ref: List of methods with shorter auto-refresh timeout periods (5 seconds)
```
ws_auto_refresh_longer_timeout_methods=chain_getBlockHash,chain_getHeader,state_getKeysPaged,state_queryStorageAt,...
```
* <a name="ws_refresh_longer_methods"></a>cache auto-refresh longer timeout methods<br />
ref: List of methods with longer auto-refresh timeout periods (60 seconds)
```
ws_refresh_longer_methods=state_getMetadata,...
```
* <a name="ws_refresh_unerase_methods"></a>cache auto-refresh no delete methods<br />
ref: List of methods that exist permanently in the cache list and do auto-refresh periodically
```
ws_refresh_unerase_methods=chain_getBlockHash,system_health,eth_getBalance,...
```
* <a name="ws_refresh_exclude_methods"></a>cache no auto-refresh methods<br />
ref: List of methods that need to be cached but not auto refreshed
```
ws_refresh_exclude_methods=state_getMetadata,...
```
* <a name="ws_refresh_passthrough_methods"></a>cache pass-through methods<br />
ref: List of methods that are not even cached but pass though to backend i.e. don't reject
```
ws_refresh_passthrough_methods=state_getStorage,...
```
* <a name="ws_null_response_methods"></a>null response methods<br />
ref: List of methods that treat null responses as valid
```
ws_null_response_methods=chainHead_v1_unpin,...
```
#### cache keys
* <a name="ws_cache_key"></a>important fields in request, used as a key to identify cache items
```
ws_cache_key = $request_json_value["method"]+$user_defined["request_args"]+$request_json_pair["jsonrpc"]
request_args = $request_json_value["params"]
(ex : $request_json_value["method"]="author_hasKey", $request_json_pair["jsonrpc"]="\"jsonrpc\":\"2.0\"")
```
* <a name="message_id_attribute"></a>field name is used as ID in Request or Response (to support multi-protocol in future)
```
message_id_attribute="id"
```
* <a name="message_method_attribute"></a>field name is used as Method in Request or Response (to support multi-protocol in future)
```
message_method_attribute="method"
```
* <a name="message_params_attribute"></a>field name is used as Params in Request (to support never_timeout_methods_with_params)
```
message_params_attribute="params"
```
* <a name="message_error_attributes"></a>field names are used as Error in Response
```
message_error_attributes=error,fault,bug
```
#### timeout of auto-refresh
* <a name="ws_auto_refresh_cache_timeout_seconds"></a>cache timeout seconds (default 20)<br />
ref: Number of seconds to count auto-refresh timeout
```
ws_auto_refresh_cache_timeout_seconds=20
```
* <a name="ws_auto_refresh_shorter_timeout_seconds"></a>cache shorter timeout seconds (default 10)<br />
ref: Number of seconds to count auto-refresh shorter timeout
```
ws_auto_refresh_shorter_timeout_seconds=10
```
* <a name="ws_auto_refresh_longer_timeout_seconds"></a>cache longer timeout seconds (default 60)<br />
ref: Number of seconds to count auto-refresh longer timeout
```
ws_auto_refresh_longer_timeout_seconds=60
```
* <a name="ws_auto_refresh_access_timeout_seconds"></a>cache auto-refresh access timeout seconds (default 30)<br />
ref: Number of seconds to count time out, be used to delete cache items that are not referenced by any client for this timeout period
```
ws_auto_refresh_access_timeout_seconds=30
```
#### count of cache items
* <a name="cache_item_max_count"></a>Maximum cache item count (default 3000)
```
cache_item_max_count=3000
```
#### timeout
* <a name="backend_switch_interval_seconds"></a>time seconds to switch another backend for null response (default 10)
```
backend_switch_interval_seconds=10
```
#### error
* <a name="message_error_attributes"></a>Fields in the response identifying errors
```
message_error_attributes=error,fault,bug
```
#### prometheus
* <a name="prometheus_restore_allow_seconds"></a>prometheus restore allow seconds (default 300)
```
prometheus_restore_allow_seconds=250
```
#### redis
* <a name="redis_enable"></a>redis enable flag (default false)
```
redis_enable=true
```
* <a name="redis_host_addr"></a>redis server ip address (default 127.0.0.1)
```
redis_host_addr=127.0.0.1
```
* <a name="redis_port"></a>redis server port number (default 6379)
```
redis_port=6379
```
* <a name="redis_pool_count"></a>redis server port number (default 100)
```
redis_pool_count=100
```
* <a name="redis_key_header"></a>Redis key prefix to identify each Pushpin instance when sharing Redis between multiple instances.
```
redis_key_header="pushpin1:"
```
* <a name="replica_master_addr"></a>IP address of the replication master. If this is set to a valid IP address, Redis will act as a replica and attempt to connect to the specified master.
```
replica_master_addr=""
```
* <a name="replica_master_port"></a>replication master port number (default 6379). Specifies the port Redis should use to connect to the master.
```
replica_master_port=6379
```
#### Counts
* <a name="prometheus_count"></a>groups for promethus count
```
ws_count_groups=ws_key_group,ws_index_group,ws_block_group,ws_state_subscribe,ws_cache_candidates
ws_key_group=author_hasKey,author_insertKey,...
ws_block_group=chain_getBlock,chain_getBlockHash,...
ws_state_subscribe=state_subscribeRuntimeVersion,state_subscribeStorage,...
ws_cache_candidates=author_hasKey,author_hasSessionKeys,...
```

## Appendix
### Installing redis-server
```
sudo apt update
sudo apt install redis-server -y
sudo systemctl enable redis-server
sudo systemctl start redis-server
```
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
cargo_flags =
# controlled leading whitespace, per the GNU make manual
nullstring :=
space := $(nullstring) # end of the line

ifdef RELEASE
cargo_flags += --offline --locked --release
cargo_flags = $(space)--offline --locked --release
endif

cargo_toolchain =
ifdef TOOLCHAIN
cargo_toolchain += +$(TOOLCHAIN)
cargo_toolchain = $(space)+$(TOOLCHAIN)
endif

all: postbuild
Expand Down
78 changes: 76 additions & 2 deletions examples/config/pushpin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ logdir=log
log_level=2

# client full request header must fit in this buffer
client_buffer_size=8192
client_buffer_size=81920

# maximum number of client connections
client_maxconn=50000
Expand Down Expand Up @@ -108,12 +108,17 @@ sockjs_url=http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js
# pushpin will output a log message when a new version is available. report
# mode helps the pushpin project build credibility, so please enable it if you
# enjoy this software :)
updates_check=report
updates_check=off

# use this field to identify your organization in updates requests. if left
# blank, updates requests will be anonymous
organization_name=

# prometheus report
prometheus_port=9001

workers=1


[handler]
# ipc permissions (octal)
Expand Down Expand Up @@ -171,3 +176,72 @@ stats_report_interval=10

# stats output format
stats_format=tnetstring


[cache]
cache_enable=true

# backends
http_backend_urls=http://localhost:7999/ws1,http://localhost:7999/ws2,http://localhost:7999/ws3,http://localhost:7999/ws4,http://localhost:7999/ws5
ws_backend_urls=ws://localhost:7999/ws1,ws://localhost:7999/ws2,ws://localhost:7999/ws3,ws://localhost:7999/ws4,ws://localhost:7999/ws5

# cache methods
ws_cache_methods=*
#author_hasKey,author_hasSessionKeys,author_insertKey,author_pendingExtrinsics,author_removeExtrinsic,author_rotateKeys,author_submitExtrinsic,babe_epochAuthorship,beefy_getFinalizedHead,chain_getBlock,chain_getBlockHash,chain_getFinalizedHead,chain_getHeader,childstate_getKeys,childstate_getKeysPaged,childstate_getStorage,childstate_getStorageEntries,childstate_getStorageHash,childstate_getStorageSize,contracts_call,contracts_getStorage,contracts_instantiate,contracts_rentProjection,contracts_upload_code,dev_getBlockStats,engine_createBlock,engine_finalizeBlock,eth_accounts,eth_blockNumber,eth_call,eth_chainId,eth_coinbase,eth_estimateGas,eth_feeHistory,eth_gasPrice,eth_getBalance,eth_getBlockByHash,eth_getBlockByNumber,eth_getBlockTransactionCountByHash,eth_getBlockTransactionCountByNumber,eth_getCode,eth_getFilterChanges,eth_getFilterLogs,eth_getLogs,eth_getProof,eth_getStorageAt,eth_getTransactionByBlockHashAndIndex,eth_getTransactionByBlockNumberAndIndex,eth_getTransactionByHash,eth_getTransactionCount,eth_getTransactionReceipt,eth_getUncleByBlockHashAndIndex,eth_getUncleCountByBlockHash,eth_getUncleCountByBlockNumber,eth_getWork,eth_hashrate,eth_maxPriorityFeePerGas,eth_mining,eth_newBlockFilter,eth_newFilter,eth_newPendingTransactionFilter,eth_protocolVersion,eth_sendRawTransaction,eth_sendTransaction,eth_submitHashrate,eth_submitWork,eth_syncing,eth_uninstallFilter,net_listening,net_version,web3_clientVersion,web3_sha3,grandpa_proveFinality,grandpa_roundState,mmr_generateBatchProof,mmr_generateProof,offchain_localStorageGet,offchain_localStorageSet,payment_queryFeeDetails,payment_queryInfo,rpc_methods,state_call,state_getChildKeys,state_getChildReadProof,state_getChildStorage,state_getChildStorageHash,state_getChildStorageSize,state_getKeys,state_getKeysPaged,state_getMetadata,state_getPairs,state_getReadProof,state_getRuntimeVersion,state_getStorage,state_getStorageHash,state_getStorageSize,state_queryStorage,state_queryStorageAt,state_traceBlock,state_trieMigrationStatus,sync_state_genSyncSpec,system_accountNextIndex,system_addLogFilter,system_addReservedPeer,system_chain,system_chainType,system_dryRun,system_health,system_localListenAddresses,system_localPeerId,system_name,system_networkState,system_nodeRoles,system_peers,system_properties,system_removeReservedPeer,system_reservedPeers,system_resetLogFilter,system_syncState,system_version
ws_subscribe_methods=author_submitAndWatchExtrinsic+author_unwatchExtrinsic,beefy_subscribeJustifications+beefy_unsubscribeJustifications,chain_subscribeAllHeads+chain_unsubscribeAllHeads,chain_subscribeFinalisedHeads+chain_unsubscribeFinalisedHeads,chain_subscribeFinalizedHeads+chain_unsubscribeFinalizedHeads,chain_subscribeNewHead+chain_unsubscribeNewHead,chain_subscribeNewHeads+chain_unsubscribeNewHeads,chain_subscribeRuntimeVersion+chain_unsubscribeRuntimeVersion,grandpa_subscribeJustifications+grandpa_unsubscribeJustifications,state_subscribeRuntimeVersion+state_unsubscribeRuntimeVersion,state_subscribeStorage+state_unsubscribeStorage,transaction_unstable_submitAndWatch+transaction_unstable_unwatch,chainHead_v1_follow+chainHead_v1_unfollow

# cache refresh
ws_never_timeout_methods=chain_getBlockHash,chain_getBlock,chain_getHeader,state_queryStorageAt
ws_refresh_shorter_methods=chain_getBlockHash,chain_getHeader,state_getKeysPaged,state_queryStorageAt
ws_refresh_longer_methods=state_getMetadata
ws_refresh_unerase_methods=chain_getBlockHash,system_health,eth_getBalance
ws_refresh_exclude_methods=state_getMetadata
ws_refresh_passthrough_methods=state_getStorage
ws_null_response_methods=chainHead_v1_unpin

# cache key
ws_cache_key = $request_json_value["method"] + $user_defined["request_args"]+$request_json_pair["jsonrpc"]
request_args = $request_json_value["params"]
message_id_attribute="id"
message_method_attribute="method"
message_params_attribute="params"

# auto-refresh. timeout
# cache timeout seconds (default 20)
ws_auto_refresh_cache_timeout_seconds=20
# cache shorter timeout seconds (default 10)
ws_auto_refresh_shorter_cache_timeout_seconds=10
# cache longer timeout seconds (default 60)
ws_auto_refresh_longer_timeout_seconds=60
# cache auto-refresh access timeout seconds (default 30)
ws_auto_refresh_access_timeout_seconds=30

# Maximum cache item count (default 3000)
cache_item_max_count=3000

# time seconds to retry another backend for null response (default 10)
backend_switch_interval_seconds=10

# error
message_error_attributes=error,fault,bug

# prometheus restore allow seconds (default 300)
prometheus_restore_allow_seconds=250

# redis
redis_enable=false
redis_host_addr=127.0.0.1
redis_port=6379
redis_pool_count=100
redis_key_header="pushpin1:"
replica_master_addr="107.155.71.83"
replica_master_port=6379

# groups to count
ws_count_groups=ws_key_group,ws_index_group,ws_block_group,ws_chain_group,ws_state_subscribe,ws_cache_candidates
ws_key_group=author_hasKey,author_insertKey,childstate_getKeys,childstate_getKeysPaged,state_getChildKeys,state_getKeys,
ws_index_group=eth_getTransactionByBlockHashAndIndex,eth_getTransactionByBlockNumberAndIndex,eth_getUncleByBlockHashAndIndex,eth_getUncleByBlockNumberAndIndex,system_accountNextIndex
ws_block_group=chain_getBlock,chain_getBlockHash,dev_getBlockStats,engine_createBlock,engine_finalizeBlock,eth_blockNumber,eth_getBlockByHash,eth_getBlockByNumber,eth_getBlockTransactionCountByHash,eth_getBlockTransactionCountByNumber,eth_getTransactionByBlockHashAndIndex
ws_chain_group=chain_getBlock,chain_getBlockHash,chain_getFinalizedHead,chain_getHeader,chain_subscribeAllHeads,chain_subscribeFinalizedHeads,chain_subscribeNewHead
ws_state_subscribe=state_subscribeRuntimeVersion,state_subscribeStorage
ws_cache_candidates=author_hasKey,author_hasSessionKeys,author_insertKey,author_pendingExtrinsics,author_removeExtrinsic,author_rotateKeys,author_submitExtrinsic,babe_epochAuthorship,beefy_getFinalizedHead,chain_getBlock,chain_getBlockHash,chain_getFinalizedHead,chain_getHeader,childstate_getKeys,childstate_getKeysPaged,childstate_getStorage,childstate_getStorageEntries,childstate_getStorageHash,childstate_getStorageSize,contracts_call,contracts_getStorage,contracts_instantiate,contracts_rentProjection,contracts_upload_code,dev_getBlockStats,engine_createBlock,engine_finalizeBlock,eth_accounts,eth_blockNumber,eth_call,eth_chainId,eth_coinbase,eth_estimateGas,eth_feeHistory,eth_gasPrice,eth_getBalance,eth_getBlockByHash,eth_getBlockByNumber,eth_getBlockTransactionCountByHash,eth_getBlockTransactionCountByNumber,eth_getCode,eth_getFilterChanges,eth_getFilterLogs,eth_getLogs,eth_getProof,eth_getStorageAt,eth_getTransactionByBlockHashAndIndex,eth_getTransactionByBlockNumberAndIndex,eth_getTransactionByHash,eth_getTransactionCount,eth_getTransactionReceipt,eth_getUncleByBlockHashAndIndex,eth_getUncleCountByBlockHash,eth_getUncleCountByBlockNumber,eth_getWork,eth_hashrate,eth_maxPriorityFeePerGas,eth_mining,eth_newBlockFilter,eth_newFilter,eth_newPendingTransactionFilter,eth_protocolVersion,eth_sendRawTransaction,eth_sendTransaction,eth_submitHashrate,eth_submitWork,eth_syncing,eth_uninstallFilter,net_listening,net_version,web3_clientVersion,web3_sha3,grandpa_proveFinality,grandpa_roundState,mmr_generateBatchProof,mmr_generateProof,offchain_localStorageGet,offchain_localStorageSet,payment_queryFeeDetails,payment_queryInfo,rpc_methods,state_call,state_getChildKeys,state_getChildReadProof,state_getChildStorage,state_getChildStorageHash,state_getChildStorageSize,state_getKeys,state_getKeysPaged,state_getMetadata,state_getPairs,state_getReadProof,state_getRuntimeVersion,state_getStorage,state_getStorageHash,state_getStorageSize,state_queryStorage,state_queryStorageAt,state_traceBlock,state_trieMigrationStatus,sync_state_genSyncSpec,system_accountNextIndex,system_addLogFilter,system_addReservedPeer,system_chain,system_chainType,system_dryRun,system_health,system_localListenAddresses,system_localPeerId,system_name,system_networkState,system_nodeRoles,system_peers,system_properties,system_removeReservedPeer,system_reservedPeers,system_resetLogFilter,system_syncState,system_version,state_subscribeStorage,state_subscribeRuntimeVersion,chain_subscribeNewHead,chain_subscribeFinalizedHeads
3 changes: 2 additions & 1 deletion examples/config/routes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* test
*,proto=ws,no_grip,debug localhost:8999
*,proto=http,no_grip,debug localhost:8999
2 changes: 1 addition & 1 deletion src/connmgr/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl Batch {
self.nodes.remove(key.nkey);
}

pub fn take_group<'a, 'b: 'a, F>(&'a mut self, get_id: F) -> Option<BatchGroup>
pub fn take_group<'a, 'b: 'a, F>(&'a mut self, get_id: F) -> Option<BatchGroup<'a, 'b>>
where
F: Fn(usize) -> Option<(&'b [u8], u32)>,
{
Expand Down
Loading