ckb_std

Module syscalls

Source

Re-exports§

Structs§

Functions§

  • closeNon-native-simulator
    This syscall manually closes a file descriptor. After calling this, any attempt to read/write the file descriptor pointed to the other end would fail. Note: available after ckb2023.
  • current_cyclesNon-native-simulator
    Current Cycles returns current cycle consumption just before executing this syscall. This syscall consumes 500 cycles.
  • debugNon-native-simulator
    Output debug message
  • execNon-native-simulator
    Exec runs an executable file from specified cell data in the context of an already existing machine, replacing the previous executable. The used cycles does not change, but the code, registers and memory of the vm are replaced by those of the new program. It’s cycles consumption consists of two parts:
  • exitNon-native-simulator
    Exit, this script will be terminated after the exit syscall. exit code 0 represents verification is success, others represent error code.
  • inherited_fdsNon-native-simulator
    This syscall retrieves the file descriptors available to the current process, which are passed in from the parent process. These results are copied from the inherited_fds parameter of the Spawn syscall. Note: available after ckb2023.
  • load_block_extensionNon-native-simulator
    Load extension field associated either with an input cell, a dep cell, or a header dep based on source and index value.
  • load_cellNon-native-simulator
    Load cell
  • load_cell_by_fieldNon-native-simulator
    Load cell by field
  • load_cell_codeNon-native-simulator
    Load cell code, read cell data as executable code
  • load_cell_dataNon-native-simulator
    Load cell data, read cell data
  • load_cell_data_rawNon-native-simulator
    Load cell data, read cell data
  • load_headerNon-native-simulator
    Load header
  • load_header_by_fieldNon-native-simulator
    Load header by field
  • load_inputNon-native-simulator
    Load input
  • load_input_by_fieldNon-native-simulator
    Load input by field
  • load_scriptNon-native-simulator
    Load script
  • load_script_hashNon-native-simulator
    Load script hash
  • load_transactionNon-native-simulator
    Load transaction
  • load_tx_hashNon-native-simulator
    Load transaction hash
  • load_witnessNon-native-simulator
    Load witness
  • pipeNon-native-simulator
    This syscall create a pipe with read-write pair of file descriptions. The file descriptor with read permission is located at fds[0], and the corresponding file descriptor with write permission is located at fds[1]. Note: available after ckb2023.
  • process_idNon-native-simulator
    This syscall is used to get the current process id. Root process ID is 0. Note: available after ckb2023.
  • readNon-native-simulator
    This syscall reads data from a pipe via a file descriptor. The syscall Read attempts to read up to value pointed by length bytes from file descriptor fd into the buffer, and the actual length of data read is returned. Note: available after ckb2023.
  • spawnNon-native-simulator
    The parent process calls the Spawn system call, which creates a new process (a child process) that is an independent ckb-vm instance. It’s important to note that the parent process will not be blocked by the child process as a result of this syscall. Note: available after ckb2023.
  • vm_versionNon-native-simulator
    VM version syscall returns current running VM version, so far 2 values will be returned:
  • waitNon-native-simulator
    The syscall pauses until the execution of a process specified by pid has ended. Note: available after ckb2023.
  • writeNon-native-simulator
    This syscall writes data to a pipe via a file descriptor. The syscall Write writes up to value pointed by length bytes from the buffer, and the actual length of data written is returned. Note: available after ckb2023.