JS API Reference

Class: GolemNetwork

golem_network/golem_network.GolemNetwork

This API is experimental and subject to change. Use at your own risk.

The Golem Network class provides a high-level API for running jobs on the Golem Network.

Table of contents

Constructors

Methods

Constructors

constructor

new GolemNetwork(config): GolemNetwork

Parameters

NameTypeDescription
configGolemNetworkConfigConfiguration options that will be passed to all jobs created by this instance.

Returns

GolemNetwork

Defined in

src/golem_network/golem_network.ts:24

Methods

isInitialized

isInitialized(): boolean

Returns

boolean

Defined in

src/golem_network/golem_network.ts:28


init

init(): Promise<void>

Returns

Promise<void>

Defined in

src/golem_network/golem_network.ts:32


createJob

createJob<Output>(options?): Job<Output>

Create a new job and add it to the list of jobs managed by this instance. This method does not start any work on the network, use Job.startWork for that.

Type parameters

NameType
Outputunknown

Parameters

NameTypeDescription
optionsRunJobOptionsConfiguration options for the job. These options will be merged with the options passed to the constructor.

Returns

Job<Output>

Defined in

src/golem_network/golem_network.ts:43


getJobById

getJobById(id): undefined | Job<unknown>

Parameters

NameType
idstring

Returns

undefined | Job<unknown>

Defined in

src/golem_network/golem_network.ts:53


close

close(): Promise<void>

Close the connection to the Yagna service and cancel all running jobs.

Returns

Promise<void>

Defined in

src/golem_network/golem_network.ts:62