Skip to content

Commit

Permalink
Merge pull request #72 from golemcloud/use-host-1.1
Browse files Browse the repository at this point in the history
Use golem:api/[email protected]
  • Loading branch information
vigoo authored Dec 6, 2024
2 parents 288d0cc + 87ff048 commit 2d81396
Show file tree
Hide file tree
Showing 37 changed files with 85 additions and 84 deletions.
2 changes: 1 addition & 1 deletion examples/c/c-default/wit/component-name.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface api {
}

world component-name {
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

import wasi:blobstore/blobstore;
Expand Down
2 changes: 1 addition & 1 deletion examples/c/c-example-http/wit/component-name.wit
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface api {
}

world component-name {
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

import wasi:blobstore/blobstore;
Expand Down
4 changes: 2 additions & 2 deletions examples/go/go-default-minimal/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/golemcloud/golem-go v0.7.0 h1:8zpNeAtEDJsJllqHUmjji/lyplSJ0kI3v7vN97/N8zs=
github.com/golemcloud/golem-go v0.7.0/go.mod h1:VLL22qVo5R2+jGLO43tLPpPjf2WrA6B7GQoqXKnSODo=
github.com/golemcloud/golem-go v1.1.0 h1:By+OBuRu4c3WTuf2OKh71yY7rgOyLXzUgr7Y+98BjGk=
github.com/golemcloud/golem-go v1.1.0/go.mod h1:VLL22qVo5R2+jGLO43tLPpPjf2WrA6B7GQoqXKnSODo=
4 changes: 2 additions & 2 deletions examples/go/go-default/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/golemcloud/golem-go v0.7.0 h1:8zpNeAtEDJsJllqHUmjji/lyplSJ0kI3v7vN97/N8zs=
github.com/golemcloud/golem-go v0.7.0/go.mod h1:VLL22qVo5R2+jGLO43tLPpPjf2WrA6B7GQoqXKnSODo=
github.com/golemcloud/golem-go v1.1.0 h1:By+OBuRu4c3WTuf2OKh71yY7rgOyLXzUgr7Y+98BjGk=
github.com/golemcloud/golem-go v1.1.0/go.mod h1:VLL22qVo5R2+jGLO43tLPpPjf2WrA6B7GQoqXKnSODo=
2 changes: 1 addition & 1 deletion examples/go/go-default/wit/component-name.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface api {
}

world component-name {
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

import wasi:blobstore/blobstore;
Expand Down
8 changes: 4 additions & 4 deletions examples/go/go-multi-rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ In the example 3 simple counter components are defined, which can be familiar fr
- **component one** delegates the add call to **component two** and **three** too,
- and **component two** delegates to **component three**.

In both cases the _current worker name_ will be used as _target worker name_ too.
In both cases the _current worker name_ will be used as _target worker name_ too.

Apart from _worker name_, remote calls also require the **target components' deployed ID**. For this the example uses environment variables, and uses the `lib/cfg` subpackage (which is shared between the components) to extract it.

Expand Down Expand Up @@ -92,7 +92,7 @@ After adding a new component the `build` command will also include it.

## Using Worker to Worker RPC calls

### Under the hood
### Under the hood

Under the hood the _magefile_ commands below (and for build) use generic `golem-cli stubgen` subcommands:
- `golem-cli stubgen build` for creating remote call _stub WIT_ definitions and _WASM components_ for the stubs
Expand Down Expand Up @@ -142,7 +142,7 @@ interface component-one-api {
world component-one {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/[email protected];
// WASI dependencies
Expand Down Expand Up @@ -176,7 +176,7 @@ import (

func (i *Impl) Add(value uint64) {
std.Init(std.Packages{Os: true, NetHttp: true})

componentTwo := binding.NewComponentTwoApi(binding.GolemRpc0_1_0_TypesUri{Value: "uri"})
defer componentTwo.Drop()
componentTwo.BlockingAdd(value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface comp-name-api {

world comp-name {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-one-api {

world component-one {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-three-api {

world component-three {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-two-api {

world component-two {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-three-api {

world component-three {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-two-api {

world component-two {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-three-api {

world component-three {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
4 changes: 2 additions & 2 deletions examples/go/go-multi-rpc/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/golemcloud/golem-go v0.7.0 h1:8zpNeAtEDJsJllqHUmjji/lyplSJ0kI3v7vN97/N8zs=
github.com/golemcloud/golem-go v0.7.0/go.mod h1:VLL22qVo5R2+jGLO43tLPpPjf2WrA6B7GQoqXKnSODo=
github.com/golemcloud/golem-go v1.1.0 h1:By+OBuRu4c3WTuf2OKh71yY7rgOyLXzUgr7Y+98BjGk=
github.com/golemcloud/golem-go v1.1.0/go.mod h1:VLL22qVo5R2+jGLO43tLPpPjf2WrA6B7GQoqXKnSODo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
Expand Down
16 changes: 8 additions & 8 deletions examples/js/js-default-minimal/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import resolve from "@rollup/plugin-node-resolve";

export default {
input: 'src/main.js',
output: {
file: 'out/main.js',
format: 'esm'
},
external: ["golem:api/host@0.2.0"],
plugins: [resolve()],
};
input: "src/main.js",
output: {
file: "out/main.js",
format: "esm",
},
external: ["golem:api/host@1.1.0"],
plugins: [resolve()],
};
16 changes: 8 additions & 8 deletions examples/js/js-default/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import resolve from "@rollup/plugin-node-resolve";

export default {
input: 'src/main.js',
output: {
file: 'out/main.js',
format: 'esm'
},
external: ["golem:api/host@0.2.0"],
plugins: [resolve()],
};
input: "src/main.js",
output: {
file: "out/main.js",
format: "esm",
},
external: ["golem:api/host@1.1.0"],
plugins: [resolve()],
};
2 changes: 1 addition & 1 deletion examples/js/js-default/wit/main.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface api {
}

world component-name {
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

import wasi:blobstore/blobstore;
Expand Down
16 changes: 8 additions & 8 deletions examples/js/js-example-fetch/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import resolve from "@rollup/plugin-node-resolve";

export default {
input: 'src/main.js',
output: {
file: 'out/main.js',
format: 'esm'
},
external: ["golem:api/host@0.2.0"],
plugins: [resolve()],
};
input: "src/main.js",
output: {
file: "out/main.js",
format: "esm",
},
external: ["golem:api/host@1.1.0"],
plugins: [resolve()],
};
2 changes: 1 addition & 1 deletion examples/js/js-example-fetch/wit/main.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ interface api {
}

world component-name {
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
export api;
}
2 changes: 1 addition & 1 deletion examples/python/python-default/wit/component-name.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface api {
}

world component-name {
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

import wasi:blobstore/blobstore;
Expand Down
16 changes: 8 additions & 8 deletions examples/ts/ts-default-minimal/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import typescript from "rollup-plugin-typescript2";
import resolve from "@rollup/plugin-node-resolve";

export default {
input: 'src/main.ts',
output: {
file: 'out/main.js',
format: 'esm'
},
external: ["golem:api/host@0.2.0"],
plugins: [resolve(), typescript()],
};
input: "src/main.ts",
output: {
file: "out/main.js",
format: "esm",
},
external: ["golem:api/host@1.1.0"],
plugins: [resolve(), typescript()],
};
16 changes: 8 additions & 8 deletions examples/ts/ts-default/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import typescript from "rollup-plugin-typescript2";
import resolve from "@rollup/plugin-node-resolve";

export default {
input: 'src/main.ts',
output: {
file: 'out/main.js',
format: 'esm'
},
external: ["golem:api/host@0.2.0"],
plugins: [resolve(), typescript()],
};
input: "src/main.ts",
output: {
file: "out/main.js",
format: "esm",
},
external: ["golem:api/host@1.1.0"],
plugins: [resolve(), typescript()],
};
2 changes: 1 addition & 1 deletion examples/ts/ts-default/wit/main.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface api {
}

world component-name {
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

import wasi:blobstore/blobstore;
Expand Down
16 changes: 8 additions & 8 deletions examples/ts/ts-example-fetch/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import typescript from "rollup-plugin-typescript2";
import resolve from "@rollup/plugin-node-resolve";

export default {
input: 'src/main.ts',
output: {
file: 'out/main.js',
format: 'esm'
},
external: ["golem:api/host@0.2.0"],
plugins: [resolve(), typescript()],
};
input: "src/main.ts",
output: {
file: "out/main.js",
format: "esm",
},
external: ["golem:api/host@1.1.0"],
plugins: [resolve(), typescript()],
};
2 changes: 1 addition & 1 deletion examples/ts/ts-example-fetch/wit/main.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ interface api {
}

world component-name {
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
export api;
}
2 changes: 1 addition & 1 deletion examples/ts/ts-multi-rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ interface component-one-api {
world component-one {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/[email protected];
// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface comp-name-api {

world comp-name {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/[email protected];

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ComponentOneApi } from "./generated/component-one";
import { ComponentTwoApi } from "pack-ns:component-two-stub/stub-component-two";
import { ComponentThreeApi } from "pack-ns:component-three-stub/stub-component-three";
import * as cfg from "../../lib/cfg";
import { getSelfMetadata } from "golem:api/host@0.2.0";
import { getSelfMetadata } from "golem:api/host@1.1.0";

let state = BigInt(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-three-api {

world component-three {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-two-api {

world component-two {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-one-api {

world component-one {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-three-api {

world component-three {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentTwoApi } from "./generated/component-two";
import { ComponentThreeApi } from "pack-ns:component-three-stub/stub-component-three";
import * as cfg from "../../lib/cfg";
import { getSelfMetadata } from "golem:api/host@0.2.0";
import { getSelfMetadata } from "golem:api/host@1.1.0";

let state = BigInt(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface component-three-api {

world component-three {
// Golem dependencies
import golem:api/host@0.2.0;
import golem:api/host@1.1.0;
import golem:rpc/types@0.1.0;

// WASI dependencies
Expand Down
Loading

0 comments on commit 2d81396

Please sign in to comment.