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 APIsarrow-up-right and geth specific APIsarrow-up-right). 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:

  • --http Enable the HTTP-RPC server

  • --http.addr HTTP-RPC server listening interface (default: localhost)

  • --http.port HTTP-RPC server listening port (default: 8545)

  • --http.api API's offered over the HTTP-RPC interface (default: eth,net,web3)

  • --http.corsdomain Comma separated list of domains from which to accept cross origin requests (browser enforced)

Web-Socket API options:

  • --ws Enable the WS-RPC server

  • --ws.addr WS-RPC server listening interface (default: localhost)

  • --ws.port WS-RPC server listening port (default: 8546)

  • --ws.api API's offered over the WS-RPC interface (default: eth,net,web3)

  • --ws.origins Origins from which to accept websockets requests

GraphQL API options:

  • --graphql Enable GraphQL on the HTTP-RPC server. Note that GraphQL can only be started if an HTTP server is started as well.

  • --graphql.corsdomain Comma separated list of domains from which to accept cross origin requests (browser enforced)

  • --graphql.vhosts Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: "localhost")

IPC API options:

  • --ipcdisable Disable the IPC-RPC server

  • --ipcapi API's offered over the IPC-RPC interface (default: admin,debug,eth,miner,net,personal,shh,txpool,web3)

  • --ipcpath Filename 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-RPCarrow-up-right on all transports. You can reuse the same connection for multiple requests! Here you can check the available JSON-RPC callsarrow-up-right.

Last updated