Skip to content

Latest commit

 

History

History
181 lines (109 loc) · 3.46 KB

IExecHubModule.md

File metadata and controls

181 lines (109 loc) · 3.46 KB

iexec / Exports / IExecHubModule

Class: IExecHubModule

module exposing hub methods

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new IExecHubModule(configOrArgs, options?): IExecHubModule

Create an IExecModule instance

Parameters

Name Type
configOrArgs IExecConfig | IExecConfigArgs
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

Name Type
category Object
category.description string
category.name string
category.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

Name Type
catid BNish

Returns

Promise<Category>


fromConfig

fromConfig(config): IExecHubModule

Create an IExecHubModule instance using an IExecConfig instance

Parameters

Name Type
config IExecConfig

Returns

IExecHubModule

Overrides

IExecModule.fromConfig