mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-02 04:06:42 +00:00

* [NOD-1223] Delete unused files/packages. * [NOD-1223] Move signal and limits to the os package. * [NOD-1223] Put database and dbaccess into the db package. * [NOD-1223] Fold the logs package into the logger package. * [NOD-1223] Rename domainmessage to appmessage. * [NOD-1223] Rename to/from DomainMessage to AppMessage. * [NOD-1223] Move appmessage to the app packge. * [NOD-1223] Move protocol to the app packge. * [NOD-1223] Move the network package to the infrastructure packge. * [NOD-1223] Rename cmd to executables. * [NOD-1223] Fix go.doc in the logger package.
35 lines
1.7 KiB
Markdown
35 lines
1.7 KiB
Markdown
rpcmodel
|
|
=======
|
|
|
|
[](https://choosealicense.com/licenses/isc/)
|
|
[](http://godoc.org/github.com/kaspanet/kaspad/rpcmodel)
|
|
|
|
Package rpcmodel implements concrete types for marshalling to and from the
|
|
kaspa JSON-RPC API. A comprehensive suite of tests is provided to ensure
|
|
proper functionality.
|
|
|
|
Note that although it's possible to use this package directly to implement an
|
|
RPC client, it is not recommended since it is only intended as an infrastructure
|
|
package. Instead, RPC clients should use the rpcclient package which provides
|
|
a full blown RPC client with many features such as automatic connection
|
|
management, websocket support, automatic notification re-registration on
|
|
reconnect, and conversion from the raw underlying RPC types (strings, floats,
|
|
ints, etc) to higher-level types with many nice and useful properties.
|
|
|
|
## Examples
|
|
|
|
* [Marshal Command](http://godoc.org/github.com/kaspanet/kaspad/rpcmodel#example-MarshalCmd)
|
|
Demonstrates how to create and marshal a command into a JSON-RPC request.
|
|
|
|
* [Unmarshal Command](http://godoc.org/github.com/kaspanet/kaspad/rpcmodel#example-UnmarshalCmd)
|
|
Demonstrates how to unmarshal a JSON-RPC request and then unmarshal the
|
|
concrete request into a concrete command.
|
|
|
|
* [Marshal Response](http://godoc.org/github.com/kaspanet/kaspad/rpcmodel#example-MarshalResponse)
|
|
Demonstrates how to marshal a JSON-RPC response.
|
|
|
|
* [Unmarshal Response](http://godoc.org/github.com/kaspanet/kaspad/rpcmodel#example-package--UnmarshalResponse)
|
|
Demonstrates how to unmarshal a JSON-RPC response and then unmarshal the
|
|
result field in the response to a concrete type.
|
|
|