stellar-core can be controlled via the following commands.
Common options can be placed at any place in the command line.
http-command ll
but we need this form if you want to change the log level during test runs.Command options can only by placed after command.
$ stellar-core convert-id SDQVDISRYN2JXBS7ICL7QJAEKB3HWBJFP2QECXG7GZICAHBK4UNJCWK2
$ stellar-core http-command info
.well-known/stellar-history.json
file in the archive root.--c info
for an offline
instancebase64
). The private signing key is read from standard input,
unless /dev/tty
. In either event,
if the signing key appears to be coming from a terminal, stellar-core
disables echo. Note that if you do not have a STELLAR_NETWORK_ID environment
variable, then before this argument you must specify the --netid option. For
example, the production stellar network is “Public Global Stellar Network ; September 2015
” while the test network is “Test SDF Network ; September 2015
”.--all-versions
: run with all possible protocol versions--version <N>
: run tests for protocol version N, can be specified
multiple times (default latest)--base-instance <N>
: run tests with instance numbers offset by N,
used to run tests in parallel[tx]
using protocol
versions 9 and 10 and stop after the first failure:
stellar-core --test -a --version 9 --version 10 "[tx]"
By default stellar-core listens for connections from localhost on port 11626. You can send commands to stellar-core via a web browser, curl, or using the --c command line option (see above). Most commands return their results in JSON format.
help Prints a list of currently supported commands.
catchup
/catchup?ledger=NNN[&mode=MODE]
Triggers the instance to catch up to ledger NNN from history;
Mode is either ‘minimal’ (the default, if omitted) or ‘complete’.
checkdb Triggers the instance to perform a background check of the database’s state.
checkpoint Triggers the instance to write an immediate history checkpoint. And uploads it to the archive.
connect
/connect?peer=NAME&port=NNN
Triggers the instance to connect to peer NAME at port NNN.
dropcursor
/dropcursor?id=XYZ
deletes the tracking cursor with identified by id
. See setcursor
for
more information.
info Returns information about the server in JSON format (sync state, connected peers, etc).
ll
/ll?level=L[&partition=P]
Adjust the log level for partition P where P is one of Bucket, Database, Fs,
Herder, History, Ledger, Overlay, Process, SCP, Tx (or all if no partition is
specified). Level is one of FATAL, ERROR, WARNING, INFO, DEBUG, VERBOSE,
TRACE.
maintenance
/maintenance?[queue=true]
Performs maintenance tasks on the instance.
queue
performs deletion of queue data. See setcursor
for more information.metrics Returns a snapshot of the metrics registry (for monitoring and debugging purpose).
clearmetrics
/clearmetrics?[domain=DOMAIN]
Clear metrics for a specified domain. If no domain specified, clear all
metrics (for testing purposes).
peers Returns the list of known peers in JSON format.
quorum
/quorum?[node=NODE_ID][&compact=true]
returns information about the quorum for node NODE_ID (this node by default).
NODE_ID is either a full key (GABCD...
), an alias ($name
) or an
abbreviated ID (@GABCD
). If compact is set, only returns a summary version.
setcursor
/setcursor?id=ID&cursor=N
sets or creates a cursor identified by ID
with value N
. ID is an
uppercase AlphaNum, N is an uint32 that represents the last ledger sequence
number that the instance ID processed. Cursors are used by dependent services
to tell stellar-core which data can be safely deleted by the instance. The
data is historical data stored in the SQL tables such as txhistory or
ledgerheaders. When all consumers processed the data for ledger sequence N
the data can be safely removed by the instance. The actual deletion is
performed by invoking the maintenance
endpoint or on startup. See also
dropcursor
.
getcursor
/getcursor?[id=ID]
gets the cursor identified by ID
. If ID is not defined then all cursors
will be returned.
scp
/scp?[limit=n]
Returns a JSON object with the internal state of the SCP engine for the last
n (default 2) ledgers.
tx
/tx?blob=Base64
submit a transaction to the network.
blob is a base64 encoded XDR serialized ‘TransactionEnvelope’, and it
returns a JSON object with the following properties
status:
upgrades
/upgrades?mode=get
/upgrades?mode=clear
/upgrades?mode=set&upgradetime=DATETIME&[basefee=NUM]&[basereserve=NUM]&[maxtxsize=NUM]&[protocolversion=NUM]
1970-01-01T00:00:00Z
.
It is the time the upgrade will be scheduled for. If it is in the past,
the upgrade will occur immediately.generateload
/generateload[?mode=(create|pay)&accounts=N&offset=K&txs=M&txrate=(R|auto)&batchsize=L]
Artificially generate load for testing; must be used with
ARTIFICIALLY_GENERATE_LOAD_FOR_TESTING
set to true. Depending on the mode,
either creates new accounts or generates payments on accounts specified
(where number of accounts can be offset). Additionally, allows batching up to
100 account creations per transaction via ‘batchsize’.
manualclose If MANUAL_CLOSE is set to true in the .cfg file. This will cause the current ledger to close.
testacc
/testacc?name=N
Returns basic information about the account identified by name. Note that N
is a string used as seed, but “root” can be used as well to specify the root
account used for the test instance.
testtx
/testtx?from=F&to=T&amount=N&[create=true]
Injects a payment transaction (or a create transaction if “create” is
specified) from the account F to the account T, sending N XLM to the account.
Note that F and T are seed strings but can also be specified as “root” as
shorthand for the root account for the test instance.