References general file structure (methods)

This commit is contained in:
mDuo13
2018-05-03 15:28:40 -07:00
parent c072b2622c
commit 48391ba3d5
99 changed files with 297 additions and 324 deletions

View File

@@ -0,0 +1,96 @@
## connect
[[Source]<br>](https://github.com/ripple/rippled/blob/a61ffab3f9010d8accfaa98aa3cacc7d38e74121/src/ripple/rpc/handlers/Connect.cpp "Source")
The `connect` command forces the `rippled` server to connect to a specific peer `rippled` server.
*The `connect` request is an [admin command](#connecting-to-rippled) that cannot be run by unprivileged users!*
#### Request Format
An example of the request format:
<!-- MULTICODE_BLOCK_START -->
*WebSocket*
```
{
"command": "connect",
"ip": "192.170.145.88",
"port": 51235
}
```
*JSON-RPC*
```
{
"method": "connect",
"params": [
{
"ip": "192.170.145.88",
"port": 51235
}
]
}
```
*Commandline*
```
#Syntax: connect ip [port]
rippled connect 192.170.145.88 51235
```
<!-- MULTICODE_BLOCK_END -->
The request includes the following parameters:
| `Field` | Type | Description |
|:--------|:-------|:----------------------------------------------------------|
| `ip` | String | IP address of the server to connect to |
| `port` | Number | _(Optional)_ Port number to use when connecting. Defaults to 6561. |
#### Response Format
An example of a successful response:
<!-- MULTICODE_BLOCK_START -->
*JSON-RPC*
```
{
"result" : {
"message" : "connecting",
"status" : "success"
}
}
```
*Commandline*
```
Loading: "/etc/rippled.cfg"
Connecting to 127.0.0.1:5005
{
"result" : {
"message" : "connecting",
"status" : "success"
}
}
```
<!-- MULTICODE_BLOCK_END -->
The response follows the [standard format](#response-formatting), with a successful result containing the following fields:
| `Field` | Type | Description |
|:----------|:-------|:-------------------------------------------------------|
| `message` | String | The value `connecting`, if the command was successful. |
#### Possible Errors
* Any of the [universal error types](#universal-errors).
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
* Cannot connect in standalone mode - Network-related commands are disabled in stand-alone mode.

View File

@@ -0,0 +1,59 @@
## ledger_accept
[[Source]<br>](https://github.com/ripple/rippled/blob/a61ffab3f9010d8accfaa98aa3cacc7d38e74121/src/ripple/rpc/handlers/LedgerAccept.cpp "Source")
The `ledger_accept` method forces the server to close the current-working ledger and move to the next ledger number. This method is intended for testing purposes only, and is only available when the `rippled` server is running stand-alone mode.
*The `ledger_accept` method is an [admin command](#connecting-to-rippled) that cannot be run by unprivileged users!*
#### Request Format
An example of the request format:
<!-- MULTICODE_BLOCK_START -->
*WebSocket*
```
{
"id": "Accept my ledger!",
"command": "ledger_accept"
}
```
*Commandline*
```
#Syntax: ledger_accept
rippled ledger_accept
```
<!-- MULTICODE_BLOCK_END -->
The request accepts no parameters.
#### Response Format
An example of a successful response:
```js
{
"id": "Accept my ledger!",
"status": "success",
"type": "response",
"result": {
"ledger_current_index": 6643240
}
}
```
The response follows the [standard format](#response-formatting), with a successful result containing the following field:
| `Field` | Type | Description |
|:-----------------------|:-----------------|:---------------------------------|
| `ledger_current_index` | Unsigned Integer | Sequence number of the newly created 'current' ledger |
**Note:** When you close a ledger, `rippled` determines the canonical order of transactions in that ledger and replays them. This can change the outcome of transactions that were provisionally applied to the current ledger.
#### Possible Errors
* Any of the [universal error types](#universal-errors).
* `notStandAlone` - If the `rippled` server is not currently running in stand-alone mode.

View File

@@ -0,0 +1,83 @@
## stop
[[Source]<br>](https://github.com/ripple/rippled/blob/develop/src/ripple/rpc/handlers/Stop.cpp "Source")
Gracefully shuts down the server.
*The `stop` request is an [admin command](#connecting-to-rippled) that cannot be run by unprivileged users!*
#### Request Format
An example of the request format:
<!-- MULTICODE_BLOCK_START -->
*WebSocket*
```
{
"id": 0,
"command": "stop"
}
```
*JSON-RPC*
```
{
"method": "stop",
"params": [
{}
]
}
```
*Commandline*
```
rippled stop
```
<!-- MULTICODE_BLOCK_END -->
The request includes no parameters.
#### Response Format
An example of a successful response:
<!-- MULTICODE_BLOCK_START -->
*JSON-RPC*
```
{
"result" : {
"message" : "ripple server stopping",
"status" : "success"
}
}
```
*Commandline*
```
Loading: "/etc/rippled.cfg"
Connecting to 127.0.0.1:5005
{
"result" : {
"message" : "ripple server stopping",
"status" : "success"
}
}
```
<!-- MULTICODE_BLOCK_END -->
The response follows the [standard format](#response-formatting), with a successful result containing the following fields:
| `Field` | Type | Description |
|:----------|:-------|:-------------------------------------|
| `message` | String | `ripple server stopping` on success. |
#### Possible Errors
* Any of the [universal error types](#universal-errors).

View File

@@ -0,0 +1,86 @@
## validation_seed
[[Source]<br>](https://github.com/ripple/rippled/blob/a61ffab3f9010d8accfaa98aa3cacc7d38e74121/src/ripple/rpc/handlers/ValidationSeed.cpp "Source")
The `validation_seed` command temporarily sets the secret value that rippled uses to sign validations. This value resets based on the config file when you restart the server.
*The `validation_seed` request is an [admin command](#connecting-to-rippled) that cannot be run by unprivileged users!*
#### Request Format
An example of the request format:
<!-- MULTICODE_BLOCK_START -->
*WebSocket*
```
{
"id": "set_seed_1",
"command": "validation_seed",
"secret": "BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE"
}
```
*Commandline*
```
#Syntax: validation_seed [secret]
rippled validation_seed 'BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE'
```
<!-- MULTICODE_BLOCK_END -->
The request includes the following parameters:
| `Field` | Type | Description |
|:---------|:-------|:---------------------------------------------------------|
| `secret` | String | _(Optional)_ If present, use this value as the secret value for the validating key pair. Valid formats include [base58][], [RFC-1751](https://tools.ietf.org/html/rfc1751), or as a passphrase. If omitted, disables proposing validations to the network. |
#### Response Format
An example of a successful response:
<!-- MULTICODE_BLOCK_START -->
*JSON-RPC*
```
200 OK
{
"result" : {
"status" : "success",
"validation_key" : "BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE",
"validation_public_key" : "n9Jx6RS6zSgqsgnuWJifNA9EqgjTKAywqYNReK5NRd1yLBbfC3ng",
"validation_seed" : "snjJkyBGogTem5dFGbcRaThKq2Rt3"
}
}
```
*Commandline*
```
Loading: "/etc/rippled.cfg"
Connecting to 127.0.0.1:5005
{
"result" : {
"status" : "success",
"validation_key" : "BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE",
"validation_public_key" : "n9Jx6RS6zSgqsgnuWJifNA9EqgjTKAywqYNReK5NRd1yLBbfC3ng",
"validation_seed" : "snjJkyBGogTem5dFGbcRaThKq2Rt3"
}
}
```
<!-- MULTICODE_BLOCK_END -->
The response follows the [standard format](#response-formatting), with a successful result containing the following fields:
| `Field` | Type | Description |
|:------------------------|:-------|:------------------------------------------|
| `validation_key` | String | (Omitted if proposing disabled) The secret key for these validation credentials, in [RFC-1751](https://tools.ietf.org/html/rfc1751) format. |
| `validation_public_key` | String | (Omitted if proposing disabled) The public key for these validation credentials, in Ripple's [base58][] encoded string format. |
| `validation_seed` | String | (Omitted if proposing disabled) The secret key for these validation credentials, in Ripple's [base58][] encoded string format. |
#### Possible Errors
* Any of the [universal error types](#universal-errors).
* `badSeed` - The request provided an invalid secret value. This usually means that the secret value appears to be a valid string of a different format, such as an account address or validation public key.