A secure RPC proxy for Juno Cash nodes that provides authentication-free access for miners while protecting your node credentials. Also includes an optional ZMQ notification proxy for distributing block notifications to multiple miners.
- RPC Method Whitelist: Only allows specified RPC methods, blocking potentially dangerous calls
- Credential Isolation: Miners connect without credentials; proxy handles upstream authentication
- ZMQ Proxy: Forwards block notifications from node to multiple miners (optional)
- Configurable Authentication: Optional authentication for miners connecting to the proxy
- Go 1.21 or higher
- libzmq development libraries (for ZMQ proxy feature)
sudo apt-get install -y libzmq3-devsudo yum install -y zeromq-devel- Install Go (1.21 or higher)
- Install MSYS2
- Open MSYS2 MinGW64 terminal and install ZMQ:
pacman -S mingw-w64-x86_64-zeromq
go build -o juno-proxyUsing MSYS2 MinGW64 terminal:
go build -o juno-proxy.exeOr using PowerShell with CGO enabled:
$env:CGO_ENABLED = "1"
go build -o juno-proxy.exeNote: The ZMQ library requires CGO. Ensure your PATH includes the MinGW64 bin directory (e.g., C:\msys64\mingw64\bin) for the required DLLs at runtime.
Copy the example configuration file and edit it:
cp config.example.toml config.toml# Address and port to listen on
listen = "0.0.0.0:8233"
# RPC method whitelist - only these methods will be proxied
allowed_methods = [
"getblocktemplate",
"submitblock",
"getblockchaininfo",
"getmininginfo",
"getblockhash",
"getblock",
"getbestblockhash",
]
# Upstream junocash node connection
[upstream]
url = "http://127.0.0.1:8232"
username = "rpcuser"
password = "rpcpassword"
timeout = "30s"Enable authentication for miners connecting to this proxy if it's exposed to untrusted networks:
[proxy_auth]
enabled = true
username = "miner"
password = "minerpassword"The ZMQ proxy feature forwards block notifications from your Juno Cash node to multiple miners. This is useful when:
- Running multiple miners that need instant block notifications
- Your node is on a different machine than your miners
- You want to reduce the number of ZMQ connections to your node
First, enable ZMQ notifications on your Juno Cash node. Add to ~/.junocash/junocashd.conf:
zmqpubhashblock=tcp://127.0.0.1:28332
Restart junocashd after making this change.
Enable the ZMQ proxy in your config.toml:
[zmq]
enabled = true
upstream_url = "tcp://127.0.0.1:28332" # Your node's ZMQ address
listen = "tcp://0.0.0.0:28333" # Address miners connect to
topic = "hashblock" # Topic to forward (default)| Option | Description |
|---|---|
enabled |
Set to true to enable the ZMQ proxy |
upstream_url |
The ZMQ endpoint of your Juno Cash node |
listen |
The address where miners will connect for ZMQ notifications |
topic |
The ZMQ topic to subscribe/publish (default: hashblock) |
Configure juno-miner to connect to the proxy's ZMQ endpoint instead of the node directly:
./juno-miner --rpc-url http://proxy-host:8233 --zmq-url tcp://proxy-host:28333./juno-proxy -config config.toml-config PATH- Path to configuration file (default:config.toml)-version- Show version and exit
┌─────────────────┐
│ junocashd │
│ │
│ RPC: 8232 │
│ ZMQ: 28332 │
└────────┬────────┘
│
┌────────▼────────┐
│ juno-proxy │
│ │
│ RPC: 8233 │
│ ZMQ: 28333 │
└────────┬────────┘
│
┌────────────────────┼────────────────────┐
│ │ │
┌───────▼───────┐ ┌───────▼───────┐ ┌───────▼───────┐
│ juno-miner │ │ juno-miner │ │ juno-miner │
│ Worker 1 │ │ Worker 2 │ │ Worker 3 │
└───────────────┘ └───────────────┘ └───────────────┘
- The proxy isolates your node's RPC credentials from miners
- Use
proxy_authif the proxy is exposed to untrusted networks - The method whitelist prevents miners from executing dangerous RPC calls
- Consider firewall rules to restrict access to the proxy
MIT License