iexec / Exports / IExecHubModule
module exposing hub methods
-
↳
IExecHubModule
• new IExecHubModule(configOrArgs
, options?
): IExecHubModule
Create an IExecModule instance
Name | Type |
---|---|
configOrArgs |
IExecConfig | IExecConfigArgs |
options? |
IExecConfigOptions |
• config: IExecConfig
current IExecConfig
▸ countCategory(): Promise
<BN
>
count the created categories.
example:
const count = await countCategory();
console.log('category count:', count);
Promise
<BN
>
▸ 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);
Name | Type |
---|---|
category |
Object |
category.description |
string |
category.name |
string |
category.workClockTimeRef |
BNish |
Promise
<{ catid
: BN
; txHash
: string
}>
▸ 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);
Promise
<BN
>
▸ showCategory(catid
): Promise
<Category
>
show category with specified catid.
example:
const category = await showCategory(0);
console.log('category:', category);
Name | Type |
---|---|
catid |
BNish |
Promise
<Category
>
▸ fromConfig(config
): IExecHubModule
Create an IExecHubModule instance using an IExecConfig instance
Name | Type |
---|---|
config |
IExecConfig |