Install
View Creator (also referred to as Viewkit) is the developer-facing toolchain for defining, packaging, and deploying Shinzo Views. It provides a workflow for turning raw indexed blockchain data into reusable, versioned data APIs that can be executed and served by Hosts.
Prerequisites
- Git
- Make
- Go 1.25
Setup
-
Make sure you've got all the prerequisites installed properly:
git --version && make --version && go versiongit version 2.43.0 GNU Make 4.3 [...] go version go1.25.12 linux/arm64 -
Clone the repository:
git clone https://github.com/shinzonetwork/shinzo-view-creator.git cd shinzo-view-creator -
Build the viewkit binary:
make buildYou should see a
builddirectory: -
Run Viewkit:
./build/viewkit --helpViewkit helps you initialize, manage, and publish Shinzo views through a simple CLI interface. Usage: viewkit [command] [...] -
Move the
viewkitexecutable somewhere resonable and (optional):sudo mv ./build/viewkit /usr/local/binNow you can run
viewkitfrom anywhere.
Wasmer runtime
Viewkit can execute WebAssembly lenses locally to validate and preview them.
Under the hood, it uses wasmer-go, which depends on a native dynamic library (libwasmer.dylib). If your local system cannot find that library, any command that touches lenses will fail with an error like:
image not found library not loaded: libwasmer.dylib
-
Move back into the shinzo-view-creator repo if you moved out of it:
cd shinzo-view-creator -
Install the Wasmer Go module
go get github.com/wasmerio/[email protected]go: downloading github.com/wasmerio/wasmer-go v1.0.4 go: added github.com/wasmerio/wasmer-go v1.0.4This ensures
wasmer-goand its packaged native libraries are present in yourGOPATH.
Environment variables
We need to set three new environment variables:
WASMER_ROOT: points to the directory wherelibwasmer.dyliblives.WASMER_LIB_PATH: used bywasmer-goto find the dynamic library.DYLD_LIBRARY_PATH: MacOS-specific dynamic loader search path. We prependWASMER_ROOTso the loader can findlibwasmer.dylibwhenviewkitstarts.
-
Append these lines to your shell's RC file.
MacOS:
echo 'export WASMER_ROOT="$(go env GOPATH)/pkg/mod/github.com/wasmerio/[email protected]/wasmer/packaged/lib/darwin-aarch64"' >> ~/.zshrc echo 'export WASMER_LIB_PATH="$WASMER_ROOT"' >> ~/.zshrc echo 'export DYLD_LIBRARY_PATH="$WASMER_ROOT:$DYLD_LIBRARY_PATH"' >> ~/.zshrcLinux:
echo 'export WASMER_ROOT="$(go env GOPATH)/pkg/mod/github.com/wasmerio/[email protected]/wasmer/packaged/lib/linux-amd64"' >> ~/.zshrc echo 'export WASMER_LIB_PATH="$WASMER_ROOT"' >> ~/.zshrc echo 'export LD_LIBRARY_PATH="$WASMER_ROOT:$LD_LIBRARY_PATH"' >> ~/.zshrc -
Reload your shell configuration:
source ~/.zshrc -
Verify that the variables are set:
echo "$WASMER_ROOT" ls "$WASMER_ROOT"/home/user/go/pkg/mod/github.com/wasmerio/[email protected]/wasmer/packaged/lib/linux-amd64 dummy.go libwasmer.so
[!WARNING] If
libwasmer.dylibis missing, re-run thego getstep and ensurego env GOPATHreturns a valid path.