Skip to Content
ChainsLitecoin

Litecoin

wharfnet up boots a litecoind chain by default (litecoin-1 on :19443), alongside the other default chains — one command, one manifest, one status. It runs Litecoin Core v0.21 (the uphold/litecoin-core:0.21 image) in regtest: a standalone network where blocks are produced on demand rather than on a fixed schedule, so the chain is instant and fully deterministic. To run without it, write a wharfnet.toml that omits the Litecoin chain (a config replaces the defaults).

Litecoin Core is a Bitcoin Core 0.21 fork, so the JSON-RPC surface wharfnet drives is identical to Bitcoin’s — everything below is the same workflow, on LTC and Litecoin’s ports.

wharfnet up --bare # JSON-RPC on :19443 — litecoind always requires auth; the dev creds are wharfnet:wharfnet curl -s --user wharfnet:wharfnet -X POST http://127.0.0.1:19443 \ -d '{"jsonrpc":"1.0","id":1,"method":"getblockchaininfo","params":[]}' # -> {"chain":"regtest",...}

Writing Rust tests? Read the endpoints and the funded account from a running localnet with wharfnet::testkit: net.litecoin().rpc_url() (the URL already embeds the dev creds) and .account(0) (the boot wallet address) — or select by name with net.chain("litecoin-1")?. There are no test tokens, so token/token_abi don’t apply — spend over RPC with any Bitcoin-compatible client pointed at the Litecoin node.

The RPC is served at http://wharfnet:wharfnet@127.0.0.1:19443 — litecoind answers even getblockchaininfo only with credentials, so the dev user/password (wharfnet:wharfnet) are baked into the daemon flags and embedded in the manifest URL. Readiness is checked against an authed getblockchaininfo.

Funded boot wallet

Regtest starts with an empty chain and no spendable coins, so on first boot wharfnet creates a node wallet named wharfnet and mines 101 blocks to a fresh address in it. Coinbase maturity in regtest is 100 blocks, so 101 blocks leaves exactly one mature coinbase — 50 LTC — spendable immediately. That address and balance are recorded in the manifest as the chain’s funded account (the UTXO analogue of Anvil’s pre-funded keys).

The key never leaves the node. Regtest descriptor wallets don’t export private keys, so the manifest records the account as “(spendable via node wallet ‘wharfnet’)” rather than a raw secret — the faucet and chain control spend through the node’s own wallet.

Test tokens

Litecoin has no test tokens — the UTXO model has no smart-contract token standard, so wharfnet funds only the native coin (LTC). There are no baked token addresses, infra contracts, or ABIs to load; the chain boots with just the funded coinbase described above.

Faucet

The unified faucet command works on Litecoin chains too:

# native LTC, on every Litecoin chain wharfnet faucet litecoin rltc1q…xyz 5 # a specific chain, native coin named explicitly wharfnet faucet litecoin-1 rltc1q…xyz 2.5 --token LTC # exact base units (litoshis) instead of decimal coins wharfnet faucet litecoin-1 rltc1q…xyz 150000000 --raw

Funding runs sendtoaddress from the boot wallet, then mines one block to confirm the payment. Amounts are decimal coins (8 decimals) or exact base units with --raw. --token may be LTC or omitted — there are no other tokens, so any other value errors. Funding is additive: each top-up adds another confirmed UTXO to the address.

Chain control

Regtest produces blocks only on demand, so mine is the whole control surface — there’s no time-travel, snapshot/revert, or impersonation (those are EVM/Starknet features that litecoind has no equivalent for). The verb lives under wharfnet litecoin and takes a --chain selector (litecoin for every Litecoin chain, or a name like litecoin-1; defaults to litecoin):

wharfnet litecoin mine 6 # mine 6 blocks to the boot wallet, e.g. to confirm txs

mine calls generatetoaddress against the boot wallet, so the block rewards accrue to the funded account, advancing confirmations and maturing additional coinbase to spend.

Forking

Forking is not supported for UTXO chains. litecoind regtest has no fork-a-live-network mode, so setting fork_url (or fork_block) on a kind = "litecoin" chain is rejected on load. Use a fresh regtest chain and fund what you need with the faucet.

Block explorer

Each Litecoin chain serves a bundled ltc-rpc-explorer — a maintained Litecoin fork of the btc-rpc-explorer that backs the Bitcoin chain (the upstream image is Bitcoin-only), giving BTC/LTC explorer parity. Like its Bitcoin counterpart it makes its RPC calls server-side, reaching litecoind over the docker network via the chain’s service name and internal RPC port. wharfnet publishes its UI on a host port assigned from 5100 upward, so in the default topology it lands on :5103; the exact URL is recorded in the manifest and printed by status:

ChainRPCExplorer
litecoin-1http://127.0.0.1:19443http://127.0.0.1:5103

Pass --bare to skip it.

The techtoshi/ltc-rpc-explorer image is published for amd64 only (and pinned by digest, since it only carries a rolling latest tag). wharfnet runs it under linux/amd64, so on Apple Silicon and other arm64 hosts it runs emulated — it works, but boots slower. Use --bare to skip it if you don’t need the UI.

Persistence

Litecoin chains persist across up --resume / up --reset like the other chains. The entire litecoind datadir is the session — wallet, chainstate, and blocks — mounted per chain under .wharfnet/state/. --resume keeps it (boot is idempotent: it loads the existing wallet instead of recreating it and mines only the shortfall back to 101 blocks), and --reset wipes it for a clean chain. See Resuming a session for the shared model.

Last updated on