Quickstart

No-code Quickstart

What's in it for me?

By following this tutorial, you'll see how easy it is to deploy web applications on Golem.

You should be able to complete it regardless of your level of experience. However, it will be helpful if you have some fluency using basic Unix tools like curl or git and are not afraid of running console commands.

Installation

1. Install and run Yagna

Yagna is a service that communicates and performs operations on the Golem Network. Let's get started by installing it.

Install Yagna

On Linux/MacOS, you can install it using our installation script:

curl -sSf https://join.golem.network/as-requestor | bash -

You might be asked to modify your PATH afterward.

Start the Yagna service

Open a terminal (command line window) and define the app-key that will allow our script to use the Yagna API. In this tutorial, we will use the try_golem app-key, which will be automatically generated and configured when you start Yagna.

export YAGNA_AUTOCONF_APPKEY=try_golem
warning

This creates a temporary app-key that will disappear after the Yagna service is restarted. This is useful for experimenting and running examples and tutorials. However, for production deployment, it is recommended to use a unique app-key generated using the yagna app-key create <key-name> command.

Then start the yagna service:

yagna service run

Now, set the YAGNA_APPKEY environment variable, which will be used by your Golem application to connect to Yagna:

export YAGNA_APPKEY=try_golem

2. Get the virtual environment set up

It's best to run any Python application in a virtual environment. This will let you avoid cluttering your system's Python installation with unnecessary packages.

Ensure you're running Python >= 3.8 and that you have the venv module installed (it's normally included in the Python distribution).

Prepare a virtual environment for the tutorial script:

python3 -m venv --clear ~/.envs/dapps
source ~/.envs/dapps/bin/activate

3. Install dapp-runner

The tool that deploys apps to Golem, dapp-runner is installable from the PyPi repository with the following command:

pip install -U pip dapp-runner

Running a dApp on Golem

Get the sample app

curl https://raw.githubusercontent.com/golemfactory/dapp-store/81e3f50aba90a84d335a26cb9cc2ea778193be11/apps/todo-app.yaml > webapp.yaml

And the default config file

curl https://raw.githubusercontent.com/golemfactory/dapp-runner/main/configs/default.yaml > config.yaml

Run the app

Now you can start the app on Golem.

dapp-runner start --config config.yaml webapp.yaml

Once the app launches, you should see some status messages describing various stages of the deployment. And finally, you should see:

{ "web": { "local_proxy_address": "http://localhost:8080" } }

This means that the app is ready and can be viewed at: http://localhost:8080

(The port on your machine may be different)

That's it!

Next steps
  • Now that you have been able to experience launching decentralized apps on Golem, you might want to learn how to build one yourself: Hello World dApp