From e9566e28b3698bc21b1a4a0257be6b724937cfa4 Mon Sep 17 00:00:00 2001 From: Mark Travis Date: Sat, 24 Jan 2015 22:09:03 -0800 Subject: [PATCH] Document can_delete method to rippled. --- content/rippled.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/content/rippled.md b/content/rippled.md index 18901ad2e7..84ec6fa121 100644 --- a/content/rippled.md +++ b/content/rippled.md @@ -465,6 +465,7 @@ The `wallet_accounts` command is deprecated and may be removed without further n Additionally, this page contains an explanation of the following important admin-only command: +* [`can_delete` - Allow online deletion of ledgers up to a specific ledger.](#can-delete) * [`wallet_propose` - Generate keys for a new account](#wallet-propose) For information about other Admin Commands, consult [the old wiki documentation](https://ripple.com/wiki/JSON_Messages). @@ -1698,6 +1699,70 @@ this is the part where we plug our ears and don't acknowledge that you can provi * `noGenDecrypt` --> +## can_delete ## +[[Source]
](https://github.com/ripple/rippled/blob/develop/src/ripple/rpc/handlers/CanDelete.cpp "Source") + +With `online_delete` and `advisory_delete` configuration options enabled, +the `can_delete` method informs the rippled server of the latest ledger +which may be deleted. + +#### Request Format #### + +An example of the request format: + +
+*WebSocket* +``` +{ + "id": 2, + "command": "can_delete", + "can_delete": 11320417 +} +``` + +*JSON-RPC* +``` +{ + "method": "can_delete", + "params": [ + { + "can_delete": 11320417 + } + ] +} +``` + +*Commandline* +``` +#Syntax can_delete [||now|always|never] +rippled -- can_delete 11320417 +``` +
+ +The request includes the following optional parameter: + +| Field | Type | Description | +|-------|------|-------------| +| can_delete | String or Integer | The maximum ledger to allow to be deleted. For `ledger_index` or `ledger_hash`, see [Specifying a Ledger](#specifying-a-ledger-instance). `never` sets the value to 0, and effectively disables online deletion until another `can_delete` is appropriately called. `always` sets the value to the maximum possible ledger (4294967295), and online deletion will occur as of each configured `online_delete` interval. `now` triggers online deletion at the next validated ledger that meets or exceeds the configured `online_delete` interval, but no further. | + +If no parameter is specified, no change is made. + +The response follows the [standard format](#response-formatting), with +a successful result containing the following fields: + +| Field | Type | Description | +|-------|------|-------------| +| can_delete | Integer | The maximum ledger index that may be removed by the online deletion routine. | + +Use this command with no parameter to query the existing `can_delete` setting. + +#### Possible Errors #### + +* Any of the [universal error types](#universal-errors). +* `notEnabled` - Not enabled in configuration. +* `notReady` - Not ready to handle this request. +* `lgrNotFound` - Ledger not found. +* `invalidParams` - Invalid parameters. ## wallet_propose ## [[Source]
](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/WalletPropose.cpp "Source")