From cca28c35a73eba72e930ad901f9d19e86d31d46e Mon Sep 17 00:00:00 2001 From: czarly <379651+czarly@users.noreply.github.com> Date: Wed, 19 Oct 2022 13:20:24 +0400 Subject: [PATCH 1/7] added dshackle confgured with free node providers for ethereum --- dshackle.yml | 41 +++++++++++++++++++++ dshackle/config/alchemy.yaml | 41 +++++++++++++++++++++ dshackle/config/ankr.yaml | 14 ++++++++ dshackle/config/anyblock.yaml | 14 ++++++++ dshackle/config/avado.yaml | 14 ++++++++ dshackle/config/chainstack.yaml | 22 ++++++++++++ dshackle/config/cloudflare.yaml | 14 ++++++++ dshackle/config/coinbase.yaml | 31 ++++++++++++++++ dshackle/config/dshackle.yaml | 64 +++++++++++++++++++++++++++++++++ dshackle/config/infura.yaml | 16 +++++++++ dshackle/config/quicknode.yaml | 29 +++++++++++++++ dshackle/config/rivet.yaml | 16 +++++++++ 12 files changed, 316 insertions(+) create mode 100644 dshackle.yml create mode 100644 dshackle/config/alchemy.yaml create mode 100644 dshackle/config/ankr.yaml create mode 100644 dshackle/config/anyblock.yaml create mode 100644 dshackle/config/avado.yaml create mode 100644 dshackle/config/chainstack.yaml create mode 100644 dshackle/config/cloudflare.yaml create mode 100644 dshackle/config/coinbase.yaml create mode 100644 dshackle/config/dshackle.yaml create mode 100644 dshackle/config/infura.yaml create mode 100644 dshackle/config/quicknode.yaml create mode 100644 dshackle/config/rivet.yaml diff --git a/dshackle.yml b/dshackle.yml new file mode 100644 index 00000000..c7d4c746 --- /dev/null +++ b/dshackle.yml @@ -0,0 +1,41 @@ +version: '3.1' + +services: + + dshackle: + container_name: dshackle + image: emeraldpay/dshackle:0.13.1 + restart: unless-stopped + volumes: + - ./dshackle/config:/etc/dshackle # This should hold all your yaml files + ports: + - "8080:8080" + - "8081:8081" + - "8082:8082" + environment: + - ALCHEMY_KEY=${ALCHEMY_KEY} + - ANYBLOCK_KEY=${ANYBLOCK_KEY} + - CHAINSTACK_NODE=${CHAINSTACK_NODE} + - CHAINSTACK_USERNAME=${CHAINSTACK_USERNAME} + - CHAINSTACK_PASSWORD=${CHAINSTACK_PASSWORD} + - COINBASE_USERNAME=${COINBASE_USERNAME} + - COINBASE_PASSWORD=${COINBASE_PASSWORD} + - INFURA_KEY=${INFURA_KEY} + - RIVET_KEY=${RIVET_KEY} + - QUICKNODE_HTTP=${QUICKNODE_HTTP} + - QUICKNODE_WSS=${QUICKNODE_WSS} + + redis: + container_name: redis + image: healthcheck/redis:alpine + restart: unless-stopped + environment: + - REDIS_RAM=${REDIS_RAM} + command: + - "redis-server" + - "--maxmemory ${REDIS_RAM}" + - "--maxmemory-policy allkeys-lru" + - '--save ""' + + + diff --git a/dshackle/config/alchemy.yaml b/dshackle/config/alchemy.yaml new file mode 100644 index 00000000..1f71dd3c --- /dev/null +++ b/dshackle/config/alchemy.yaml @@ -0,0 +1,41 @@ +upstreams: + - id: alchemy + chain: ethereum + role: fallback + priority: 90 + options: + disable-validation: false + validate-peers: false + validate-syncing: true + methods: + enabled: + # Manually Enabled + - name: alchemy_getAssetTransfers + - name: alchemy_getTokenAllowance + - name: alchemy_getTokenBalances + - name: alchemy_getTokenMetadata + - name: eth_getFilterChanges + - name: eth_getFilterLogs + - name: eth_maxPriorityFeePerGas + - name: eth_newBlockFilter + - name: eth_newFilter + - name: eth_newPendingTransactionFilter + - name: eth_subscribe + - name: eth_uninstallFilter + - name: eth_unsubscribe + - name: trace_block + - name: trace_call + - name: trace_callMany + - name: trace_filter + - name: trace_get + - name: trace_rawTransaction + - name: trace_replayBlockTransactions + - name: trace_replayTransaction + - name: trace_transaction + connection: + ethereum: + rpc: + url: "https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_KEY}" + ws: + url: "wss://eth-mainnet.ws.alchemyapi.io/v2/${ALCHEMY_KEY}" + diff --git a/dshackle/config/ankr.yaml b/dshackle/config/ankr.yaml new file mode 100644 index 00000000..432671e4 --- /dev/null +++ b/dshackle/config/ankr.yaml @@ -0,0 +1,14 @@ +upstreams: + - id: ankr + chain: ethereum + role: fallback + priority: 80 + options: + disable-validation: false + validate-peers: false + validate-syncing: true + connection: + ethereum: + rpc: + url: "https://rpc.ankr.com/eth" + diff --git a/dshackle/config/anyblock.yaml b/dshackle/config/anyblock.yaml new file mode 100644 index 00000000..aeb7c211 --- /dev/null +++ b/dshackle/config/anyblock.yaml @@ -0,0 +1,14 @@ +upstreams: + - id: anyblock + chain: ethereum + role: fallback + priority: 70 + options: + disable-validation: false + validate-peers: false + validate-syncing: true + connection: + ethereum: + rpc: + url: "https://api.anyblock.tools/ethereum/ethereum/mainnet/rpc/${ANYBLOCK_KEY}" + diff --git a/dshackle/config/avado.yaml b/dshackle/config/avado.yaml new file mode 100644 index 00000000..d07bb8e1 --- /dev/null +++ b/dshackle/config/avado.yaml @@ -0,0 +1,14 @@ +upstreams: + - id: avado + chain: ethereum + role: fallback + priority: 60 + options: + disable-validation: false + validate-peers: false + validate-syncing: true + connection: + ethereum: + rpc: + url: "https://mainnet.eth.cloud.ava.do" + diff --git a/dshackle/config/chainstack.yaml b/dshackle/config/chainstack.yaml new file mode 100644 index 00000000..ccf30382 --- /dev/null +++ b/dshackle/config/chainstack.yaml @@ -0,0 +1,22 @@ +upstreams: + - id: chainstack + chain: ethereum + role: fallback + priority: 50 + options: + disable-validation: false + validate-peers: false + validate-syncing: true + connection: + ethereum: + rpc: + url: "https://${CHAINSTACK_NODE}.p2pify.com" + basic-auth: + username: ${CHAINSTACK_USERNAME} + password: ${CHAINSTACK_PASSWORD} + ws: + url: "wss://ws-${CHAINSTACK_NODE}.p2pify.com" + basic-auth: + username: ${CHAINSTACK_USERNAME} + password: ${CHAINSTACK_PASSWORD} + diff --git a/dshackle/config/cloudflare.yaml b/dshackle/config/cloudflare.yaml new file mode 100644 index 00000000..9996ab86 --- /dev/null +++ b/dshackle/config/cloudflare.yaml @@ -0,0 +1,14 @@ +upstreams: + - id: cloudflare + chain: ethereum + role: fallback + priority: 40 + options: + disable-validation: false + validate-peers: false + validate-syncing: true + connection: + ethereum: + rpc: + url: "https://cloudflare-eth.com" + diff --git a/dshackle/config/coinbase.yaml b/dshackle/config/coinbase.yaml new file mode 100644 index 00000000..58c209dd --- /dev/null +++ b/dshackle/config/coinbase.yaml @@ -0,0 +1,31 @@ +upstreams: + - id: coinbase + chain: ethereum + role: secondary + priority: 30 + labels: + provider: geth + archive: false + options: + disable-validation: false + validate-peers: false + validate-syncing: true + methods: + enabled: + # Manually Enabled + - name: coinbaseCloud_getBalances + - name: coinbaseCloud_getSingleBalance + - name: coinbaseCloud_getTokenAllowances + - name: coinbaseCloud_getTransactionByHash + - name: coinbaseCloud_getTransactionsByAddress + - name: coinbaseCloud_getTokenTransfersByAddress + - name: coinbaseCloud_getTokenMetadata + - name: coinbaseCloud_getTokenStandardEvents + connection: + ethereum: + rpc: + url: "https://mainnet.ethereum.coinbasecloud.net" + basic-auth: + username: ${COINBASE_USERNAME} + password: ${COINBASE_PASSWORD} + diff --git a/dshackle/config/dshackle.yaml b/dshackle/config/dshackle.yaml new file mode 100644 index 00000000..a59d02ef --- /dev/null +++ b/dshackle/config/dshackle.yaml @@ -0,0 +1,64 @@ +host: 0.0.0.0 +port: 2449 + +tls: + enabled: false + +monitoring: + enabled: true + jvm: false + extended: false + prometheus: + enabled: true + bind: 0.0.0.0 + port: 8081 + path: /metrics + +health: + port: 8082 + host: 0.0.0.0 + path: /health + blockchains: + - chain: ethereum + min-available: 1 + +cache: + redis: + enabled: true + host: redis + password: "" + +proxy: + host: 0.0.0.0 + port: 8080 + tls: + enabled: false + routes: + - id: eth + blockchain: ethereum + +cluster: + defaults: + - chains: + - ethereum + options: + min-peers: 10 + include: + # Private Nodes + #- "besu.yaml" + #- "geth.yaml" + #- "nethermind.yaml" + #- "erigon.yaml" + # Freemium Nodes + - "alchemy.yaml" + - "anyblock.yaml" + - "chainstack.yaml" + - "coinbase.yaml" + - "infura.yaml" + - "quicknode.yaml" + - "rivet.yaml" + # Public Nodes + - "cloudflare.yaml" + - "avado.yaml" + - "ankr.yaml" + diff --git a/dshackle/config/infura.yaml b/dshackle/config/infura.yaml new file mode 100644 index 00000000..758b48a5 --- /dev/null +++ b/dshackle/config/infura.yaml @@ -0,0 +1,16 @@ +upstreams: + - id: infura + chain: ethereum + role: fallback + priority: 20 + options: + disable-validation: false + validate-peers: false + validate-syncing: true + connection: + ethereum: + rpc: + url: "https://mainnet.infura.io/v3/${INFURA_KEY}" + ws: + url: "wss://mainnet.infura.io/ws/v3/${INFURA_KEY}" + diff --git a/dshackle/config/quicknode.yaml b/dshackle/config/quicknode.yaml new file mode 100644 index 00000000..6b050b16 --- /dev/null +++ b/dshackle/config/quicknode.yaml @@ -0,0 +1,29 @@ +upstreams: + - id: quicknode + chain: ethereum + role: fallback + priority: 140 + options: + disable-validation: false + validate-peers: false + validate-syncing: true + methods: + enabled: + # Manually Enabled + - name: qn_broadcastRawTransaction + - name: qn_fetchNFTCollectionDetails + - name: qn_fetchNFTs + - name: qn_fetchNFTsByCollection + - name: qn_getTokenMetadataByContractAddress + - name: qn_getTokenMetadataBySymbol + - name: qn_getTransfersByNFT + - name: qn_getWalletTokenBalance + - name: qn_getWalletTokenTransactions + - name: qn_verifyNFTsOwner + connection: + ethereum: + rpc: + url: "${QUICKNODE_HTTP}" + ws: + url: "${QUICKNODE_WSS}" + diff --git a/dshackle/config/rivet.yaml b/dshackle/config/rivet.yaml new file mode 100644 index 00000000..88ea8db5 --- /dev/null +++ b/dshackle/config/rivet.yaml @@ -0,0 +1,16 @@ +upstreams: + - id: rivet + chain: ethereum + role: fallback + priority: 10 + options: + disable-validation: false + validate-peers: false + validate-syncing: true + connection: + ethereum: + rpc: + url: "https://${RIVET_KEY}.eth.rpc.rivet.cloud" + ws: + url: "wss://${RIVET_KEY}.eth.ws.rivet.cloud" + From 79e58187f18b646aad6285e16d3aaedaf59a2c77 Mon Sep 17 00:00:00 2001 From: czarly <379651+czarly@users.noreply.github.com> Date: Wed, 19 Oct 2022 13:29:55 +0400 Subject: [PATCH 2/7] route dshackle via traefik and add prometheus scraping --- dshackle.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dshackle.yml b/dshackle.yml index c7d4c746..1d940106 100644 --- a/dshackle.yml +++ b/dshackle.yml @@ -8,10 +8,15 @@ services: restart: unless-stopped volumes: - ./dshackle/config:/etc/dshackle # This should hold all your yaml files + expose: + - 8080 + - 8081 + - 8082 + - 2449 ports: - "8080:8080" - "8081:8081" - - "8082:8082" + - "127.0.0.1:8082:8082" environment: - ALCHEMY_KEY=${ALCHEMY_KEY} - ANYBLOCK_KEY=${ANYBLOCK_KEY} @@ -24,6 +29,18 @@ services: - RIVET_KEY=${RIVET_KEY} - QUICKNODE_HTTP=${QUICKNODE_HTTP} - QUICKNODE_WSS=${QUICKNODE_WSS} + labels: + - "prometheus-scrape.enabled=true" + - "prometheus-scrape.port=8081" + - "prometheus-scrape.job_name=dshackle" + - "prometheus-scrape.metrics_path=/metrics" + - "traefik.enable=true" + - "traefik.http.middlewares.rpcdaemon-stripprefix.stripprefix.prefixes=/dshackle" + - "traefik.http.services.rpcdaemon.loadbalancer.server.port=8080" + - "traefik.http.routers.rpcdaemon.entrypoints=websecure" + - "traefik.http.routers.rpcdaemon.tls.certresolver=myresolver" + - "traefik.http.routers.rpcdaemon.rule=Host(`$DOMAIN`) && PathPrefix(`/dshackle`)" + - "traefik.http.routers.rpcdaemon.middlewares=rpcdaemon-stripprefix, ipwhitelist" redis: container_name: redis From 4b40259c93b4bc4b8551f0f29fa86024c32eaa47 Mon Sep 17 00:00:00 2001 From: czarly <379651+czarly@users.noreply.github.com> Date: Wed, 19 Oct 2022 13:33:02 +0400 Subject: [PATCH 3/7] fix --- dshackle.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dshackle.yml b/dshackle.yml index 1d940106..adaa406d 100644 --- a/dshackle.yml +++ b/dshackle.yml @@ -3,20 +3,17 @@ version: '3.1' services: dshackle: - container_name: dshackle image: emeraldpay/dshackle:0.13.1 restart: unless-stopped volumes: - ./dshackle/config:/etc/dshackle # This should hold all your yaml files expose: - - 8080 - - 8081 - - 8082 - - 2449 + - 8080 # /eth + - 8081 # /metrics + - 8082 # healthcheck + - 2449 # grpc ports: - - "8080:8080" - - "8081:8081" - - "127.0.0.1:8082:8082" + - "127.0.0.1:8082:8082" # healthcheck environment: - ALCHEMY_KEY=${ALCHEMY_KEY} - ANYBLOCK_KEY=${ANYBLOCK_KEY} @@ -43,7 +40,6 @@ services: - "traefik.http.routers.rpcdaemon.middlewares=rpcdaemon-stripprefix, ipwhitelist" redis: - container_name: redis image: healthcheck/redis:alpine restart: unless-stopped environment: From 5a89240a6108a0306675b42a17234b1965fb86db Mon Sep 17 00:00:00 2001 From: czarly <379651+czarly@users.noreply.github.com> Date: Wed, 19 Oct 2022 13:33:49 +0400 Subject: [PATCH 4/7] fix --- dshackle.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dshackle.yml b/dshackle.yml index adaa406d..a5e5b5b0 100644 --- a/dshackle.yml +++ b/dshackle.yml @@ -39,16 +39,16 @@ services: - "traefik.http.routers.rpcdaemon.rule=Host(`$DOMAIN`) && PathPrefix(`/dshackle`)" - "traefik.http.routers.rpcdaemon.middlewares=rpcdaemon-stripprefix, ipwhitelist" - redis: - image: healthcheck/redis:alpine - restart: unless-stopped - environment: - - REDIS_RAM=${REDIS_RAM} - command: - - "redis-server" - - "--maxmemory ${REDIS_RAM}" - - "--maxmemory-policy allkeys-lru" - - '--save ""' + redis: + image: healthcheck/redis:alpine + restart: unless-stopped + environment: + - REDIS_RAM=${REDIS_RAM} + command: + - "redis-server" + - "--maxmemory ${REDIS_RAM}" + - "--maxmemory-policy allkeys-lru" + - '--save ""' From 4fdba5f39aaef7f53a7effc16e3052965c798026 Mon Sep 17 00:00:00 2001 From: czarly <379651+czarly@users.noreply.github.com> Date: Wed, 19 Oct 2022 13:41:34 +0400 Subject: [PATCH 5/7] fix --- dshackle.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dshackle.yml b/dshackle.yml index a5e5b5b0..2e6983a7 100644 --- a/dshackle.yml +++ b/dshackle.yml @@ -32,12 +32,13 @@ services: - "prometheus-scrape.job_name=dshackle" - "prometheus-scrape.metrics_path=/metrics" - "traefik.enable=true" - - "traefik.http.middlewares.rpcdaemon-stripprefix.stripprefix.prefixes=/dshackle" - - "traefik.http.services.rpcdaemon.loadbalancer.server.port=8080" - - "traefik.http.routers.rpcdaemon.entrypoints=websecure" - - "traefik.http.routers.rpcdaemon.tls.certresolver=myresolver" - - "traefik.http.routers.rpcdaemon.rule=Host(`$DOMAIN`) && PathPrefix(`/dshackle`)" - - "traefik.http.routers.rpcdaemon.middlewares=rpcdaemon-stripprefix, ipwhitelist" + - "traefik.http.middlewares.dshackle-stripprefix.stripprefix.prefixes=/dshackle" + - "traefik.http.middlewares.shackle-replacepath.replacepath.path=/eth" + - "traefik.http.services.dshackle.loadbalancer.server.port=8080" + - "traefik.http.routers.dshackle.entrypoints=websecure" + - "traefik.http.routers.dshackle.tls.certresolver=myresolver" + - "traefik.http.routers.dshackle.rule=Host(`$DOMAIN`) && PathPrefix(`/dshackle`)" + - "traefik.http.routers.dshackle.middlewares=dshackle-stripprefix, dshackle-replacepath, ipwhitelist" redis: image: healthcheck/redis:alpine From adfff835d1292891678849946b6bc99dd680728a Mon Sep 17 00:00:00 2001 From: czarly <379651+czarly@users.noreply.github.com> Date: Wed, 19 Oct 2022 13:47:55 +0400 Subject: [PATCH 6/7] fix --- dshackle.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dshackle.yml b/dshackle.yml index 2e6983a7..8c64300b 100644 --- a/dshackle.yml +++ b/dshackle.yml @@ -33,12 +33,13 @@ services: - "prometheus-scrape.metrics_path=/metrics" - "traefik.enable=true" - "traefik.http.middlewares.dshackle-stripprefix.stripprefix.prefixes=/dshackle" - - "traefik.http.middlewares.shackle-replacepath.replacepath.path=/eth" + # - "traefik.http.middlewares.shackle-replacepath.replacepath.path=/eth" - "traefik.http.services.dshackle.loadbalancer.server.port=8080" - "traefik.http.routers.dshackle.entrypoints=websecure" - "traefik.http.routers.dshackle.tls.certresolver=myresolver" - "traefik.http.routers.dshackle.rule=Host(`$DOMAIN`) && PathPrefix(`/dshackle`)" - - "traefik.http.routers.dshackle.middlewares=dshackle-stripprefix, dshackle-replacepath, ipwhitelist" + # - "traefik.http.routers.dshackle.middlewares=dshackle-stripprefix, dshackle-replacepath, ipwhitelist" + - "traefik.http.routers.dshackle.middlewares=dshackle-stripprefix, ipwhitelist" redis: image: healthcheck/redis:alpine From a12453aa1d9e972f376b3ad88bbda85338f760e1 Mon Sep 17 00:00:00 2001 From: czarly <379651+czarly@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:02:31 +0400 Subject: [PATCH 7/7] fix --- dshackle.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dshackle.yml b/dshackle.yml index 8c64300b..31ba9646 100644 --- a/dshackle.yml +++ b/dshackle.yml @@ -12,6 +12,8 @@ services: - 8081 # /metrics - 8082 # healthcheck - 2449 # grpc + networks: + - chains ports: - "127.0.0.1:8082:8082" # healthcheck environment: @@ -44,6 +46,8 @@ services: redis: image: healthcheck/redis:alpine restart: unless-stopped + networks: + - chains environment: - REDIS_RAM=${REDIS_RAM} command: