-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(config): support ${var:-word} and ${var:+word} syntax (#164)
- Loading branch information
1 parent
7b5747e
commit a4f5998
Showing
8 changed files
with
153 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
extensions: | ||
client: | ||
endpoints: | ||
- wss://acala-rpc.dwellir.com | ||
- wss://acala-rpc-0.aca-api.network | ||
health_check: | ||
interval_sec: 10 # check interval, default is 10s | ||
healthy_response_time_ms: 500 # max response time to be considered healthy, default is 500ms | ||
health_method: system_health | ||
response: # response contains { isSyncing: false } | ||
!contains | ||
- - isSyncing | ||
- !eq false | ||
event_bus: | ||
substrate_api: | ||
stale_timeout_seconds: 180 # rotate endpoint if no new blocks for 3 minutes | ||
telemetry: | ||
provider: none | ||
cache: | ||
default_ttl_seconds: 60 | ||
default_size: 500 | ||
merge_subscription: | ||
keep_alive_seconds: 60 | ||
server: | ||
port: ${SUBWAY_PORT:-9944} | ||
listen_address: '0.0.0.0' | ||
max_connections: ${SUBWAY_MAX_CONNECTIONS:-2000} | ||
http_methods: | ||
- path: /health | ||
method: system_health | ||
- path: /liveness | ||
method: chain_getBlockHash | ||
cors: all | ||
rate_limit: # these are for demo purpose only, please adjust to your needs | ||
connection: # 20 RPC requests per second per connection | ||
burst: 20 | ||
period_secs: 1 | ||
ip: # 500 RPC requests per 10 seconds per ip | ||
burst: 500 | ||
period_secs: 10 | ||
# use X-Forwarded-For header to get real ip, if available (e.g. behind a load balancer). | ||
# WARNING: Use with caution, as this xff header can be forged. | ||
use_xff: true # default is false | ||
|
||
middlewares: | ||
methods: | ||
- delay | ||
- response | ||
- inject_params | ||
- cache | ||
- upstream | ||
subscriptions: | ||
- merge_subscription | ||
- upstream | ||
|
||
rpcs: substrate |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use clap::Parser; | ||
use std::path::PathBuf; | ||
#[derive(Parser, Debug)] | ||
#[command(version, about)] | ||
pub struct Command { | ||
/// The config file to use | ||
#[arg(short, long, default_value = ".configs/config.yml")] | ||
pub config: PathBuf, | ||
} | ||
pub fn parse_args() -> Command { | ||
Command::parse() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod cli; | ||
pub mod config; | ||
pub mod extensions; | ||
pub mod logger; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters