Platform Endpoints
Detailed platform gRPC endpoint reference
gRPC Overview
Please refer to the gRPC Overview for details regarding running the examples shown below, encoding/decoding the request/response data, and clients available for several languages.
Endpoint Details
Work in Progress
This document is an work in progress. Details may be missing or incomplete and are subject to change.
applyStateTransition
Submits a state transition to the platform via DAPI to make a change to layer 2 data.
Returns: Nothing or error
Parameters:
Name | Type | Required | Description |
---|---|---|---|
state_transition | Bytes (Base-64) | Yes | A state transition |
Example Request and Response
# Submit an identity create State Transition
grpcurl -proto protos/platform.proto -plaintext \
-d '{
"state_transition":"pWR0eXBlAmlzaWduYXR1cmV4WEg3TWhFWDQ0Z3JzMVIwTE9XTU5IZjAxWFNpYVFQcUlVZ1JLRXQyMkxHVERsUlUrZ1BwQUlUZk5JUmhXd3IvYTVHd0lzWm1idGdYVVFxcVhjbW9lQWtUOD1qcHVibGljS2V5c4GkYmlkAGRkYXRheCxBdzh2UmYxeFFCTlVLbzNiY2llaHlaR2NhM0hBSThkY0ZvVWJTK3hLb0lITmR0eXBlAGlpc0VuYWJsZWT1bmxvY2tlZE91dFBvaW50eDBLT1VUSHB5YnFPek9DNnhEVUhFWm9uc1lNSVpqcGppTHFZNnkxYmlWNWxRQUFBQUFvcHJvdG9jb2xWZXJzaW9uAA=="
}' \
seed-1.evonet.networks.dash.org:3010 \
org.dash.platform.dapi.v0.Platform/applyStateTransition
Response: No response except on error
getIdentity
Returns: Identity information for the requested identity
Parameters:
Name | Type | Required | Description |
---|---|---|---|
id | String | Yes | An identity id |
Example Request and Response
const DAPIClient = require('@dashevo/dapi-client');
const cbor = require('cbor');
const client = new DAPIClient({
seeds: [{
service: 'seed-1.evonet.networks.dash.org',
port: 3000
}],
});
const identityId = 'C7id2mah2RkiroiTy6h134hLgS6A47jhh5x91tvw16bz';
client.getIdentity(identityId).then((response) => {
const identity = cbor.decode(response);
console.log(identity);
}
grpcurl -proto protos/platform.proto -plaintext \
-d '{
"id":"C7id2mah2RkiroiTy6h134hLgS6A47jhh5x91tvw16bz"
}' \
seed-1.evonet.networks.dash.org:3010 \
org.dash.platform.dapi.v0.Platform/getIdentity
{
id: 'C7id2mah2RkiroiTy6h134hLgS6A47jhh5x91tvw16bz',
balance: 10026096,
publicKeys: [
{
id: 0,
data: 'A9/uZEcu2EtDODih7AYcwgfBViKE/Nkeo/x7UVa2RbUk',
type: 0,
isEnabled: true
}
]
}
{
"identity": "o2JpZHgsQzdpZDJtYWgyUmtpcm9pVHk2aDEzNGhMZ1M2QTQ3amhoNXg5MXR2dzE2YnpnYmFsYW5jZRoAmPxwanB1YmxpY0tleXOBpGJpZABkZGF0YXgsQTkvdVpFY3UyRXRET0RpaDdBWWN3Z2ZCVmlLRS9Oa2VvL3g3VVZhMlJiVWtkdHlwZQBpaXNFbmFibGVk9Q=="
}
getIdentityByFirstPublicKey
New in Dash Platform v0.13
Returns: Identity information associated with the provided public key hash
Parameters:
Name | Type | Required | Description |
---|---|---|---|
public_key_hash | Bytes | Yes | Public key hash (double-sha256) of an identity's first public key |
Public key hash
Note: the hash must be done using all fields of the identity public key object - e.g.
{ id: 0, data: 'A9/uZEcu2EtDODih7AYcwgfBViKE/Nkeo/x7UVa2RbUk', type: 0, isEnabled: true }
Example Request and Response
const DAPIClient = require('@dashevo/dapi-client');
const cbor = require('cbor');
const client = new DAPIClient({
seeds: [{
service: 'seed-1.evonet.networks.dash.org',
port: 3000
}],
});
const hash = '4e2736d0eecca645821089eb4b2422544e045655';
client.getIdentityByFirstPublicKey(hash).then((response) => {
const identity = cbor.decode(response);
console.log(identity);
});
grpcurl -proto protos/platform.proto -plaintext \
-d '{
"public_key_hash":"4e2736d0eecca645821089eb4b2422544e045655"
}' \
seed-1.evonet.networks.dash.org:3010 \
org.dash.platform.dapi.v0.Platform/getIdentityByFirstPublicKey
{
id: 'C7id2mah2RkiroiTy6h134hLgS6A47jhh5x91tvw16bz',
balance: 10026096,
publicKeys: [
{
id: 0,
data: 'A9/uZEcu2EtDODih7AYcwgfBViKE/Nkeo/x7UVa2RbUk',
type: 0,
isEnabled: true
}
]
}
getIdentityIdByFirstPublicKey
New in Dash Platform v0.13
Returns: Identity ID associated with the provided public key hash
Parameters:
Name | Type | Required | Description |
---|---|---|---|
public_key_hash | Bytes | Yes | Public key hash (double-sha256) of an identity's first public key |
Public key hash
Note: the hash must be done using all fields of the identity public key object - e.g.
{ id: 0, data: 'A9/uZEcu2EtDODih7AYcwgfBViKE/Nkeo/x7UVa2RbUk', type: 0, isEnabled: true }
Example Request and Response
grpcurl -proto protos/platform.proto -plaintext \
-d '{
"public_key_hash":"4e2736d0eecca645821089eb4b2422544e045655"
}' \
seed-1.evonet.networks.dash.org:3010 \
org.dash.platform.dapi.v0.Platform/getIdentityIdByFirstPublicKey
const DAPIClient = require('@dashevo/dapi-client');
const cbor = require('cbor');
const client = new DAPIClient({
seeds: [{
service: 'seed-1.evonet.networks.dash.org',
port: 3000
}],
});
const hash = '4e2736d0eecca645821089eb4b2422544e045655';
client.getIdentityIdByFirstPublicKey(hash).then((response) => {
console.log(response);
});
C7id2mah2RkiroiTy6h134hLgS6A47jhh5x91tvw16bz
getDataContract
Returns: Data Contract information for the requested data contract
Parameters:
Name | Type | Required | Description |
---|---|---|---|
id | String | Yes | A data contract id |
Example Request and Response
grpcurl -proto protos/platform.proto -plaintext \
-d '{
"id":"ARQGUnPH3YMK8FZuqwUjnTWEF6Zu4Cf3sT6e1Ruu1RXk"
}' \
seed-1.evonet.networks.dash.org:3010 \
org.dash.platform.dapi.v0.Platform/getDataContract
{
"dataContract": "pGMkaWR4LEFSUUdVblBIM1lNSzhGWnVxd1VqblRXRUY2WnU0Q2Yzc1Q2ZTFSdXUxUlhrZyRzY2hlbWF4NGh0dHBzOi8vc2NoZW1hLmRhc2gub3JnL2RwcC0wLTQtMC9tZXRhL2RhdGEtY29udHJhY3Rnb3duZXJJZHgsR2I5WUVITVl4Y01pU25CaHRCUVFtdHRtQW9xTjFhc2k2SEtReFJSN1lkWEFpZG9jdW1lbnRzoWRub3Rlompwcm9wZXJ0aWVzoWdtZXNzYWdloWR0eXBlZnN0cmluZ3RhZGRpdGlvbmFsUHJvcGVydGllc/Q="
}
getDocuments
Returns: Document information for the requested document(s)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
data_contract_id | String | Yes | A data contract id |
document_type | String | Yes | A document type defined by the data contract (e.g. preorder or domain for the DPNS contract) |
where * | Bytes | No | Where clause to filter the results (must be CBOR encoded) |
order_by * | Bytes | No | Sort records by the field(s) provided (must be CBOR encoded) |
limit | Integer | No | Maximum number of results to return |
---------- | |||
One of the following: | |||
start_at | Integer | No | Return records beginning with the index provided |
start_after | Integer | No | Return records beginning after the index provided |
- Parameter constraints
The
where
,order_by
,limit
,start_at
, andstart_after
parameters must comply with the limits defined on the Query Syntax page.Additionally, note that
where
andorder_by
must be CBOR encoded.
Example Request and Response
# Request one DPNS domain document
grpcurl -proto protos/platform.proto -plaintext \
-d '{
"data_contract_id":"ARQGUnPH3YMK8FZuqwUjnTWEF6Zu4Cf3sT6e1Ruu1RXk",
"document_type":"note",
"limit":1
}' \
seed-1.evonet.networks.dash.org:3010 \
org.dash.platform.dapi.v0.Platform/getDocuments
{
"documents": [
"pmMkaWR4LEhUYkNWZlRoU2gySmZiU1RCQmVjZlVpbWlONVp3VEU5bVZpb2pYQVYyZ1QxZSR0eXBlZG5vdGVnbWVzc2FnZXgtVHV0b3JpYWwgVGVzdCBAIE1vbiwgMTUgSnVuIDIwMjAgMjA6MDM6MDIgR01UaCRvd25lcklkeCxHYjlZRUhNWXhjTWlTbkJodEJRUW10dG1Bb3FOMWFzaTZIS1F4UlI3WWRYQWkkcmV2aXNpb24BbyRkYXRhQ29udHJhY3RJZHgsQVJRR1VuUEgzWU1LOEZadXF3VWpuVFdFRjZadTRDZjNzVDZlMVJ1dTFSWGs="
]
}
Code Reference
Implementation details related to the information on this page can be found in:
- The DAPI repository
lib/grpcServer/handlers/platform
folder - The dapi-grpc repository
protos
folder
Updated over 4 years ago