# Introduction
# Purpose
The purpose of the API document is to serve as a guide on how to use API in Miyabi. It contains all the relevant information for each endpoint such as request and response bodies and parameters.
# Definitions of Parameters
Parameter | Type | Description | Limit | Comment |
---|---|---|---|---|
Table Name | string | Name of a table | N/A | |
Address | hexadecimal | Byte string of a public key | N/A | Not null |
Key | bytestring | Byte string used as the key for table entries | N/A | |
Height | signed int32 | Number that shows a block's position in the chain | min=0, max = max(int32) | |
Current height | signed int32 | The height that consensus is currently running at | min=0, max = max(int32) | |
Start Height | signed int32 | The starting height used when designating a range of blocks | min = 0, max = max(int32) | If it is greater than the current height, an object not found error will be returned. If it is not defined, it will be calculated by depth from the current height. |
Depth | signed int32 | The maximum number of blocks will be retrieved | min =0, max = (int32) | Defaults to 10, if it is null. |
Block ID | hexadecimal | Each block has Unique Hexadecimal ID called block ID | N/A | |
Transaction ID | hexadecimal | Each transaction in the blockchain has a unique hexadecimal ID called transaction ID | N/A | Can be calculated through the CLI command GettransactionId using the transaction as an input |
# Swagger
Details of the API can be found at {host}/swagger/index.html.
# How to Get Private Keys and Public Keys
Miyabi supports the following methods for managing public keys and private keys.
Generate a pkcs12 certificate with a random private key with the following CLI command:
./miyabi-cli generatepkcs12 -d <directory to store certificate> -f <file name>
.
Get a private key from a pkcs12 certificate with the following CLI command:
./miyabi-cli parsepkcs12 -f <Absolute file path for 0.p12 file>
.
Get a public key from a private key with the following CLI command:
./miyabi-cli getpublickey Private_Key
.