Example
host: 0.0.0.0
port: 2449
tls:
enabled: true
server:
certificate: "/path/127.0.0.1.crt"
key: "/path/127.0.0.1.p8.key"
client:
require: true
ca: "/path/ca.dshackle.test.crt"
monitoring:
enabled: true
jvm: false
extended: false
prometheus:
enabled: true
bind: 127.0.0.1
port: 8081
path: /metrics
health:
port: 8082
host: 127.0.0.1
path: /health
blockchains:
- chain: ethereum
min-availability: 1
cache:
redis:
enabled: true
host: redis-master
port: 6379
db: 0
password: I1y0dGKy01by
signed-response:
enabled: true
algorithm: SECP256K1
private-key: /path/key.pem
proxy:
host: 0.0.0.0
port: 8080
websocket: true
preserve-batch-order: false
tls:
enabled: true
server:
certificate: "/path/127.0.0.1.crt"
key: "/path/127.0.0.1.p8.key"
client:
require: true
ca: "/path/ca.dshackle.test.crt"
routes:
- id: eth
blockchain: ethereum
- id: kovan
blockchain: kovan
tokens:
- id: dai
blockchain: ethereum
name: DAI
type: ERC-20
address: 0x6B175474E89094C44Da98b954EedeAC495271d0F
- id: tether
blockchain: ethereum
name: Tether
type: ERC-20
address: 0xdac17f958d2ee523a2206206994597c13d831ec7
accessLog:
enabled: true
filename: /var/log/dshackle/access_log.jsonl
cluster:
defaults:
- chains:
- ethereum
options:
min-peers: 10
- chains:
- kovan
options:
min-peers: 3
include:
- "upstreams-extra.yaml"
upstreams:
- id: local
chain: ethereum
labels:
fullnode: true
methods:
enabled:
- name: "parity_trace"
disabled:
- name: "admin_shutdown"
connection:
ethereum-pos:
execution:
rpc:
url: "http://localhost:8545"
ws:
url: "ws://localhost:8546"
origin: "http://localhost"
basic-auth:
username: 9c199ad8f281f20154fc258fe41a6814
password: 258fe4149c199ad8f2811a68f20154fc
- id: infura
chain: ethereum
options:
disable-validation: true
connection:
ethereum-pos:
execution:
rpc:
url: "https://mainnet.infura.io/v3/fa28c968191849c1aff541ad1d8511f2"
basic-auth:
username: 4fc258fe41a68149c199ad8f281f2015
password: 1a68f20154fc258fe4149c199ad8f281
- id: bitcoin
chain: bitcoin
options:
# use the node to fetch balances
balance: true
connection:
bitcoin:
rpc:
url: "http://localhost:8332"
basic-auth:
username: bitcoin
password: e984af45bb888428207c290
# use Esplora index to fetch balances and utxo for an address
esplora:
url: "http://localhost:3001"
# connect via ZeroMQ to get notifications about new blocks
zeromq:
address: "http://localhost:5555"
- id: remote
connection:
grpc:
host: "10.2.0.15"
tls:
ca: /path/ca.dshackle.test.crt
certificate: /path/client1.dshackle.test.crt
key: /path/client1.dshackle.test.key
Top level config
Option | Default Value | Description |
---|---|---|
|
|
Host to bind gRPC server |
|
|
Port to bind gRPC server |
|
Setup TLS configuration for the gRPC server. See TLS server config section |
|
|
Setup Prometheus monitoring. See Monitoring section |
|
|
Setup Health Check endpoint See Health Check endpoint section |
|
|
Setup HTTP proxy that emulates all standard JSON RPC requests. See Proxy config section |
|
|
Configure access logging. See Access Log config section |
|
|
Configure tokens for tracking balance. See Tokens config section |
|
|
Caching configuration. See Cache config section. |
|
|
Signed responses See Signed Response section. |
|
|
Setup connection to remote nodes.See Cluster section |
TLS server config
tls:
enabled: true
server:
certificate: "/path/127.0.0.1.crt"
key: "/path/127.0.0.1.p8.key"
client:
require: true
ca: "/path/ca.dshackle.test.crt"
Option | Default Value | Description |
---|---|---|
|
|
Enable/Disable TLS |
|
Path to x509 certificate |
|
|
Path to a private key to the certificate.The key MUST BE in PKCS 8 format |
|
|
If true then the server will required certificate from a client, otherwise client authentication is optional |
|
|
Certificate to validate client authentication |
Monitoring
Configure Prometheus monitoring
monitoring:
enabled: true
jvm: false
extended: false
prometheus:
enabled: true
bind: 127.0.0.1
port: 8081
path: /metrics
Option | Default Value | Description |
---|---|---|
|
|
Enable/Disable monitoring endpoint |
|
|
Enable/Disable JVM metrics (threads, GC, memory, etc) |
|
|
Enable/Disable additional metrics (query selectors, etc) |
|
|
Enable/Disable monitoring endpoint. Reserved for future use, in case of multiple different types of endpoints. |
|
|
Host to bind the server |
|
|
Port to bind the server |
|
|
HTTP path to bind the server |
Health Check endpoint
health:
port: 8082
host: 127.0.0.1
path: /health
blockchains:
- chain: ethereum
min-available: 2
- chain: bitcoin
min-available: 1
Option | Default Value | Description |
---|---|---|
|
|
HTTP port to bind the server |
|
|
HTTP host to bind the server |
|
|
HTTP path to respond on requests |
|
List of blockchains that must be available to consider the server healthy |
|
|
Blockchain id |
|
|
1 |
How many available upstreams for the blockchain is required to pass |
Proxy config
proxy:
host: 0.0.0.0
port: 8080
preserve-batch-order: false
tls:
enabled: true
server:
certificate: "/path/127.0.0.1.crt"
key: "/path/127.0.0.1.p8.key"
client:
require: true
ca: "/path/ca.dshackle.test.crt"
routes:
- id: eth
blockchain: ethereum
- id: kovan
blockchain: kovan
Option | Default Value | Description |
---|---|---|
|
|
Host to bind HTTP server |
|
|
Port to bind HTT server |
|
|
Should proxy preserve request-response correspondence when sending batch request via http |
|
|
Enable WebSocket Proxy |
|
Setup TLS configuration for the Proxy server. See TLS server config section |
|
|
false |
If |
|
Access-Control-Allow-Origin contents. If empty the header will be omitted in response |
|
|
|
Access-Control-Allow-Headers contents. Takes effect only if сors-origi is present in config |
|
Routing paths for Proxy.
The proxy will handle requests as |
Option | Default Value | Description |
---|---|---|
|
Internal alphanumeric id, and a path of binding url - |
|
|
A blockchain that must be used to handle that route. |
Access Log config
accessLog:
enabled: true
filename: /var/log/dshackle/access_log.jsonl
Option | Default | Description |
---|---|---|
|
|
Enable/Disable Access logging |
|
|
Include request params and response result/error (i.e., a JSON) in access log. It’s an expensive operation, use it for debugging only. Note that for errors it provides only error message, not the error response itself. |
|
|
Path to the access log file |
Tokens config
tokens:
- id: dai
blockchain: ethereum
name: DAI
type: ERC-20
address: 0x6B175474E89094C44Da98b954EedeAC495271d0F
- id: tether
blockchain: ethereum
name: Tether
type: ERC-20
address: 0xdac17f958d2ee523a2206206994597c13d831ec7
Tokens config enables tracking of a balance amount in the configured tokens.
After making the configuration above you can request balance (GetBalance
), or subscribe to balance changes (SubscribeBalance
), using enhanced protocol
Option | Description |
---|---|
|
Internal id for reference (used in logging, etc) |
|
An ethereum-based blockchain where the contract is deployed |
|
Name of the token, used for balance response as asset code (as converted to UPPERCASE) |
|
Type of token.Only |
|
Address of the deployed contract |
Cache config
cache:
redis:
enabled: true
host: redis-master
port: 6379
db: 0
password: I1y0dGKy01by
Option | Default Value | Description |
---|---|---|
|
|
Enable/disable Redis cache |
|
|
Redis host address |
|
|
Redis port |
|
|
Redis DB to select |
|
Password for connection, if required |
Signed Response
signed-response:
enabled: true
algorithm: SECP256K1
private-key: /path/key.pem
Option | Default Value | Description |
---|---|---|
|
|
Enable/disable Signed Responses |
|
|
|
|
Path to a private key in PEM format |
See more details at Signed Response in gRPC Methods.
Cluster
The cluster config is the main part, that defines all connection to nodes and other servers
cluster:
defaults:
- chains:
- ethereum
options:
min-peers: 10
upstreams:
- id: local
chain: ethereum
connection:
ethereum-pos:
execution:
rpc:
url: "http://localhost:8545"
ws:
url: "ws://localhost:8546"
origin: "http://localhost"
include:
- "upstreams-extra.yaml"
Main Cluster Configuration
Option | Description |
---|---|
|
Default options applied to all upstreams within the specified blockchain. It’s an optional configuration, and may be omitted for most of the situations. |
|
List of upstream servers. The main part of the config. There are two types of upstream: JSON RPC Upstream and Dshackle Upstream. |
|
Path(s) to include configurations for upstream servers. Same as |
JSON RPC Upstream
- id: local
chain: ethereum
role: standard
labels:
fullnode: true
methods:
enabled:
- name: "parity_trace"
quorum: "not_empty"
disabled:
- name: "admin_shutdown"
connection:
ethereum-pos:
execution:
rpc:
url: "http://localhost:8545"
ws:
url: "ws://localhost:8546"
origin: "http://localhost"
basic-auth:
username: 9c199ad8f281f20154fc258fe41a6814
password: 258fe4149c199ad8f2811a68f20154fc
frameSize: 5mb
msgSize: 15mb
Option | Required | Description |
---|---|---|
|
yes |
Per-cluster identifier of an upstream |
|
no |
|
|
yes |
Blockchain which is the provided by the upstream.
Cluster may have multiple upstreams for a single blockchain.
Accepted types: |
|
no |
|
|
no |
Key-Value pairs that are assigned to the upstream. Used to select an upstream per-request. See Quorum and Selectors |
|
Other configuration options. See General Upstream Options |
|
|
no |
Enable ( |
|
yes |
Name of the RPC method to enable/disable. |
|
no |
Set quorum criteria to accept a response.
|
|
yes |
Connection configuration for Ethereum API of PoS network |
|
yes |
Connection configuration for Bitcoin API |
General Upstream Options
Option | Type | Default | Description |
---|---|---|---|
|
boolean |
|
Disables all the validations of the upstream. I.e., it turns off |
|
boolean |
|
Disables validation of the chain settings of the upstream. Prevent of creating an upstream with incorrect chain if it relates to a node with another chain. |
|
number |
|
Period in seconds to re-validate the upstream. |
|
boolean |
|
Disables validation of the peers connected to the upstream (as |
|
number |
|
The minimum number of connected peer to consider the upstream valid if |
|
boolean |
|
Disables checking for the state of syncing on the upstream (as |
|
boolean |
|
Enable/Disable the call limit validation. Size of call limit is defined by |
|
boolean |
|
Enable/Disable the gas price validation. If it’s enabled, the Dshackle will check the gas price of the upstream and compare it with the gas price conditions in chain.yaml
Check conditions can contain multiple values presented as a list of pair operator and value. The operator can be |
|
number |
|
For all eth-like chains (except zkSync). The maximum size of the call limit. If the upstream exceeds this limit, it will be considered as failed. |
|
number |
|
Timeout in seconds to wait for an answer from the upstream before considering it as failed. |
|
boolean |
Suitable for Bitcoin upstream. Tells if the Upstream can be used to call balance methods, which requires that the node has the indexing as turned on. |
Ethereum Connection Options
Option | Description |
---|---|
|
HTTP URL to connect to.This is required for a connection. |
|
HTTP Basic Auth configuration, if required by the remote server.
|
|
WebSocket URL to connect to. Optional, but optimizes performance if it’s available. |
|
HTTP |
|
WebSocket Basic Auth configuration, if required by the remote server |
|
WebSocket frame size limit.
Ex |
|
Total limit for a message size consisting from multiple frames.
Ex |
|
How many concurrent connection to make. If more than one, each used in a robin-round fashion.
Defaults is |
PoS Ethereum Connection Options
Option | Description |
---|---|
|
Here you can specify any option from plain ethereum connection options listed above |
|
Rating for this upstream. We will always consider the head of the chain to be |
Bitcoin Connection Options
Option | Description |
---|---|
|
HTTP URL to connect to. This is required for a connection. |
|
HTTP Basic Auth configuration, which is required by the Bitcoind server.
|
|
Set up an additional connection via ZeroMQ protocol to subscribe to the new blocks.
The node must be launched with the same address specified as
|
Dshackle Upstream
Another option is using another Dshackle server as an upstream. It’s more effective, easier to secure connection, and allows to build a distributed network of servers.
- id: test1
labels:
provider: some
connection:
grpc:
host: eu-api.mycompany.com
port: 2449
tls:
ca: ca.api.mycompany.crt
certificate: client-1.api.mycompany.crt
key: client-1.api.mycompany.p8.key
Option | Required | Description |
---|---|---|
|
yes |
Per-cluster identifier of an upstream |
|
no |
Defines the labels can be used for the proper upstream instance selection. Overrides the labels retrieved by the |
|
yes |
Connection configuration for Dshackle gRPC |
Option | Description |
---|---|
|
Address to connect to |
|
TLC configuration for the connection.
In general it’s an optional configuration, but it’s strongly recommended.
Also HTTP2 + gRPC is designed to be used with TLS, and some of the related software is unable to use it without TLS. |
|
Path to x509 certificate to verify remote server |
|
Client certificate (x509) and its private key (PKCS 8) used for authentication on the remote server. |