Setup Go
Creating Golem components in Go requires using the latest version of the TinyGo compiler (opens in a new tab) and installing some common WebAssembly tooling.
Installing TinyGo
Use the official guide (opens in a new tab) to install the latest stable version of the TinyGo compiler.
Note that TinyGo also requires Go to be installed too. Follow the recommended steps here (opens in a new tab) to download and install the latest recommended version.
For MacOS TinyGo can be installed using brew
:
brew tap tinygo-org/tools
brew install tinygo
Install WebAssembly tooling
First of all, to install wasm-tools
via cargo
, you need to install the latest stable version of Rust. The recommended way to do so is using https://rustup.rs (opens in a new tab):
Install Rust
Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install the latest stable version of Rust
rustup install stable && rustup default stable
Add the WASI target
rustup target add wasm32-wasi
Install wasm-tools
cargo install --force --locked wasm-tools@1.210.0
Confirm the installation:
wasm-tools --version
wasm-tools 1.210.0
Install wit-bindgen
cargo install --force --locked wit-bindgen-cli@0.26.0
Confirm the installation:
wit-bindgen --version
wit-bindgen-cli 0.26.0
Golem requires a specific version of wasm-tools
and wit-bindgen
. Please make sure the
correct version is installed with the commands described above.