JSON RPC interfaces
Programmatically Interfacing `dacnode`
In order to accept incoming connections from the network you need to configure the node accordingly.
As a developer, sooner rather than later you'll want to start interacting with dacnode and the DAC Blockchain network via your own programs and not manually through the console. To aid this, dacnode has built-in support for a JSON-RPC based APIs (standard APIs and geth specific APIs). These can be exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based platforms, and named pipes on Windows).
The IPC interface is enabled by default and exposes all the APIs supported by dacnode, whereas the HTTP and WS interfaces need to manually be enabled and only expose a subset of APIs due to security reasons. These can be turned on/off and configured as you'd expect.
JSON-RPC API options:
--httpEnable the HTTP-RPC server--http.addrHTTP-RPC server listening interface (default:localhost)--http.portHTTP-RPC server listening port (default:8545)--http.apiAPI's offered over the HTTP-RPC interface (default:eth,net,web3)--http.corsdomainComma separated list of domains from which to accept cross origin requests (browser enforced)
Web-Socket API options:
--wsEnable the WS-RPC server--ws.addrWS-RPC server listening interface (default:localhost)--ws.portWS-RPC server listening port (default:8546)--ws.apiAPI's offered over the WS-RPC interface (default:eth,net,web3)--ws.originsOrigins from which to accept websockets requests
GraphQL API options:
--graphqlEnable GraphQL on the HTTP-RPC server. Note that GraphQL can only be started if an HTTP server is started as well.--graphql.corsdomainComma separated list of domains from which to accept cross origin requests (browser enforced)--graphql.vhostsComma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: "localhost")
IPC API options:
--ipcdisableDisable the IPC-RPC server--ipcapiAPI's offered over the IPC-RPC interface (default:admin,debug,eth,miner,net,personal,shh,txpool,web3)--ipcpathFilename for IPC socket/pipe within the datadir (explicit paths escape it)
You'll need to use your own programming environments' capabilities (libraries, tools, etc) to connect via HTTP, WS or IPC to a dacnode node configured with the above flags and you'll need to speak JSON-RPC on all transports. You can reuse the same connection for multiple requests! Here you can check the available JSON-RPC calls.
Last updated