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).
logger
Determines the logger module responsible for handling SDK logs.
logLevel
Defines the log level. Available options: debug
, info
, warn
, log
, error
.
enableLogging
Enable or disable logging. Set to false
to turn off all logging, even if a logger module is specified.
maxTaskRetries
Designates the maximum number of retry attempts for a job if it fails on the provider's side.
YagnaOptions
apiKey
The apiKey
facilitates access to the yagna REST API.
basePath
The base URL of the yagna REST API.
PackageOptions
engine
Specifies the type of the payload. Options include: vm
, wasm
.
minMemGib
Minimum required RAM size, denoted in gigabytes (GB).
minStorageGib
Minimum required storage size, denoted in gigabytes (GB).
minCpuThreads
Minimum number of CPU threads required.
minCpuCores
Minimum number of CPU cores required.
capabilities
List of capabilities that providers can offer. Refer to the manifest and demand documentation for more details.
MarketOptions
debitNotesAcceptanceTimeout
Sets the minimal time reserved for accepting debit notes. Proposals with shorter times will be rejected, measured in minutes.
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.
activityPreparingTimeout
Timeout for activity preparation, which includes the creation and deployment commands, in ms.
activityExecuteTimeout
Sets the maximum execution time for a script, either a single command or a batch, in ms.
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" }
.
budget
Specifies the total budget allocated for all tasks scheduled by an executor, measured in GLM/tGLM.
paymentTimeout
Max waiting time for the executor script to receive invoices from providers post task completion, in ms.
allocationExpires
Specifies the duration after which an allocation expires, in milliseconds. A valid allocation is essential for accepting invoices.
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.