Simulator CLI Reference
Intro
The simulator gives you complete control of a private Chia blockchain, including the ability to advance and revert blocks as needed.
This page includes a comprehensive list of Chia's Command Line Interface commands for using the simulator.
For more info, see the following:
Reference
create
Functionality: Set up a Chia Simulator
Usage: chia dev sim create [OPTIONS]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-f | --fingerprint | INTEGER | False | Use your fingerprint to skip the key prompt |
-r | --reward_address | TEXT | False | Use this address instead of the default farming address |
-p | --plot-directory | TEXT | False | Set the directory in which to create/store plots (Default: 'simulator/plots') |
-m | --mnemonic | TEXT | False | Add a new key to the keychain using the specified mnemonic |
-a | --auto-farm | BOOLEAN | False | Enable or Disable auto farming (Default: True) |
-h | --help | None | False | Show a help message and exit |
Example 1
Use all default values, with no keys present on the local machine.
In this case, a new key will be created, along with several k-19 plots. Finally, the simulator will be started and the genesis block will be farmed:
chia dev sim create
Response:
Using this Directory: /home/user/.chia/simulator/main
No keys in keychain. Press 'q' to quit, or press any other key to generate a new key.
Generating private key
Added private key with public key fingerprint 3045631419
Creating chia directory & config...
CHIA_ROOT is set to /home/user/.chia/simulator/main
Chia directory /home/user/.chia/simulator/main
Setting Testnet
Default full node port, introducer and network setting updated
Restart any running chia services for changes to take effect
Can't find private CA, creating a new one in /home/user/.chia/simulator/main to generate TLS certificates
SSL file permissions are correct
Setting the xch destination for the farmer reward (1/8 plus fees, solo and pooling) to txch1y8efcgt9fthxzghw0xcdvru6rnvfpp4ywg0pruuztse0zweh98ws0z7j0q
Setting the xch destination address for pool reward (7/8 for solo only) to txch1y8efcgt9fthxzghw0xcdvru6rnvfpp4ywg0pruuztse0zweh98ws0z7j0q
To change the XCH destination addresses, edit the `xch_target_address` entries in /home/user/.chia/simulator/main/config/config.yaml.
To see your keys, run 'chia keys show --show-mnemonic-seed'
Please Wait, Generating plots...
This may take up to a minute if you are on a slow machine
Starting plotting progress into temporary dirs: /home/user/.chia/simulator/plots/tmp and /home/user/.chia/simulator/plots/tmp
ID: 11ab61868e8e25cab4db09d10813da8a02b23408683aea8e71afd907316a8509
Plot size is: 19
Buffer size is: 100MiB
Using 16 buckets
Final Directory is: /home/user/.chia/simulator/plots
Using 2 threads of stripe size 2000
Process ID is: 15337
Starting phase 1/4: Forward Propagation into tmp files... Tue Sep 27 21:50:39 2022
Computing table 1
Progress update: 0.01
F1 complete, time: 0.039 seconds. CPU (27.96%) Tue Sep 27 21:50:40 2022
Computing table 2
Progress update: 0.06
Bucket 0 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 1 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 2 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 3 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 4 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 5 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 6 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 7 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 8 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 9 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 10 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 11 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 12 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 13 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 14 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 15 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Total matches: 524787
Forward propagation table time: 0.381 seconds. CPU (88.320%) Tue Sep 27 21:50:40 2022
Computing table 3
...
...
Starting phase 4/4: Write Checkpoint tables into "/home/user/.chia/simulator/plots/tmp/plot-k19-01b3db7aa435879c6cdb8aa3b1602121ba60326e4809e0f8989cd481257290dd.plot.2.tmp" ... Tue Sep 27 21:50:53 2022
Starting to write C1 and C3 tables
Bucket 0 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 1 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 2 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 3 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 4 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 5 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 6 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 7 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 8 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 9 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 10 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 11 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 12 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 13 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 14 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Bucket 15 QS. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB. force_qs: 1
Finished writing C1 and C3 tables
Writing C2 table
Finished writing C2 table
Final table pointers:
P1: 0x10c
P2: 0x114ef8
P3: 0x20eedf
P4: 0x30a249
P5: 0x40903c
P6: 0x512dca
P7: 0x642835
C1: 0x779c35
C2: 0x779cd1
C3: 0x779cd7
Time for phase 4 = 0.133 seconds. CPU (65.200%) Tue Sep 27 21:50:53 2022
Approximate working space used (without final file): 0.019 GiB
Final File size: 0.008 GiB
Total time = 3.910 seconds. CPU (81.260%) Tue Sep 27 21:50:53 2022
Renamed final file from "/home/user/.chia/simulator/plots/tmp/plot-k19-01b3db7aa435879c6cdb8aa3b1602121ba60326e4809e0f8989cd481257290dd.plot.2.tmp" to "/home/user/.chia/simulator/plots/plot-k19-01b3db7aa435879c6cdb8aa3b1602121ba60326e4809e0f8989cd481257290dd.plot"
New plots generated.
Farming & Prefarm reward address: txch1qm90eg9rx92dytr86fc4xqrjkpxxhfz59zxry24f7244u5ptlans0au950
Configuration Wizard Complete.
Starting Simulator now...
Daemon not started yet
Starting daemon
chia_full_node_simulator: started
Please wait, generating genesis block.
Farmed 1 Transaction blocks
Block Height is now: 1
Genesis block generated, exiting.
Example 2
Use all default values, with a key and plots already generated:
chia dev sim create
Response:
Using this Directory: /home/user/.chia/simulator/main
Fingerprints:
If you already used one of these keys, select that fingerprint to skip the plotting process. Otherwise, select any key below.
1) 3045631419
Choose a simulator key [1-1] ('q' to quit, or 'g' to generate a new key): 1
Creating chia directory & config...
Please Wait, Generating plots...
This may take up to a minute if you are on a slow machine
Using Existing Plots
Farming & Prefarm reward address: txch1qm90eg9rx92dytr86fc4xqrjkpxxhfz59zxry24f7244u5ptlans0au950
Configuration Wizard Complete.
Starting Simulator now...
Daemon not started yet
Starting daemon
chia_full_node_simulator: started
Please wait, generating genesis block.
Genesis block already exists, exiting.
Example 3
Add a mnemonic seed for a key that does not yet exist on this machine.
In this case, the key will be added and plots will be generated:
chia dev sim create --mnemonic "use scrap doll sugar october repair color owner know click awkward tragic skate bleak great jeans clean marriage wheat concert pudding sketch horse quick"
Response:
Using this Directory: /home/user/.chia/simulator/main
Added private key with public key fingerprint 3505952827
Creating chia directory & config...
Please Wait, Generating plots...
This may take up to a minute if you are on a slow machine
Starting plotting progress into temporary dirs: /home/user/.chia/simulator/plots/tmp and /home/user/.chia/simulator/plots/tmp
ID: e66ecd90151b7e20a2b9a347b794bee638976816282a4eabe85170730b755821
Plot size is: 19
Buffer size is: 100MiB
Using 16 buckets
Final Directory is: /home/user/.chia/simulator/plots
Using 2 threads of stripe size 2000
Process ID is: 15978
Starting phase 1/4: Forward Propagation into tmp files... Tue Sep 27 22:14:15 2022
Computing table 1
Progress update: 0.01
F1 complete, time: 0.014 seconds. CPU (93.63%) Tue Sep 27 22:14:15 2022
Computing table 2
Progress update: 0.06
Bucket 0 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 1 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 2 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 3 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 4 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 5 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 6 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 7 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 8 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 9 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 10 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 11 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 12 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 13 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Bucket 14 uniform sort. Ram: 0.088GiB, u_sort min: 0.001GiB, qs min: 0.000GiB.
Bucket 15 uniform sort. Ram: 0.088GiB, u_sort min: 0.000GiB, qs min: 0.000GiB.
Total matches: 523642
Forward propagation table time: 0.337 seconds. CPU (88.970%) Tue Sep 27 22:14:15 2022
Computing table 3
...
...
Time for phase 4 = 0.144 seconds. CPU (61.970%) Tue Sep 27 22:14:28 2022
Approximate working space used (without final file): 0.019 GiB
Final File size: 0.008 GiB
Total time = 4.825 seconds. CPU (70.780%) Tue Sep 27 22:14:28 2022
Renamed final file from "/home/user/.chia/simulator/plots/tmp/plot-k19-545dc9d108ac447c16d2f6b803b2f7f9bbd7288cc04c0920a32b8c528238ae01.plot.2.tmp" to "/home/user/.chia/simulator/plots/plot-k19-545dc9d108ac447c16d2f6b803b2f7f9bbd7288cc04c0920a32b8c528238ae01.plot"
Plot /home/user/.chia/simulator/plots/plot-k19-01b3db7aa435879c6cdb8aa3b1602121ba60326e4809e0f8989cd481257290dd.plot has a farmer public key that is not in the farmer's pk list.
Plot /home/user/.chia/simulator/plots/plot-k19-088e54328bbb7cab3132fab4b7fe1fd8b1903d132a219ab9a8b1411bd518fa41.plot has a farmer public key that is not in the farmer's pk list.
Plot /home/user/.chia/simulator/plots/plot-k19-11ab61868e8e25cab4db09d10813da8a02b23408683aea8e71afd907316a8509.plot has a farmer public key that is not in the farmer's pk list.
New plots generated.
Farming & Prefarm reward address: txch1r6ryxsyj8s956fn5hy4lsk3v8g8jt54ghulf47ga6u66rh3utezqnsny7t
Configuration Wizard Complete.
Starting Simulator now...
Daemon not started yet
Starting daemon
chia_full_node_simulator: started
Please wait, generating genesis block.
Farmed 1 Transaction blocks
Block Height is now: 1
Genesis block generated, exiting.
autofarm
Functionality: Enable or disable auto farming on transaction submission
Usage: chia dev sim autofarm [OPTIONS] [on|off]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-h | --help | None | False | Show a help message and exit |
Auto farming is enabled by default. The examples will show you how to disable/enable it.
Example 1
Disable auto farming:
chia dev sim autofarm off
Response:
Auto farming is now off
Example 2
Enable auto farming:
chia dev sim autofarm on