Public HiRPC methods
Connection types
By default all of these sockets are private, ie. they are linux abstract sockets and can only by accessed on the same machine. The socket address, and thereby the vissibillity can be changed in the tagionwave config file.
Input Validator | Dart Interface | Subscription | Node Interface |
---|---|---|---|
Write | Read-only | Pub | Half-duplex p2p wavefront communication |
Default shell endpoint | .. | ||
/api/v1/hirpc | /api/v1/hirpc | ||
Default socket address (node_prefix is added in mode0) | .. | .. | .. |
"\0node_prefixCONTRACT_NEUEWELLE" | "\0node_prefixDART_NEUEWELLE" | "\0SUBSCRIPTION_NEUEWELLE" | tcp://localhost:10700 |
HiRPC methods | .. | .. | .. |
"submit" | "dartCheckRead" | "log" | |
"dartRead" | |||
"dartRim" | |||
"dartBullseye" | |||
HiRPC method entities prefixes | .. | .. | .. |
.. | trt | .. | .. |
NNG Socket type | .. | .. | .. |
REPLY | REPLY | PUBLISH | ??? |
These are the hirpc methods exposed by the tagion kernel.
The example requests and responses are shown in the HiBONJSON interchange format. But in reality you'll always be sending the raw hibon over the wire.
The http methods expect a content-type of 'application/octet-stream'
Write methods
submit
HiRPC Method for submitting a contract, eg. making a transaction
The method will return ok if the contract was receveived, but cannot predict if the contract can be executed properly.
The method will return an error if the document is invalid or contract has the wrong format.
$msg.method.name = "submit"
$msg.method.params = SignedContract(SSC)
Returns
$msg.result = ResultOK
or
$msg.error
Read methods (DART(ro) + friends)
Since these methods all take what we call a DARTIndex as parameter, it is useful to know what exactly the dartindex protocol is.
dartCheckRead
This method takes a list of DART Indices and responds with all of the indices which were not in the DART
$msg.method.name = "dartCheckRead"
$msg.method.params.dart_indices = DARTIndex[]
Returns
$msg.result = DARTIndex[]
dartRead
This method takes a list of DART Indices and responds with a Recorder of all the archives which were in the DART
$msg.method.name = "dartRead"
$msg.method.params.dart_indices = DARTIndex[]
Example dartRead request
Example request
{
"$@": "HiRPC",
"$Y": [
"*",
"@AhJKNLaNgHVRgF1dEz8rWHhROYAVIntpyDasIpHVeAqE"
],
"$msg": {
"method": "dartRead",
"params": {
"dart_indices": [
[
"*",
"@4c2LxGMUI7o7AnNQfKxgAEdjwizVRvdtV3j2ItiBwQM="
],
[
"*",
"@oKqMX30Lf0KnzFJ46Ws5SRH48oPouDDS3IIXIaYPjkM="
]
]
}
},
"$sign": [
"*",
"@VVKuIfWv93MZCeCwpEcrHGRNsf8RaLtJguiytuegANxyMTSiWtNGdXQsuxaCTr7hKKQbY8UXHczlNLafm1-VwQ=="
]
}
Note - The "$Y"
, "$sign"
are optional, but are highly recommended in order to check that the package was not tampered with.
Returns
hirpc.result = RecordFactory.Recorder If a specified archive was not found in the dart, it is simply not included in the output recorder.
Example response
{
"$@": "HiRPC",
"$Y": [
"*",
"@A7l5pb4FfnnJYXW0_MDlXP-a1urQ_XC1ZCZmRAwNLGj-"
],
"$msg": {
"result": {
"$@": "Recorder",
"0": {
"$T": [
"i32",
1
],
"$a": {
// archive
}
},
"1": {
"$T": [
"i32",
1
],
"$a": {
// archive
}
}
}
},
"$sign": [
"*",
"@LoOxof1kQgjuFB188DjP-coHPqy5t26nK9Is9R2PVvhOa2Uri6VitOZkfQeKMQuH7tjn_yjLpYEsEcivKPbXDA=="
]
}
dartRim
This method takes a rimpath a return a Recorder with all of the branches in that rim
$msg.method.name = "dartRim"
$msg.method.params = Rims
Returns
$msg.result = RecordFactory.Recorder
dartBullseye
This method return the bullseye of the database
$msg.method.name = "dartBullseye"
Request
The request takes no parameters, so this is the only thing you need
{
"$@": "HiRPC",
"$msg": {
"method": "dartBullseye"
}
}
Returns
$msg.result = Fingerprint
Example Response
{
"$@": "HiRPC",
"$Y": [
"*",
"@AumexnPXMa0mKVsYQeEKvY4Y640DXNCuBU6XdzFOicWC"
],
"$msg": {
"result": {
"bullseye": [
"*",
"@lTeI-fg_6r6v0AUSA_tDL1mJlZNlikRpBTHfd6k4qt4="
]
}
},
"$sign": [
"*",
"@0cEtP0XNfxbjTKo0xx_jB5FzfYac_rHa3z-fDqCN0XdCHb3fQFR42NisU6yXiqFTSSjqHCawfmWEe9-9Bo-Wpw=="
]
}