Skip to content

Commit

Permalink
Updated API documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashkante committed Jul 8, 2019
1 parent 46c9584 commit 77d698c
Show file tree
Hide file tree
Showing 29 changed files with 495 additions and 34 deletions.
24 changes: 11 additions & 13 deletions _api_docs/core_block_height.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
---
title: Block Height
title: Get Block Height
type: core
---
## Block Height
Returns current block height of the node.
### Method: `blockheight`
## Get Block Height
Returns the number of Ixian blocks generated so far, usually named 'Block Height'.

### Method: `getblockheight`
### Input parameters:
None

### Errors:

| Error | Description |
| --- | --- |
| RPC_INTERNAL_ERROR | An unknown error occured in the node. Please check the node log for details. |
None

### Output:
- success: block height as an ulong in the result field with the error field set to null
- fail: JSON encoded details with a non-null error and a null result
- success: number of Ixian blocks since the Genesis block

### Example:
GET http://localhost:8081/blockheight
GET http://localhost:8081/getblockheight

```
{
"result": 140,
"result": 432178,
"error": null,
"id": null
}
```
```
30 changes: 30 additions & 0 deletions _api_docs/core_connect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Connect
type: core
---
## Connect
Initiates a network connection to the specified address.
### Method: `connect`
### Input parameters:
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| to | String | Yes | Hostname or IP address of the target Ixian node. |

### Errors:

| Error | Description |
| --- | --- |
| RPC_INVALID_PARAMETER | The required parameter `"to"` was not supplied. |

### Output:
- a JSON object containinly only the string "Connecting to node `to`" as the result.

### Example:
GET http://localhost:8081/connect?to=192.168.1.25
```
{
"result": "Connecting to node 192.168.1.25",
"error": null,
"id": null
}
```
57 changes: 57 additions & 0 deletions _api_docs/core_get_activity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: Get Activity
type: core
---
## Get Activity
Retrieves the activity for the currently loaded wallet with optional filtering on type and paging support.

### Method: `activity`
### Input parameters:

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| fromIndex | Number | No | Starting index (used for splitting the results into pages). |
| count | Number | No | Number of results to fetch. By itself, this parameter is useful for fetching only the recent history, but combined with `fromIndex` this parameters enables fetching results in pages. |
| type | Number | No | Type of the activity to fetch as a number. See below. |

### Activity Types
| Id | Type | Detail |
| --- | --- | --- |
| 100 | TransactionReceived | A transaction has been received. (Destination address belongs to the currently loaded wallet. |
| 101 | TransactionSent | A transaction has been sent from the currently loaded wallet. |
| 200 | MiningReward | A mining reward has been received by the currently loaded wallet. |
| 201 | StakingReward | A staking reward has been received by the currently loaded wallet. |
| 202 | TxFeeReward | A transaction fee reward has been received by the currently loaded wallet. |
| 300 | ContactRequest | A contact request has been received. |

### Output:
- activity details are returned as a JSON object and the error field is set to null:

### Errors:
None.

### Example:
GET http://localhost:8081/activity

```
{
"result": [
{
"seedHash": "Ac2g5Zh...TMg3p6v",
"wallet": "4qX7Uo...y5V4mHg",
"from": "1ixianinfinimine234234234234234234234234234242HP",
"toList": "||4ixR19HcrGcB...ECc=",
"type": 201,
"data": "c3RrLTIwLTI1...N3Q=",
"value": "0.09990100",
"timestamp": 1562596905,
"status": 2,
"blockHeight": 26,
"txid": "stk-20-25-2EAa...bysa7t",
"id": "Voaz...ftiPk"
}
]
"error": null,
"id": null
}
```
25 changes: 25 additions & 0 deletions _api_docs/core_get_total_balance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Get Total Balance
type: core
---
## Get Total Balance
Gets the total balance of IXIcoins in the Ixian DLT network. (Sum of all wallets' amounts)
### Method: `gettotalbalance`
### Input parameters:
None

### Errors:
None

### Output:
- a JSON object containinly the number of total IxiCoin supply as a decimal string.

### Example:
GET http://localhost:8081/gettotalbalance
```
{
"result": "100000000.00000000",
"error": null,
"id": null
}
```
25 changes: 25 additions & 0 deletions _api_docs/core_get_wallet_backup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Get Wallet Backup
type: core
---
## Get Wallet Backup
Retrieves the currently loaded wallet as a hexadecimal string. The wallet is encrypted with the user's password and the value is prefixed with the string `IXIHEX`.
### Method: `getwalletbackup`
### Input parameters:
None

### Errors:
None.

### Output:
- a JSON object with the wallet bytes encoded as a hexadecimal string.

### Example:
GET http://localhost:8081/getwalletbackup
```
{
"result": "IXIHEX0200000050090...cab76cfb758a14",
"error": null,
"id": null
}
```
25 changes: 25 additions & 0 deletions _api_docs/core_isolate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Isolate
type: core
---
## Isolate
Stops all network operations and disconnects all clients and servers.
### Method: `isolate`
### Input parameters:
None

### Errors:
None

### Output:
- a JSON object containinly only the string "Isolating from network now." as the result.

### Example:
GET http://localhost:8081/isolate
```
{
"result": "Isolating from network now.",
"error": null,
"id": null
}
```
25 changes: 25 additions & 0 deletions _api_docs/core_reconnect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Reconnect
type: core
---
## Reconnect
Stops all network operations, disconnects all clients and servers, then restarts the networking and attempts to reconnect to the network.
### Method: `reconnect`
### Input parameters:
None

### Errors:
None

### Output:
- a JSON object containinly only the string "Reconnecting node to network now." as the result.

### Example:
GET http://localhost:8081/reconnect
```
{
"result": "Reconnecting node to network now.",
"error": null,
"id": null
}
```
26 changes: 26 additions & 0 deletions _api_docs/core_shutdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: Shutdown
type: core
---
## Shutdown
Gracefully shuts down the running Ixian executable and closes the program.
Note: It is not possible to 'revive' the node after this command exits without access to the remote computer's OS.
### Method: `shutdown`
### Input parameters:
None

### Errors:
None

### Output:
- a JSON object containinly only the string "Node shutdown" as the result.

### Example:
GET http://localhost:8081/shutdown
```
{
"result": "Node shutdown",
"error": null,
"id": null
}
```
2 changes: 1 addition & 1 deletion _api_docs/core_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ None
| RPC_INTERNAL_ERROR | An unknown error occured in the node. Please check the node log for details. |

### Output:
- success: status JSON-encoded in tje result field with the error field set to null
- success: status JSON-encoded in the result field with the error field set to null
- fail: JSON encoded details with a non-null error and a null result

### Example:
Expand Down
33 changes: 33 additions & 0 deletions _api_docs/core_validate_address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Validate Address
type: core
---
## Validate Address
Ensures that the given address is in the correct format.
### Method: `validateaddress`
### Input parameters:

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| address | String | Yes | Wallet address to validate |

### Errors:

| Error | Description |
| --- | --- |
| RPC_INVALID_ADDRESS_OR_KEY | The provided vaue does not represent a valid Ixian address, or there was no value provided. |


### Output:
- success: string "OK" in the result field.
- fail: JSON encoded error details and the result field set to null

### Example:
GET http://localhost:8081/validateaddress?address=4qX7Uot9BbweZh56gVeXWRwoe2Wb6vesNJtZJzm672uHUqucsHENe1849Vy5V4mHg
```
{
"result": "OK",
"error": null,
"id": null
}
```
54 changes: 54 additions & 0 deletions _api_docs/dlt_applied_transaction_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Applied Transaction List
type: dlt
---
## Applied Transaction List
Returns the list of applied transactions in the memory pool.
### Method: `txa`
### Input parameters:
| fromIndex | Number | No | Starting index (used for splitting the results into pages). |
| count | Number | No | Number of results to fetch. By itself, this parameter is useful for fetching only the recent history, but combined with `fromIndex` this parameters enables fetching results in pages. |


### Errors:

| Error | Description |
| --- | --- |
| RPC_INTERNAL_ERROR | An unknown error occured in the node. Please check the node log for details. |

### Output:
- success: applied transaction list JSON-encoded in the result field with the error field set to null
- fail: JSON encoded details with a non-null error and a null result

### Example:
GET http://localhost:8081/txa
```
{
"result": {
"125-Eau8yftyoMnt316Hb8YJvzc9jZvSLUwdq2UxhppWFpng": {
"id": "125-Eau8yftyoMnt316Hb8YJvzc9jZvSLUwdq2UxhppWFpng",
"version": 2,
"blockHeight": "125",
"nonce": "6178",
"signature": "0b8afc5d9e1..4eb9e9126b612ee730cb686f657434bbc55cc",
"pubKey": "1JKZFqQs4yiH6Dq4bfom7xcpL6zG53DrjcY6HD9QJ6cRWmXdq",
"timeStamp": "1548942726",
"type": "0",
"amount": "20000.00000000",
"applied":"126",
"checksum": "f1cf2631009697fd8724091391e5990a281724393fc37ab6d5091c49d63236fe",
"from": {
"1": "20000.00005000"
},
"to": {
"15iYQBgVhq4JeY3TUfNaMBNFkz27UCQWFjjay14C4b3EuHofG": "20000.00000000"
},
"fee": "0.00005000"
"totalAmount": "20000.00005000"
},
...
},
"error": null,
"id": null
}
```
28 changes: 28 additions & 0 deletions _api_docs/dlt_count_node_versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Count Node Versions
type: dlt
---
## Status
Returns the Ixian software versions in use on the network.
### Method: `countnodeversions`
### Input parameters:
None

### Errors:
None

### Output:
- node versions are returned as a JSON object and the error field is set to null:

### Example:
GET http://localhost:8081/countnodeversions
```
{
"result": {
"xdc-0.6.6-dev": 35,
"xdc-0.6.5-dev": 21
},
"error": null,
"id": null
}
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get Balance
type: core
type: dlt
---
## Get Balance
Returns balance of the specified address.
Expand Down
Loading

0 comments on commit 77d698c

Please sign in to comment.