Introducing golem-js 3.0

So here we are, 57 beta pre-releases of our core JS SDK component golem-js led to the final stable release golem-js@3.0. With this post, we would like to provide a major update about the reasons and the changes made in this release.

Driven by experience

We validated golem-js@2.x design in multiple ways by:

  • building different mini-applications and PoCs internally within Golem Factory,
  • helping out developers from our beloved community when they struggled and learning from their experiences,
  • looking closely at how DegenHack hackathon participants built their projects using the golem-js SDK.

This gave us insight that we wanted to feed back into the codebase of the golem-js and motivated the major shifts in its design.

What's new in 3.0?

Newly added features and issues fixed in this release

This release is really packed with awesome features and fixes compared to 2.x, these include:

Features we delivered

  1. Introduction of GolemNetwork root module
  2. Modularisation of the design and exposing core modules to developers
  3. Introduction of ResourceRental and ExeUnit models which replace TaskExecutor and WorkContext known from the previous SDK.
  4. Introduction of budget estimation and burn-rate pricing model next to the previous linear model implemented by GolemNetwork.
  5. Added VPN support to enable communication between your workloads running on the rented computation resources.
  6. Introduced passive market scan functionality for users with a market research attitude.
  7. Added possibility to consume allocations created outside of the Requestor scripts.
  8. Improved decentralization of the ecosystem, by supporting direct GVMI upload from Requestor to Provider, without involving Golem Registry in the process.
  9. Made the SDK more developer-friendly by introducing new Events API and leveraging RxJS Observables.
📚
For a more detailed description of these changes, refer to the Release Notes for the 3.0 version.

Fixes and improvements we made

Along the way, we addressed several issues that were present in the version 2.x :

  1. Fixed the issue with no new offers for long-running operations. By default, the Demand for the resources that you need is going to be refreshed every 30 minutes, so you should get fresh offers from the market after each such interval.
  2. golem-js is now made ESM compatible. This was not the case for the previous releases.
  3. getHealthyProvidersWhiteList is now obtaining the whitelist of the Golem Reputation System instead of the one delivered by the deprecated Golem Node Validator project.
  4. Improved SDK shutdown performance - we optimized the operations done as part of the shutdown significantly reducing its overall duration.

Breaking changes

We bend and break, for improvement's sake

Here we'd like to highlight only some of the breaking changes introduced in this major release. For the full list, please consult the release notes (PROVIDE LINK) for version 3.0.

  1. The minimum supported version of Yagna is now 0.15.2. If you try to run your requestor code with an older version, the SDK will throw an error.
  2. The TaskExecutor is removed from golem-js and is placed in the dedicated @golem-sdk/task-executor library.the WorkContext has been replaced by ExeUnit.
  3. The RemoteProess stdout and stderr properties type was changed from Redable to Observable.

What about users of 2.0?

With the release of version 3.0, the previous version 2.0 is no longer maintained and users are encouraged to take one of the two available migration paths.

Migrating from 2.x to 3.x

We provided dedicated upgrading instructions in our SDKs repository. Please follow them to migrate your TaskExecutor based code to the new RentedResources and ExeUnit components.

Migrating from golem-js to `task-executor`

The TaskExecutor known from the 2.x versions of golem-js has been moved to a standalone library @golem-sdk/task-executor and will be maintained there. Version 1.x of this library is compatible with golem-js@2.x so the migration should be smooth.

🏗️
We're going to update the @golem-sdk/task-executor library to use golem-js@3.0 which will happen in the following weeks.

Support in migration

Feel invited to our official Discord, where you can find the core team developers on #sdk-discussion and #js-discussion channels. If you encounter any difficulties in the migration/upgrading process - let us know and we might help you out!

What's next?

Rest assured, that we didn't manage to incorporate all of the learnings and changes that all of us wished for. You can expect more features to be added as part of the 3.x production line.

This specific release constitutes the bedrock for continued efforts to make the SDK adaptable in new fields and use cases.

Have you tried out golem-js yet?

npx @golem-sdk/cli@latest new my-golem-app