Debug

From ArdorDocs
Jump to: navigation, search

All debug utilities require an adminPassword request parameter. See Admin Password for more info.


Clear Unconfirmed Transactions

Empties the unconfirmed transaction pool. POST only. Javadoc

Request:

  • requestType is clearUnconfirmedTransactions

Response:

  • done (B) is true if the operation completed successfully
  • requestProcessingTime (N) is the API request processing time (in millisec)

Clear Unconfirmed Transactions Example

http://localhost:27876/nxt?
  requestType=clearUnconfirmedTransactions
{
 "requestProcessingTime": 814,
 "done": true
}


Dump Peers

Get all active peers, optionally of a certain version or a minimum weight. Javadoc

Request:

  • requestType is dumpPeers
  • version is a version filter such as 1.5.11 (optional)
  • weight is a minimum weight filter such as 1000 (optional)
  • connect is true to force a connection attempt to each known peer first (optional); password protected like the Debug Operations if true

Response:

  • peers (S) is a string of peer IP addresses or DNS names, separated by semicolons
  • count (N) is the number of peers in the peers string.
  • requestProcessingTime (N) is the API request processing time (in millisec)

Dump Peers Example

http://localhost:27876/nxt?
  requestType=dumpPeers&
  version=2.0.14&
  connect=true
{
 "peers": "198.105.122.160; 174.140.167.239; ...",
 "count": 37,
 "requestProcessingTime": 176897
}


Full Reset

Deletes the entire blockchain. POST only. Javadoc

Request:

  • requestType is fullReset

Response:

  • done (B) is true if the operation completed successfully
  • requestProcessingTime (N) is the API request processing time (in millisec)

Note: After successful completion of the reset, a new blockchain will automatically begin downloading.

Full Reset Example

http://localhost:27876/nxt?
  requestType=fullReset
{
 "requestProcessingTime": 4378,
 "done": true
}


Get All Broadcasted Transactions

Get unconfirmed transactions broadcasted from this node but not yet received back from a peer, if transaction rebroadcasting is enabled. Javadoc

Request:

  • requestType is getAllBroadcastedTransactions
  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • transactions (A) is an array of broadcasted unconfirmed transactions not yet received back from a peer (S)
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get All Broadcasted Transactions Example

http://localhost:27876/nxt?
  requestType=GetAllBroadcastedTransactions
{
 "requestProcessingTime": 1,
 "transactions": []
}


Get All Waiting Transactions

Get unconfirmed transactions temporarily kept in memory during transaction processing. Javadoc

Request:

  • requestType is getAllWaitingTransactions
  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • transactions (A) is an array of unconfirmed transactions temporarily kept in memory (S)
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get All Waiting Transactions Example

http://localhost:27876/nxt?
  requestType=getAllWaitingTransactions
{
 "requestProcessingTime": 1,
 "transactions": []
}


Get Log

Get up to 100 of the most recent log messages from a memory buffer. Javadoc

Request:

  • requestType is getLog
  • count is the number of messages to return (optional, default 100)

Response:

  • messages (A) is an array of log messages (S)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Log Example

http://localhost:27876/nxt?
  requestType=getLog&
  count=3
{
 "messages": [
  "2015-04-28 18:26:52 FINE: Known peers: 29\n",
  "2015-04-28 18:27:12 FINE: Got 0 confirmations\n",
  "2015-04-28 18:27:12 FINE: Downloaded 230 blocks\n"
 ],
 "requestProcessingTime": 0
}


Get Stack Traces

Get the stack traces of the currently running threads in reverse id order. Javadoc

Request:

  • requestType is getStackTraces
  • depth is the maximum trace depth to retrieve (optional)

Response:

  • requestProcessingTime (N) is the API request processing time (in millisec)
  • locks (A) is an array of lock objects
  • threads (A) is an array of thread objects with the following fields:
    • trace (A) is an array of traces (S)
    • name (S) is the thread name
    • id (N) is the thread ID
    • state (S) is the thread state, one of WAITING, TIMED_WAITING and RUNNABLE
    • locks (A) is an array of lock objects with the following fields, if not empty:
      • trace (S)
      • depth (N)
      • name (S)
      • hash (N)

Get Stack Traces Example

http://localhost:27876/nxt?
  requestType=getStackTrace
{
 "threads": [
  
  {
   "trace": [
    "java.lang.Object.wait(Native Method)",
    "java.lang.Object.wait(Object.java:502)",
    "java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)"
   ],
   "name": "Reference Handler",
   "id": 2,
   "state": "WAITING"
  }
 ],
 "requestProcessingTime": 5,
 "locks": []
}


Lucene Reindex

Forces a rebuild of the Lucene search index. POST only. Javadoc

Request:

  • requestType is luceneReindex

Response:

  • done (B) is true if the operation completed successfully
  • requestProcessingTime (N) is the API request processing time (in millisec)

Lucene Reindex Example

http://localhost:27876/nxt?
  requestType=luceneReindex
{
 "requestProcessingTime": 4480,
 "done": true
}


Pop Off

Removes specified number of blocks (and associated transactions) from the top of the blockchain. POST only. Javadoc

Request:

  • requestType is popOff
  • numBlocks is the number of blocks to pop off the blockchain (optional)
  • height is the new height of the blockchain after popping (optional if numBlocks provided)

Note: If table trimming is enabled (default), at most 1440 blocks can be popped off without triggering a full rescan.

Response:

  • blocks (A) is an array of the blocks popped off (refer to Get Block for details)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Pop Off Example

http://localhost:27876/nxt?
  requestType=popOff&
  numBlocks=1
{
 "blocks": [
  {
   "previousBlockHash": "5dd57ec106d9ba4cb1442017586b9df23c2c31ec5f1cb46fd3206015a96fd057",
   "payloadLength": 0,
   "totalAmountNQT": "0",
   "generationSignature": "e23740a05b65aa01a890a9ba1c9766183a328455b6e347add727a823e151db99",
   "generator": "16120433118765388429",
   "generatorPublicKey": "f35600023d42e79cbf0518a174141bce1decb13332e397553c3f62df7261414a",
   "baseTarget": "268653798",
   "payloadHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
   "generatorRS": "ARDOR-A6NF-JE4R-XB6L-FAUFZ",
   "nextBlock": "12812496435932308379",
   "numberOfTransactions": 0,
   "blockSignature": "d9aba136c708e4f84b7ae1cf0415b25a75f9eefc8a47b1963b237ada9982a...",
   "transactions": [],
   "version": 3,
   "totalFeeNQT": "0",
   "previousBlock": "5528970115590051165",
   "block": "8125766982300698657",
   "height": 212194,
   "timestamp": 23052841
  }
 ],
 "requestProcessingTime": 109
}


Rebroadcast Unconfirmed Transactions

Rebroadcast transactions in the unconfirmed pool to peers, until received back or found in the blockchain. Rebroadcasting can be disabled by setting the nxt.enableTransactionRebroadcasting property to false. POST only. Javadoc

Request:

  • requestType is rebroadcastUnconfirmedTransactions

Response:

  • done (B) is true if the operation completed successfully
  • requestProcessingTime (N) is the API request processing time (in millisec)

Rebroadcast Unconfirmed Transactions Example

http://localhost:27876/nxt?
  requestType=rebroadcastUnconfirmedTransactions
{
 "requestProcessingTime": 2,
 "done": true
}


Requeue Unconfirmed Transactions

Requeue unconfirmed transactions. POST only. Javadoc

Request:

  • requestType is requeueUnconfirmedTransactions

Response:

  • done (B) is true if the operation completed successfully
  • requestProcessingTime (N) is the API request processing time (in millisec)

Requeue Unconfirmed Transactions Example

http://localhost:27876/nxt?
  requestType=requeueUnconfirmedTransactions
{
 "requestProcessingTime": 1,
 "done": true
}


Retrieve Pruned Data

Initiates a task of requesting and restoring missing prunable data. POST only. Javadoc

Request:

  • requestType is retrievePrunedData

Response:

  • done (B) is true if the operation completed successfully
  • numberOfPrunedData (N) is the number of pruned data available pruned data transactions
  • requestProcessingTime (N) is the API request processing time (in millisec)

Retrieve Pruned Data Example

http://localhost:27876/nxt?
  requestType=retrievePrunedData
{
  "numberOfPrunedData": 0,
  "requestProcessingTime": 4604,
  "done": true
}


Scan

Scans the top of the blockchain. POST only. Javadoc

Request:

  • requestType is scan
  • numBlocks is the number of blocks to scan at the top of the blockchain (optional)
  • height is the height above which blockchain is to be scanned (optional if numBlocks provided)
  • validate is true if signatures are to be re-verified and blocks and transactions re-validated (optional)

Note: The derived object tables are rolled back and rebuilt by rescanning the existing blockchain. A request to rescan more than 1440 blocks when table trimming is enabled will do a full rescan starting from height 0. Rescan status is saved in the database, so that if a rescan is interrupted or fails it will resume on restart.

Response:

  • scanTime (N) is the scan time
  • done (B) is true if the operation completed successfully
  • requestProcessingTime (N) is the API request processing time (in millisec)

Scan Example

http://localhost:27876/nxt?
  requestType=scan
{
 "scanTime": 8,
 "requestProcessingTime": 8445,
 "done": true
}


Set Logging

Sets the log level and optionally specifies communication events to be logged, without restarting the server. POST only. Javadoc

Request:

  • requestType is setLogging
  • logLevel is one of ERROR, WARN, INFO or DEBUG with each level in the list including all of the previous levels (optional, default is INFO)
  • communicationEvent is one of multiple communication (HTTP) events to be logged, from the list: EXCEPTION, HTTP-ERROR, HTTP-OK (optional)
  • communicationEvent is one of multiple communication events (optional)

Note: The initial log level is set by the nxt.level logging property, currently FINE (equivalent to DEBUG).

Response:

  • loggingUpdated (B) is true if the operation completed successfully

Set Logging Example

http://localhost:27876/nxt?
  requestType=setLogging
{
 "loggingUpdated": true
}


Shutdown

Shutdown the server. POST only. Javadoc

Request:

  • requestType is shutdown
  • scan is true to truncate the derived tables and schedule a full rescan with validation on the next start (optional)

Response:

  • shutdown (B) is true if the operation completed successfully
  • requestProcessingTime (N) is the API request processing time (in millisec)

Shutdown Example

http://localhost:27876/nxt?
  requestType=shutdown
{
 "requestProcessingTime": 2,
 "shutdown": true
}


Trim Derived Tables

Trigger a derived tables trim, and a prunable tables pruning. POST only. Javadoc

Request:

  • requestType is trimDerivedTables

Response:

  • done (B) is true if the operation completed successfully
  • requestProcessingTime (N) is the API request processing time (in millisec)

Trim Derived Tables Example

http://localhost:27876/nxt?
  requestType=trimDerivedTables
{
 "requestProcessingTime": 394,
 "done": true
}