Skip to main content

Datasource

  • Code location: /io/api.js

  • Datasource mainly provides the following functions.

    MethodFunctionSample
    initInitialize the systemVBW.datasource.init( cfg )
    contractOn-chain contract requests are all concentrated hereVBW.datasource.contract
    worldGet the setting of the corresponding worldVBW.datasource.world( index,ck,cfg )
    viewMethod for obtaining block dataVBW.datasource.view( x, y, ext, world, ck, limit)
    moduleMethod for obtaining model data in batchesVBW.datasource.module( ids, ck, cfg )
    textureMethod for batch acquiring texture image dataVBW.datasource.texture( ids, ck, cfg )
    gameMethod for obtaining the specified game configurationVBW.datasource.game( id, ck )
    subscribeMethod for subscribing to block height changes of a specified networkVBW.datasource.subscribe( event,key,fun )
    offClose the data subscription of the corresponding chainVBW.datasource.off( event,key )
  • Contracts are handled through external injection, using VBW.datasource.contract.set(map) to set them. Contract methods are executed using VBW.datasource.contract.call(method,params). This dependency injection approach reduces Septopus Engine dependencies, streamlines code, and adapts to changes and new features on the chain.