Reputation: 614
When run solana-test-validator
it begins a new process with the following output:
Ledger location: test-ledger
Log: test-ledger/validator.log
Identity: 4876NsAf6yH8c7uPXybETZPit142i2QhR7tfSoTPYjHf
Genesis Hash: CrqeHuGVmgHL54Sri7dEm2aCRLFopJrTHoQBYe6ciF7N
Version: 1.8.17
Shred Version: 28931
Gossip Address: 127.0.0.1:1024
TPU Address: 127.0.0.1:1027
JSON RPC URL: http://127.0.0.1:8899
⠄ 01:44:22 | Processed Slot: 48335 | Confirmed Slot: 48335 | Finalized Slot: 483
I understand:
I've also read Solana cluster, validator, slot, epochs docs. It says
Slot: The period of time for which each leader ingests transactions and produces a block.
Could someone explain what happens when we run solana-test-validator
? In particular, does it produce blocks/ledger entries? From what it continuously displays
⠄ 01:44:22 | Processed Slot: 48335 | Confirmed Slot: 48335 | Finalized Slot: 483
it seems to be producing new blocks? If so, why do we need those ledger entries? After all nothing happens locally on my cluster (no transactions, not sol transfer....).
Upvotes: 1
Views: 2351
Reputation: 8098
To your first question the answer is Yes.
To your second question, the test-validator is a ledger node and as such, just like devnet/testnet/mainnet-beta, there is the temporal record (block) as you progress through time, whether there was something done or not.
When you start and run solana-test-validator
for the first time it will create a default ledger called test-ledger
in the directory where you started it from.
If you start the test validator again, in the same location, it will open the existing ledger. Over time the ledger may become quite large.
If you want to start with a clean ledger, you can either:
rm -rf test-ledger
or...solana-test-validator --reset
Upvotes: 5