ethersphere / helm-charts

Helm charts to deploy Swarm and Geth
6 stars 4 forks source link

swarm: allow exposing websocket rpc api for testing purposes #57

Closed skylenet closed 5 years ago

skylenet commented 5 years ago

Requested via https://github.com/ethersphere/go-ethereum/issues/1220

When enabled, your ingress resources targeting individual nodes, will have the websocket RPC API accessible via /wsrpc

Example of a request targeting a swarm node:

echo '{"jsonrpc":"2.0","method":"admin_peers","id":1}' | websocat wss://swarm-private-0-yournamespace.stg.swarm-gateways.net/wsrpc --origin localhost

Example values.yaml file that enables the ws APIs and exposes them at the ingress level.

swarm:
  metricsEnabled: true
  tracingEnabled: true
  profilingEnabled: false
  image:
    repository: ethdevops/swarm
    tag: edge
  terminationGracePeriodSeconds: 5
  imagePullPolicy: IfNotPresent
  podManagementPolicy: Parallel
  updateStrategy:
    type: "OnDelete"
  config:
    ens_api: http://mainnet-geth-geth.geth:8545
    verbosity: 4
    debug: true
    maxpeers: 25
    bzznetworkid: 3
    extraFlags:
      - --ws
      - --wsaddr=0.0.0.0
      - --wsorigins=localhost
      - --wsapi=admin,net,debug
  ingress:
    domain: stg.swarm-gateways.net
    enabled: true
    # Warning: Exposing the websocket RPC API can be dangerous.
    #          This should be used only for testing purposes.
    exposeWebsocketRPC: true
    tls:
      enabled: true
      acmeEnabled: false
    annotations:
      nginx.ingress.kubernetes.io/proxy-body-size: 500m
      nginx.ingress.kubernetes.io/ssl-redirect: "false"
  persistence:
    enabled: false
  resources:
    requests:
      memory: 512Mi
      cpu: 0.1
    limits:
      memory: 1024Mi
      cpu: 0.3
nolash commented 5 years ago

@skylenet I wouldn't know quite how to review this, but if it does what you say it does it's ok with me :)