Skip to content

Latest commit

 

History

History
175 lines (98 loc) · 2.85 KB

File metadata and controls

175 lines (98 loc) · 2.85 KB

iexec


iexec / IExecHubModule

Class: IExecHubModule

module exposing hub methods

Extends

Constructors

Constructor

new IExecHubModule(configOrArgs, options?): IExecHubModule

Create an IExecModule instance

Parameters

configOrArgs

IExecConfigArgs | IExecConfig

options?

IExecConfigOptions

Returns

IExecHubModule

Inherited from

IExecModule.constructor

Properties

config

config: IExecConfig

current IExecConfig

Inherited from

IExecModule.config

Methods

countCategory()

countCategory(): Promise<BN>

count the created categories.

example:

const count = await countCategory();
console.log('category count:', count);

Returns

Promise<BN>


createCategory()

createCategory(category): Promise<{ catid: BN; txHash: string; }>

SIGNER REQUIRED, ONLY IEXEC OWNER

create a computation category on the iExec contract

example:

const { catid } = await createCategory({
 name: 'Small',
 description: '5 min',
 workClockTimeRef: 300,
});
console.log('deployed with catid', catid);

Parameters

category
description

string

name

string

workClockTimeRef

BNish

Returns

Promise<{ catid: BN; txHash: string; }>


getTimeoutRatio()

getTimeoutRatio(): Promise<BN>

get the current TimeoutRatio

TimeoutRatio is used with the category workClockTimeRef to determine the tasks duration (task max duration = TimeoutRatio * workClockTimeRef)

example:

const timeoutRatio = await getTimeoutRatio();
console.log('timeoutRatio:', timeoutRatio);

Returns

Promise<BN>


showCategory()

showCategory(catid): Promise<Category>

show category with specified catid.

example:

const category = await showCategory(0);
console.log('category:', category);

Parameters

catid

BNish

Returns

Promise<Category>


fromConfig()

static fromConfig(config): IExecHubModule

Create an IExecHubModule instance using an IExecConfig instance

Parameters

config

IExecConfig

Returns

IExecHubModule

Overrides

IExecModule.fromConfig