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
| Name | Type | Description |
|---|---|---|
config | GolemNetworkConfig | Configuration options that will be passed to all jobs created by this instance. |
Returns
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
| Name | Type |
|---|---|
Output | unknown |
Parameters
| Name | Type | Description |
|---|---|---|
options | RunJobOptions | Configuration 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
| Name | Type |
|---|---|
id | string |
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>