G
G
Golem SDK
Search…
Requestor development: a quick primer
This tutorial shows how to use the new Golem to run an app inside a custom Docker image in parallel on multiple providers.

Prerequisites

Platforms

While it's possible that you'll be successful running Golem and this tutorial on other platforms, we officially support the following:
  • OS X 10.14+
  • Ubuntu 18.04 or 20.04
  • Windows

Languages

If you are a JS developer, please switch to NodeJS tab
Python
NodeJS
Python 3.6+
To verify your currently installed version of python, please run:
1
python3 --version
Copied!
If you have an older version of python and you'd like to keep that version in your system, consider using pyenv. You can use pyenv-installer to facilitate the process.
On Windows, you may need to just use python instead of python3
NodeJS 12.13.0+
To verify your currently installed version of node, please run:
1
node --version
Copied!
If you have an older version of node and you'd like to keep that version in your system, consider using nvm. You can install it using the instructions from:
Once you have nvm installed on your machine, run:
1
nvm install v12
Copied!
Yarn 1.22.3+
Verify that with:
1
yarn --version
Copied!
If you don't have yarn or need to update, it, please go to: https://classic.yarnpkg.com/en/docs/install/ and choose the version appropriate for your operating system.

Git

You'll also need the git versioning system client so you can clone our repositories. Ensure you have it available with:
1
git --version
Copied!

No crypto assets needed (for now)

During development, you'll most likely want to run your tasks on the Rinkeby Testnet. In that case, you won't need any real ETH or GLM tokens to start this tutorial. These test assets are acquired by the daemon in one of the steps below.
Should you later want to run your tasks on the mainnet, to leverage the potential of all Golem's provider nodes, please have a look at: "Using Golem on Mainnet"

Can we help you? Do you have feedback for Golem?

If you'd like to give us feedback, suggestions, have some errors to report or if you got stuck and need help while following our tutorials, please don't hesitate to reach out to us on our Golem Discord: https://chat.golem.network

Running the yagna daemon

Yagna is the main service of the new Golem that's responsible for maintaining the marketplace and keeping connections with all the other nodes in the network.
In order to follow our requestor agent tutorial, you'll first need to run the yagna daemon.

Easy installation

You can install it using our helper script like this:
1
curl -sSf https://join.golem.network/as-requestor | bash -
Copied!
You might be asked to modify your PATH afterwards.
On Windows, only the manual installation is supported.

Manual installation

Alternatively, if you'd like to have more control over the installation process, or would like to choose where the binaries end up, you can do that manually.
First, download the requestor package - prefixed golem-requestor - appropriate for your platform from: https://github.com/golemfactory/yagna/releases/tag/v0.8.0.
Unpack it and put the binaries contained within somewhere in your PATH (e.g. copy them to /usr/local/bin on Unix-like systems) or add the directory you placed the binaries in to your PATH.
It's important for the yagna and gftp binaries to be available in your shell's PATH, otherwise, you'll encounter issues while continuing the tutorial.

Confirm the installed daemon's version

Once binaries are installed, confirm that you're running the latest Golem release:
1
yagna --version
Copied!
It should output: yagna 0.8.0 (69838646 2021-10-11 build #175)
Please also verify that you have the correct version of the gftp binary used for file transfers in the Golem network.
1
gftp --version
Copied!
It should output: gftp 0.8.0 (69838646 2021-10-11 build #175)

Run the daemon

Now, you can run the daemon:
1
yagna service run
Copied!
Important: After you launch the daemon, leave it running in the background while you proceed with the tutorial.
You can now proceed to Generate the app key.
Sometimes, you may notice errors while running the yagna daemon or the example script. Unless they cause your task to be aborted or never finished they are usually no reason to worry. In case of doubt, please consult our list of "Common Issues" in the Troubleshooting section.

Generate the app key

With the daemon running, enter the daemon's directory using another shell and generate the yagna app key that will be used by your requestor agent to access yagna's REST API.
1
yagna app-key create requestor
Copied!
This should produce a 32-character-long hexadecimal app key that you need to note down as it will be needed to run the requestor agent.
In case you lose your app key, you can retrieve it with:
1
yagna app-key list
Copied!
the value in the key column is the key you need.

Get some test GLM tokens

In order to be able to request tasks on Golem, you'll need some GLM tokens (called tGLM on the rinkeby testnet) to pay the providers with. Even on the testnet, those tokens are still required but of course you can easily get them issued to you using our tGLM faucet.
That's done using:
1
yagna payment fund
Copied!
It tells yagna to check for funds on your node and if needed, contacts the faucet which, in turn, issues some tGLM tokens to the node using zkSync.
Once you issue the command, allow some time until it completes its job. You can verify whether you already have the funds with:
1
yagna payment status
Copied!
If, after a few minutes, you still can't see the tokens, re-run the yagna payment fund command above and check again after a few more minutes.
As the last resort, if you suspect that there is a more serious issue with the zkSync payment driver or our faucet, you may wish to completely do away with using it and fall back to the older, on-chain payment driver. In such case, please refer to instructions in our troubleshooting section.

Enable the daemon as a requestor

As the last step before your requestor node is ready, you'll need to enable the daemon as a requestor.
The command needs to be run each time the daemon is started or restarted.
1
yagna payment init --sender
Copied!
With this completed, you're good to go!

Next steps

Now you are ready to run computations on Golem:
And by all means, have fun with Golem!
Last modified 1mo ago