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
- Introduction of GolemNetwork root module
- Modularisation of the design and exposing core modules to developers
- Introduction of
ResourceRental
andExeUnit
models which replaceTaskExecutor
andWorkContext
known from the previous SDK. - Introduction of budget estimation and burn-rate pricing model next to the previous linear model implemented by GolemNetwork.
- Added VPN support to enable communication between your workloads running on the rented computation resources.
- Introduced passive market scan functionality for users with a market research attitude.
- Added possibility to consume allocations created outside of the Requestor scripts.
- Improved decentralization of the ecosystem, by supporting direct GVMI upload from Requestor to Provider, without involving Golem Registry in the process.
- Made the SDK more developer-friendly by introducing new Events API and leveraging RxJS Observables.
Fixes and improvements we made
Along the way, we addressed several issues that were present in the version 2.x
:
- 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.
golem-js
is now made ESM compatible. This was not the case for the previous releases.getHealthyProvidersWhiteList
is now obtaining the whitelist of the Golem Reputation System instead of the one delivered by the deprecated Golem Node Validator project.- 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
.
- 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. - The
TaskExecutor
is removed fromgolem-js
and is placed in the dedicated @golem-sdk/task-executor library.theWorkContext
has been replaced byExeUnit
. - The
RemoteProess
stdout
andstderr
properties type was changed fromRedable
toObservable
.
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.
@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