TITLE: Executing CKB Simulator with Data Files (Bash) DESCRIPTION: These bash commands demonstrate how to run compiled CKB-VM executables using the simulator. Each command invokes a specific compiled script (e.g., `sighash_all`, `sudt`) and passes a prepared JSON data file (e.g., `data.json`, `sudt_data.json`) as the first argument. This allows developers to test different CKB scripts with various transaction contexts. SOURCE: https://github.com/nervosnetwork/ckb-c-stdlib/blob/master/simulator/README.md#_snippet_1 LANGUAGE: bash CODE: ``` ../build.simulator/sighash_all data.json ../build.simulator/sighash_all data2.json ../build.simulator/sighash_all data3.json ../build.simulator/sudt sudt_data.json ``` ---------------------------------------- TITLE: Configuring Simulator Input Data (JSON) DESCRIPTION: This JSON configuration file (`data.json`) specifies details for the CKB simulator to execute a script. It defines whether the script is a lock or type script (`is_lock_script`), its index within the transaction inputs (`script_index`), the main transaction hash (`main`), and maps the transaction hash to its corresponding dumped JSON file (`original.json`). This setup allows the simulator to load and process specific transaction contexts. SOURCE: https://github.com/nervosnetwork/ckb-c-stdlib/blob/master/simulator/README.md#_snippet_0 LANGUAGE: json CODE: ``` { "is_lock_script": true, "script_index": 0, "main": "0xa98c212cf055cedbbb665d475c0561b56c68ea735c8aa830c493264effaf18bd", "0xa98c212cf055cedbbb665d475c0561b56c68ea735c8aa830c493264effaf18bd": "original.json" } ```