Host gate.computer should be an operational Gate.
It can run your code.
Running greet function of webassembly module /ipfs/QmQV5N5LQnPV2M8TLXcfYUfW1EKiTkcZejvY3zPFMc5qhg.
The server call is made anonymously.
Upload and execute:
$ curl -o hello.wasm https://gate.computer/hello.wasm
$ curl -X PUT -H "Content-Type: application/wasm" --data-binary @hello.wasm "https://gate.computer/gate-0/module/sha256/3eebfe195ff2e6b51112137eaebad029305a18aaedd8ead4e415959b20138da3?action=call&function=greet"
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 "https://gate.computer/gate-0/module/ipfs/QmQV5N5LQnPV2M8TLXcfYUfW1EKiTkcZejvY3zPFMc5qhg?action=call&function=greet"
hello, world
Execute by IPFS hash via browser:
Prebuilt binaries are available for Linux x86-64/ARM64, macOS x86-64/ARM64, and Windows x86-64/ARM64.
Alternatively, it can be built using Go:
$ go install gate.computer/cmd/gate@latest
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 gate.computer launch ./hello.wasm greet
01234567-89ab-odef-0123-456789abcdef
$ gate gate.computer io 01234567-89ab-cdef-0123-456789abcdef
hello, world
$ gate gate.computer instances
01234567-89ab-odef-0123-456789abcdef HALTED with result 0
$ gate gate.computer modules
3eebfe195ff2e6b51112137eaebad029305a18aaedd8ead4e415959b20138da3
The private key location can be overridden on the command line or in a configuration file:
$ gate -o identityfile=filename gate.computer call 3eebfe195ff2e6b51112137eaebad029305a18aaedd8ead4e415959b20138da3 greet
hello, world
$ mkdir -p ~/.config/gate
$ echo 'identityfile = "filename"' >> ~/.config/gate/client.toml
Discover the service catalog:
$ gate gate.computer call -s listener /ipfs/QmfE6F5AjsgywoWVQeypuGc9PcgQ2Ch6s6Bg7MHWNVKTdC
{
"services": [
{
"name": "catalog",
"revision": "0"
},
{
"name": "gate.computer/localhost",
"revision": "0"
},
{
"name": "gateservice.net/listener",
"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.