Clone a Quickstart Project
git clone https://github.com/hatchet-dev/hatchet-go-quickstart.gitCD into the project
cd hatchet-go-quickstartInstall dependencies
Create a virtual environment
Initialize the project and install the Hatchet SDK
Start a Worker
The fastest way to run a worker during development is with the Hatchet CLI:
hatchet worker devYou can also run the worker script directly. This requires a HATCHET_CLIENT_TOKEN environment variable. You can generate an API token from the Hatchet dashboard by navigating to the Settings tab and clicking API Tokens. Click Generate API Token to create a new token, and do not share it publicly.
export HATCHET_CLIENT_TOKEN="<your-client-token>"If you are a self-hosted user without TLS enabled, also set:
export HATCHET_CLIENT_TLS_STRATEGY=noneThen run your worker:
go run main.go