-
Notifications
You must be signed in to change notification settings - Fork 0
Maintanance shortcuts
A couple more tips to help you bootstrap quickly.
In terms of OSI model, Dogecoin-core node it is a system service, accepting requests by HTTP. The message body format have to correspond JSON-RPC operation standard. To see the list of available operations you can launch the next command line interface command:
dogecoin-cli -rpcconnect=127.0.0.1 -rpcuser=userName -rpcpassword=password help
dogecoin-cli -rpcconnect=127.0.0.1 -rpcuser=userName -rpcpassword=password help getblockchaininfo
dogecoin-cli -rpcconnect=127.0.0.1 -rpcuser=userName -rpcpassword=password getblockchaininfo
The response will contain API description on each particular method.
Here is an example how to send command to your node by HTTP protocol:
curl --user yourUserName --data-binary '{"jsonrpc": "1.0", "id":"0", "method": "getrawtransaction", "params": ["b8187e268e947167b7a46e343e9315151219119672c87957f2725bd16ebcc7cc", true]}' -H 'content-type: text/plain;' http://127.0.0.1:22555/
I would recommend to use HTTP, because it is HTTP POST request, such way would be more secure.
curl utility is OK for smoke-tests, but more convenient way is through dogeJ library. The library does effectively the same as above mentioned plain CLI commands. Plus the library serialize and desalinize request/response into java objects automatically. So you do not need to focus on transport routine anymore.
You can find more details on how to configure library on the main page. Each method of the library is documented with the execution responses from CLI like above. This means if you imported the lib into your project, you can simply see the API documentation, instead launching commands and investigating the output.
That is it!