A reverse proxy that only speaks json-rpc 2.0. Upstream routing is done using json-rpc method "namespaces".
sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
git clone https://github.com/dpays/jefferson.git
cd jefferson
DEV_config.json
is the main config file, we also use this configuration file in our production environments since we are still in BETA.- You will need a server running 0.19.6 for non-appbase RPC calls and a server running 0.20.2 for appbase-based RPC calls.
- The default configuration is what we use for dSite and dSocial. You can use your own nodes or can use the default nodes operated by dPay Nodes Team.
screen
docker-compose up
- dPay Primary API Node - https://api.dpays.io/
- dPay Secondary API Node - https://dpayapi.com/
- dPayLabs' API Node - https://api.dpayjs.com
- dPay Europe API Node - https://api.dpayeurope.com/
- dPay USA API Node - https://api.dpayusa.com/
- dPayID API Node - https://api.dpayid.io/
- dSite's dPay API Node - https://dapi.dsite.io/
- dPay GreatChain https://greatchain.dpaynodes.com or wss://greatchain.dpaynodes.com
- dPay GreatBase https://greatbase.dpaynodes.com or wss://greatbase.dpaynodes.com
- dPay GreatChain USA https://greatchain.dpays.io or wss://greatchain.dpays.io
- dPay D https://d.dpays.io or wss://d.dpays.io
- dPay DPAYD https://dpayd.dpays.io or wss://dpayd.dpays.io
- dPay Chicago (dPay USA) https://chicago.dpayusa or wss://chicago.dpayusa.com
- dPay Atlanta (dPay USA) https://atlanta.dpayusa.com or wss://atlanta.dpayusa.com
- dPay Dallas (dPay USA) https://dallas.dpayusa.com or wss://dallas.dpayusa.com
- dPay Los Angeles (dPay USA) https://la.dpayusa.com or wss://la.dpayusa.com
- dPay San Francisco (dPay USA) https://sf.dpayusa.com or wss://sf.dpayusa.com
- dPay Miami (dPay USA) https://miami.dpayusa.com or wss://miami.dpayusa.com
- dPay Iowa (dPay USA) https://iowa.dpayusa.com or wss://iowa.dpayusa.com
- dPay Virginia (dPay USA) https://virginia.dpayusa.com or wss://virginia.dpayusa.com
- dPay Oregon (dPay USA) https://oregon.dpayusa.com or wss://oregon.dpayusa.com
- dPay South Carolina (dPay USA) https://sc.dpayusa.com or wss://sc.dpayusa.com
- dPay London (dPay Europe) https://london.dpayeurope.com or wss://london.dpayeurope.com
- dPay Paris (dPay Europe) https://paris.dpayeurope.com or wss://paris.dpayeurope.com
- dPay London (dPay Europe) https://london.dpayeurope.com or wss://london.dpayeurope.com
- dPay Germany (dPay Europe) https://germany.dpayeurope.com or wss://germany.dpayeurope.com
- dPay Western Europe https://west.dpayeurope.com or wss://west.dpayeurope.com
- dPay Sydney (dPay Australia) https://sydney.dpayau.com or wss://sydney.dpayau.com
- dPay Taiwan (dPay Asia) https://taiwan.dpayasia.com or wss://taiwan.dpayasia.com
- dPayID Node https://d.dpayid.io or wss://d.dpayid.io
- dSite Node https://d.dsite.io or wss://d.dsite.io
- dSocial Node https://d.dsocial.io or wss://d.dsocial.io
- dWiki Node https://d.dwiki.io or wss://d.dwiki.io
- @dpay https://d.dpays.io or wss://d.dpays.io
- @jared https://dpayd.jrice.io or wss://dpayd.jrice.io
- @nomoreheroes https://nomoreheroes.link or wss://nomoreheroes.link
- @cointroller https://cointroller.dpays.io or wss://cointroller.dpays.io
- @michaelx https://michaelx.link or wss://michaelx.link
- @onceuponatime https://indominon.com or wss://indominon.com
- @kusknee https://kusknee.dpayproducers.com or wss://kusknee.dpayproducers.com
- @cryptokong https://kong.dpayproducers.com or wss://kong.dpayproducers.com
- @stan https://dpaystan.link or wss://dpaystan.link
- @lune https://lune.dpayproducers.com or wss://lune.dpayproducers.com
- @bossdan https://bossdan.dpayproducers.com or wss://bossdan.dpayproducers.com
- @samiam https://samiam.link or wss://samiam.link
- @mbex https://mbex.link or wss://mbex.link
- @nefertiti https://nefertitibex.link or wss://nefertitibex.link
- @bigg https://bigg.dpayproducers.com or wss://bigg.dpayproducers.com
- @chiraag https://chiraag.dpayproducers.com or wss://chiraag.dpayproducers.com
- @morrison https://morrison.dpayproducers.com or wss://morrison.dpayproducers.com
- @quin https://quin.dpayproducers.com or wss://quin.dpayproducers.com
- @freedomfirst https://freedomfirst.app or wss://freedomfirst.app
- @tablecafe https://tablecafe.dpayproducers.com or wss://tablecafe.dpayproducers.com
- @nickeles https://jackson.dpays.io or wss://jackson.dpays.io
A json-rpc method namespace is a json-rpc method prefix joined to the method name with a period, so a method in the "dpds" namespace begins with dpds.
and will be forwarded to a dpds endpoint:
POST / HTTP/1.1
Content-Type: application/json
{
"method": "dpds.count_operations",
"params": {"operation":"account_creates"},
"jsonrpc": "2.0",
"id": 1
}
Any json-rpc method with no period in the method name is presumed to be in the "dpayd" namespace and will be forwarded to a dpayd endpoint:
POST / HTTP/1.1
Content-Type: application/json
{
"method": "get_block",
"params": [1],
"jsonrpc": "2.0",
"id": 1
}
- parse the upstream config and build the routing, caching, timeout data structures
- open websocket and/or http connections to upstreams
- initialize memory cache and open connections to redis cache
- register route and error handlers
- validate jsonrpc request
- convert individual jsonrpc requests into
JSONRPCRequest
objects, which add its pseudo-urn and upstream configuration - generate cache key (pseudo-urn for the moment)
- if a single jsonrpc request:
- check in-memory cache, if miss
- make a redis
get
call
- if a batch call:
- check in-memory cache for all keys
- for any misses:
- make a redis
mget
request for any keys not found in memory cache
- if all data loaded from cache:
- merge cached data with requests to form response
- send response
- if any jsonrpc call results aren't in cache:
- determine which upstream url and protocol (websockets or http) to use to fetch them
- start upsteam request timers
- fetch missing jsonrpc calls
- end upstream response timers
- decide if response is a valid jsonrpc response and that it is not a jsonrpc error response
- if response is valid, and response is not a jsonrpc error response, determine the cache ttl for that jsonrpc namespace.method
- for some calls, verify the the response is a consensus response or not, and modify cache ttl for irreversible block responses
- return single jsonrpc response or assembled jsonrpc responses for batch requests
- cache response in redis cache
- cache response in memory