Skip to content

digitalcashdev/RPCWebProxy

Repository files navigation

Dash RPC Proxy (+ Explorer)

Web-friendly, CORS-enabled RPC Proxy to the Digital Cash network.
(RPC Explorer included)

screenshot of RPC Proxy + Explorer performing a 'getaddressbalance' request

How to Self-Host Proxy + Explorer

  1. Clone and enter the repo

    git clone https://github.com/digitalcashdev/rpcproxy.git
    pushd ./rpcproxy/
  2. Install Go v1.22+

    curl https://webi.sh/go | sh
    source ~/.config/envman/PATH.env
  3. Season the Explorer to taste

    ls ./static/
    vi ./static/index.html
  4. Build and Run the Proxy \

    # Option 1: to run locally
    go build -o ./dash-rpcproxy ./cmd/dash-rpcproxy/
    
    # Option 2: to run on a server or in a container
    CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
         go build -o ./dash-rpcproxy-linux-x86_64 ./cmd/dash-rpcproxy/
    ./dash-rpcproxy --help
    
    ./dash-rpcproxy --port 8080 --web-root ./my-custom-explorer/ \
         --rpc-hostname 'localhost' --rpc-port 19998 \
         --rpc-username 'user' --rpc-password 'secret'

How to Register as a System Daemon

  1. Install serviceman, pathman, and setcap-netbind

    curl https://webi.sh/ | sh
    source ~/.config/envman/PATH.env
    
    webi serviceman setcap-netbind
  2. Place dash-rpcproxy in your PATH

    mkdir -p ~/bin/
    pathman add ~/bin/
    source ~/.config/envman/PATH.env
    
    mv ./dash-rpcproxy ~/bin/
  3. Allow binding to privileged ports
    (optional: non-root install on Linux)

    setcap-netbind 'dash-rpcproxy'
  4. Register the service

    sudo env PATH="$PATH" \
        serviceman add --name "dash-rpcproxy" --system --path="$PATH" -- \
        dash-rpcproxy --port 8080 \
            --rpc-hostname 'localhost' --rpc-port 19998 \
            --rpc-username 'user' --rpc-password 'secret'

    (note: this also works with ENVs, see ./example.env)

About

Web-friendly RPC Proxy to the Digital Cash Network (CORS-enabled)

Resources

License

Stars

Watchers

Forks