- Follow instructions in launching go-photon readonly node
By default, the only way to send API requests to the node is via .ipc
file inside the datadir.
To enable HTTP and/or WS endpoints, use:
photon --genesis $NETWORK --http --ws
The default ports for HTTP and WS are 18545 and 18546. Override them with --http.port
and --ws.port
flags if needed.
By default, the endpoints are accessible only by localhost. To allow external requests, use:
photon --genesis $NETWORK --http --http.vhosts="*" --http.corsdomain="*" --ws --ws.origins="*"
The default namepsaces are limited to tpc,eth,abft,dag,rpc,web3
. To allow all the namepsaces, use:
photon --genesis $NETWORK --http --http.api="tpc,eth,debug,admin,web3,personal,net,txpool,sfc" --ws --ws.api="tpc,eth,debug,admin,web3,personal,net,txpool,sfc"
Pay attention that the full list of namepsaces provides direct access to the node.
Allow as fewer namepsaces as possible and limit access to as fewer hosts as possible.