Just today I was hacking together something to enable spawning gRPC endpoints on remote host that would run as WASI modules. Didn't get far with wasmer-go bindings so I went with Wazero for now, but I hope to see the former getting some love.
Did you come across any good documentation around this? Last time I checked it all still felt very early, with Go itself not supporting WASI as compile target yet (this will change soon) and TinyGo not fully suporting `net/http`, and not many examples of how to pass structs between a Go wasm host and Go wasm module, with even strings requiring unsafe pointers IIRC.
You can compile for GOOS="wasip1" with Go 1.21, check out the builtin "gotip" command to use the master branch. Unfortunately exporting functions back to Go seems to be a work in progress, since "//go:wasmexport" directive is not yet implemented. Maybe for 1.22?
In addition to that, I added some constants to "..sdk\gotip\src\syscall\syscall_wasip1.go" by hand that were throwing errors about being undefined, just by copying the values from the default unix syscall package. They were about OS files and I figured I shouldn't need them for the WASI module.
But the documentation is lacking and sometimes out of date as you perhaps found out. I'm currently stuck at having the gRPC server object in Go, and the service implementation on the WASM side, and in need of a way to register that service on the server. This means for server.RegisterService(pb ServiceDesc, &server{}) I would need to smuggle out pb and a pointer to the implementation, or for server.RegisterService(pb ServiceDesc, &server{}) smuggle in a grpc.Server pointer...