Guide

Default Values in the JS SDK

The JS SDK is designed to streamline the experience for developers by providing default values for various options. These default settings cater to the majority of typical use cases. However, understanding that there may be unique scenarios where you might need to tweak these settings, the SDK allows for customization.

Below is a summary of the default values, their significance, and the associated parameters that can be adjusted as per your requirements:

ExecutorOptions

taskTimeout

Specifies the timeout for executing a single task, measured in milliseconds (ms).

Default value: 5 * 60 * 1000

logger

Determines the logger module responsible for handling SDK logs.

Default value: pinoLogger for Node.js, null for browsers

logLevel

Defines the log level. Available options: debug, info, warn, log, error.

Default value: info

enableLogging

Enable or disable logging. Set to false to turn off all logging, even if a logger module is specified.

Default value: true

maxTaskRetries

Designates the maximum number of retry attempts for a job if it fails on the provider's side.

Default value: 3

YagnaOptions

apiKey

The apiKey facilitates access to the yagna REST API.

Default value: as read from 'process.env.YAGNA_APPKEY' for node.js, null for browser

basePath

The base URL of the yagna REST API.

Default value: http://127.0.0.1:7465

PackageOptions

engine

Specifies the type of the payload. Options include: vm, wasm.

Default value: vm

minMemGib

Minimum required RAM size, denoted in gigabytes (GB).

Default value: 0.5

minStorageGib

Minimum required storage size, denoted in gigabytes (GB).

Default value: 2

minCpuThreads

Minimum number of CPU threads required.

Default value: 1

minCpuCores

Minimum number of CPU cores required.

Default value: 1

capabilities

List of capabilities that providers can offer. Refer to the manifest and demand documentation for more details.

Default value: []

MarketOptions

debitNotesAcceptanceTimeout

Sets the minimal time reserved for accepting debit notes. Proposals with shorter times will be rejected, measured in minutes.

Default value: 30

proposalFilter

This filter determines which proposals to accept, based on their compatibility with the demand.

TaskServiceOptions

maxParallelTasks

Sets the maximum number of tasks that can be executed concurrently when the TaskExecutor processes more than one task at a time.

Default value: 5

activityPreparingTimeout

Timeout for activity preparation, which includes the creation and deployment commands, in ms.

Default value: 5 * 60 * 1000

activityExecuteTimeout

Sets the maximum execution time for a script, either a single command or a batch, in ms.

Default value: 5*60*1000

PaymentOptions

network

Defines the blockchain network for processing payments. The holesky option indicates a test network that utilizes test GLM. Other options include polygon. Important: the nework is a property of payment object: payment: { network: "holesky", driver: "erc20" }.

Default value: holesky

budget

Specifies the total budget allocated for all tasks scheduled by an executor, measured in GLM/tGLM.

Default value: 1.0

paymentTimeout

Max waiting time for the executor script to receive invoices from providers post task completion, in ms.

Default value: 60 * 1000

allocationExpires

Specifies the duration after which an allocation expires, in milliseconds. A valid allocation is essential for accepting invoices.

Default value: 60000 * 60

debitNoteFilter

This filter outlines the rules for debit note acceptance.

invoiceFilter

This filter outlines the rules for invoice acceptance.

AgreementServiceOptions

agreementSelector

This selector determines which agreements will be chosen for the next task, provided by the iterator. The pool comprises existing agreements and potential new agreements sourced from available proposals.