Options
All
  • Public
  • Public/Protected
  • All
Menu

Package testkit

@ckb-lumos/base

Test toolkit for testing CKB dApps

Work With CKB Indexer

Starting a CKB mock rpc

$ ts-node packages/testkit/example-ckb-nodes.ts
server listen to 8118

And then launching a CKB indexer sync block data from the mock server

ckb-indexer -c http://127.0.0.1:8118/rpc -l 127.0.0.1:8116 -s indexer-store-tmp

Index

References

createCKBMockRPC

Re-exports createCKBMockRPC

createCKBMockRPC

Re-exports createCKBMockRPC

mockData

Re-exports mockData

mockData

Re-exports mockData

startCKBIndexer

Re-exports startCKBIndexer

startCKBIndexer

Re-exports startCKBIndexer

Variables

Let CKB_Indexer_Version

CKB_Indexer_Version: string = "0.2.2"

Const server

server: Express = createCKBMockRPC({blocks: JSON.parse(fs.readFileSync(path.join(__dirname, "../../ckb-indexer/tests/blocks_data.json")).toString()),localNode: mockData.localNode(),})

Functions

assertsParams

  • assertsParams(param: unknown): assertsparam
  • Parameters

    • param: unknown

    Returns assertsparam

createCKBMockRPC

  • createCKBMockRPC(options: Options): Express
  • Parameters

    Returns Express

createCKBMockRPC

  • createCKBMockRPC(options: Options): Express
  • Parameters

    Returns Express

Const download

  • download(): Promise<void>
  • Returns Promise<void>

downloadCKBIndexer

  • downloadCKBIndexer(): Promise<void>
  • Returns Promise<void>

downloadCKBIndexer

  • downloadCKBIndexer(): Promise<void>
  • Returns Promise<void>

getDownloadOsType

  • getDownloadOsType(): "linux" | "macos" | "mac"
  • Returns "linux" | "macos" | "mac"

localNode

  • Parameters

    Returns LocalNode

localNode

  • Parameters

    Returns LocalNode

log

  • log(info: string): void
  • Parameters

    • info: string

    Returns void

startCKBIndexer

  • startCKBIndexer(CKBVersion?: undefined | string): Promise<void>
  • Parameters

    • Optional CKBVersion: undefined | string

    Returns Promise<void>

startCKBIndexer

  • startCKBIndexer(CKBVersion?: undefined | string): Promise<void>
  • Parameters

    • Optional CKBVersion: undefined | string

    Returns Promise<void>

Generated using TypeDoc