2.4.3 • Published 1 day ago

@golem-sdk/golem-js v2.4.3

Weekly downloads
-
License
LGPL-3.0
Repository
github
Last release
1 day ago

Golem JavaScript API

GitHub npm node-current npm type definitions GitHub Workflow Status GitHub issues Discord

What's Golem and golem-js?

The Golem Network fosters a global group of creators building ambitious software solutions that will shape the technological landscape of future generations by accessing computing resources across the platform. Golem Network is an accessible, reliable, open access and censorship-resistant protocol, democratizing access to digital resources and connecting users through a flexible, open-source platform.

@golem-sdk/golem-js is the JavaScript API that allows developers to connect to their Golem nodes and manage their distributed, computational loads through Golem Network.

Golem application development

For a detailed introduction to using Golem and @golem-sdk/golem-js to run your tasks on Golem please consult our quickstart section.

Installation

@golem-sdk/golem-js is available as a NPM package.

You can install it through npm:

npm install @golem-sdk/golem-js

or by yarn:

yarn add @golem-sdk/golem-js

Building

To build a library available to the NodeJS environment:

npm run build
# or
yarn build

This will generate production code in the dist/ directory ready to be used in your nodejs or browser applications.

Usage

Hello World

import { TaskExecutor } from "@golem-sdk/golem-js";

(async function main() {
  const executor = await TaskExecutor.create("9a3b5d67b0b27746283cb5f287c13eab1beaa12d92a9f536b747c7ae");
  await executor.run(async (ctx) => console.log(await ctx.run("echo 'Hello World'")).stdout);
  await executor.end();
})();

Node.js context

hello_nodejs

Web Browser context

hello_web

For more detailed usage examples and tutorials, see the Java Script API section of the Golem Network Docs

Testing

Running unit tests

To run unit tests, you can simply execute the command:

npm run test:unit
# or
yarn test:unit

Running E2E tests

Both test cases for the NodeJS environment and the browser (cypress) require preparation of a test environment of the Golem Network with providers and all the necessary infrastructure. Goth framework is used for this purpose.

To enable E2E testing, you need to ensure that python -m goth is executable. Therefore, you must first install Goth according to the instructions described in the readme of the project.

NodeJS

npm run test:e2e
# or
yarn test:e2e

Cypress

npm run test:cypress
# or
yarn test:cypress

Contributing

It is recommended to run unit tests and static code analysis before committing changes.

yarn lint
# and
yarn format

See also

3.0.0-beta.21

1 day ago

3.0.0-beta.20

2 days ago

3.0.0-beta.19

17 days ago

3.0.0-beta.18

21 days ago

3.0.0-beta.17

24 days ago

3.0.0-beta.16

27 days ago

3.0.0-beta.15

28 days ago

3.0.0-beta.13

1 month ago

3.0.0-beta.14

29 days ago

3.0.0-beta.12

1 month ago

2.4.3

1 month ago

3.0.0-beta.11

1 month ago

3.0.0-beta.10

2 months ago

2.4.2

2 months ago

3.0.0-beta.9

2 months ago

3.0.0-beta.8

2 months ago

3.0.0-beta.7

2 months ago

3.0.0-beta.6

2 months ago

2.4.1

2 months ago

3.0.0-beta.5

2 months ago

2.4.0-alpha.1

2 months ago

2.4.0

2 months ago

3.0.0-beta.4

2 months ago

3.0.0-beta.3

2 months ago

2.3.2

2 months ago

2.3.1

2 months ago

3.0.0-beta.2

2 months ago

2.2.0-beta.3

2 months ago

3.0.0-beta.1

2 months ago

2.3.0

2 months ago

2.2.0-beta.2

2 months ago

2.2.0

2 months ago

2.2.0-alpha.1

2 months ago

2.2.0-beta.1

3 months ago

2.1.0

3 months ago

2.1.1-beta.1

3 months ago

2.0.2-beta.1

3 months ago

2.0.0-beta.30

3 months ago

2.0.1

3 months ago

2.0.0

3 months ago

2.0.0-beta.29

3 months ago

2.0.0-beta.26

3 months ago

2.0.0-beta.25

3 months ago

2.0.0-beta.28

3 months ago

2.0.0-beta.27

3 months ago

2.0.0-beta.24

3 months ago

2.0.0-beta.23

3 months ago

2.0.0-beta.22

3 months ago

2.0.0-beta.21

3 months ago

2.0.0-beta.20

3 months ago

2.0.0-beta.19

3 months ago

2.0.0-beta.18

3 months ago

2.0.0-beta.17

3 months ago

2.0.0-beta.15

4 months ago

2.0.0-beta.16

3 months ago

2.0.0-beta.14

4 months ago

2.0.0-beta.13

4 months ago

2.0.0-beta.12

4 months ago

2.0.0-beta.11

4 months ago

2.0.0-beta.10

4 months ago

2.0.0-beta.9

4 months ago

2.0.0-beta.8

4 months ago

1.0.3

5 months ago

2.0.0-beta.7

5 months ago

1.0.3-alpha.1

5 months ago

2.0.0-beta.6

5 months ago

1.0.2

5 months ago

1.0.2-alpha.1

5 months ago

2.0.0-beta.5

5 months ago

2.0.0-beta.4

5 months ago

2.0.0-beta.3

5 months ago

2.0.0-beta.2

5 months ago

2.0.0-beta.1

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago

1.0.0-beta.10

5 months ago

1.0.0-beta.9

5 months ago

1.0.0-beta.8

5 months ago

1.0.0-beta.7

6 months ago

0.13.1

6 months ago

0.13.0

6 months ago

1.0.0-beta.6

6 months ago

1.0.0-beta.5

6 months ago

1.0.0-beta.4

6 months ago

1.0.0-beta.3

6 months ago

0.12.3

6 months ago

1.0.0-beta.2

6 months ago

0.12.2

6 months ago

1.0.0-beta.1

6 months ago

0.12.0-beta.4

6 months ago

0.12.1

6 months ago

0.12.0-beta.3

7 months ago

0.12.0

7 months ago

0.12.0-beta.2

7 months ago

0.12.0-beta.1

7 months ago

0.11.3-beta.1

7 months ago

0.11.2

8 months ago

0.11.1-beta.1

8 months ago

0.11.1

8 months ago

0.11.0

8 months ago

0.11.0-beta.1

8 months ago

0.10.1

8 months ago

0.10.0

8 months ago

0.10.0-beta.3

8 months ago

0.10.0-beta.2

8 months ago

0.10.0-beta.1

8 months ago

0.9.0

8 months ago

0.9.0-beta.2

8 months ago

0.9.0-beta.1

9 months ago

0.8.3

9 months ago

0.8.2

9 months ago

0.8.1

9 months ago

0.8.0

9 months ago