Skip to content

Commit

Permalink
docs: update starter-kit links
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasvdam committed Sep 20, 2024
1 parent 780eacf commit 5528406
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Collection of packages which allow you to build SEDA Data Requests:

# Quick getting started

The easiest way to get started it by using our [starter kit](https://github.com/sedaprotocol/seda-sdk-starter-template) this has all the tools installed that you need:
The easiest way to get started it by using our [starter kit](https://github.com/sedaprotocol/seda-request-starter-kit) this has all the tools installed that you need:

- AssemblyScript
- JSON-AS
Expand All @@ -47,7 +47,7 @@ For API documentation check [the TypeDocs](https://sedaprotocol.github.io/seda-s
Below is an example of an Oracle Program that retrieves the name of a planet in the SWAPI database.

```ts
import { Process, httpFetch, OracleProgram, Bytes, JSON } from '@seda-protocol/as-sdk/assembly';
import { Process, httpFetch, OracleProgram, Bytes, JSON } from "@seda-protocol/as-sdk/assembly";

// The JSON schema of the response we're expecting, since in AssemblyScript we need to deserialize JSON into structured objects
@json
Expand All @@ -69,7 +69,7 @@ class PlanetProgram extends OracleProgram {
// Exits the program (with an exit code of 0) and sets the Data Request result to the planet name
Process.success(Bytes.fromUtf8String(planet.name));
} else {
Process.error(Bytes.fromUtf8String('Error while fetching'));
Process.error(Bytes.fromUtf8String("Error while fetching"));
}
}
}
Expand All @@ -82,25 +82,25 @@ new PlanetProgram().run();
In order to test this we can use a JS testing suite (we use Bun:test in this repository and the starter kits, but any runner should work). We use the `@seda-protocol/dev-tools` package for this, which runs the Oracle Program in a similar environment as it would on the SEDA network:

```ts
import { executeDrWasm } from '@seda-protocol/dev-tools';
import { readFile } from 'node:fs/promises';
import { executeDrWasm } from "@seda-protocol/dev-tools";
import { readFile } from "node:fs/promises";

const WASM_PATH = 'build/debug.wasm';
const WASM_PATH = "build/debug.wasm";

describe('Oracle Program: execution', () => {
it('should be able to run', async () => {
describe("Oracle Program: execution", () => {
it("should be able to run", async () => {
const wasmBinary = await readFile(WASM_PATH);

// Calls our SEDA VM
const vmResult = await executeDrWasm(
// The wasm file
wasmBinary,
// Inputs for the Oracle Program
Buffer.from('1'),
Buffer.from("1")
);

expect(vmResult.exitCode).toBe(0);
expect(vmResult.resultAsString).toBe('Tatooine');
expect(vmResult.resultAsString).toBe("Tatooine");
});
});
```
2 changes: 1 addition & 1 deletion libs/dev-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The SEDA dev tools includes a CLI to interact with the SEDA chain as well as a c

Command Line Interface (CLI) for the SEDA SDK. Allows you to upload list and show information about Data Request binaries.

This guide assumes you have already a package.json in place and a wasm binary. If not you can use our [starter template](https://github.com/sedaprotocol/seda-sdk-starter-template), which already has all dependencies you need.
This guide assumes you have already a package.json in place and a wasm binary. If not you can use our [starter template](https://github.com/sedaprotocol/seda-request-starter-kit), which already has all dependencies you need.

First add the SEDA SDK dev tools to your `devDependencies`:

Expand Down

0 comments on commit 5528406

Please sign in to comment.