Kryvon / KRYVON DEVELOPER DOCSKRYVON DEVELOPER DOCS

Integration tests

Use the integration tests reference for the Kryvon node, with RPC parameters, response types and examples.

RPC reference

Module Integration_test

Use these methods with a disposable integration-test node running Dummy proof of work. They change test chain state or exercise test-only block and transaction paths.

RPC for Integration Test.

Method process_block_without_verify

  • process_block_without_verify(data, broadcast)
    • data: Block
    • broadcast: boolean
  • result: H256 | null

process block without any block verification.

Params
  • data - a JSON Block object.

  • broadcast - true to enable broadcast(relay) the block to other peers.

Method truncate

  • truncate(target_tip_hash)
    • target_tip_hash: H256
  • result: null

Truncate chain to specified tip hash, can only truncate less then 50000 blocks each time.

Params
  • target_tip_hash - specified header hash

Method generate_block

  • generate_block()

  • result: H256

Generate block(with verification) and broadcast the block.

Note that if called concurrently, it may return the hash of the same block.

Method generate_epochs

Advance the local chain by the given epoch duration to test epoch transitions and maturity.

Returns the updated epoch number and its fractional progress after generating blocks.

Params
  • num_epochs - The number of epochs to generate.

Method notify_transaction

Add transaction to tx-pool.

Params
  • transaction - specified transaction to add

Method generate_block_with_template

  • generate_block_with_template(block_template)
  • result: H256

Build a block from the template, process it and relay it to the test node’s peers.

Params
  • block_template - The block template used to build the block.

Method send_test_transaction

Submits a new test local transaction into the transaction pool, only for testing. If the transaction is already in the pool, rebroadcast it to peers.

Params
  • transaction - The transaction.
  • outputs_validator - Validates the transaction outputs before entering the tx-pool. (Optional, default is "passthrough").
Errors