Host should be an operational Gate.

Live demo

Running greet function of webassembly module /ipfs/QmQtrCfTTJ5tbGef8meCvZFHaaqn5ubQr9gM9FD3KewwM8.

The server call is made anonymously.

Anonymous usage with cURL

Upload and execute:

$ curl -o hello.wasm $ curl -X PUT -H "Content-Type: application/wasm" --data-binary @hello.wasm -L "" hello, world

SHA-256 hash of the uploaded module contents must be included in the URL.

Executing the same module via IPFS:

$ curl -X POST -L "" hello, world

Anonymous usage with browser

Execute by IPFS hash via browser:

Command line client with authentication support

Install a Go compiler if needed, and build the Gate client:

$ go get -u $ PATH=$(go env GOPATH)/bin:$PATH # In case you haven't set it up already.

If necessary, create an Ed25519 private key using OpenSSH authentication key utility:

$ ssh-keygen -t ed25519 # Defaults to ~/.ssh/id_ed25519. $ ssh-keygen -t ed25519 -f filename # If you want to use a Gate-specific key (see below).

Manage resources bound to your public key:

$ gate launch ./hello.wasm greet 01234567-89ab-odef-0123-456789abcdef $ gate io 01234567-89ab-cdef-0123-456789abcdef hello, world $ gate instances 01234567-89ab-odef-0123-456789abcdef HALTED with result 0 $ gate modules fd17f578cf86343301b4227b3ee094084f653bb9a0c9eb687d064275bbad407b

The private key location can be overridden on the command line or in a configuration file:

$ gate -o identityfile=filename call fd17f578cf86343301b4227b3ee094084f653bb9a0c9eb687d064275bbad407b greet hello, world $ mkdir -p ~/.config/gate $ echo 'identityfile = "filename"' >> ~/.config/gate/client.toml

Discover the service catalog:

$ gate call -s listener /ipfs/QmcZLg8MfJnSUiSJLQi3tk5Rureh89pJQJErfV24pgUHBZ { "services": [ { "name": "catalog", "revision": "0" }, { "name": "", "revision": "0" }, { "name": "", "revision": "0" }, { "name": "identity", "revision": "0" }, { "name": "origin", "revision": "0" }, { "name": "random", "revision": "0" }, { "name": "scope", "revision": "0" } ] }

Service availability may vary based on authorization and scope. Discover the services currently available for anonymous use.

An entry function name wasn't specified for the catalog program because it has implicit main function.

© Timo Savola