Skip to content

Commit

Permalink
doc: remove outdated shwap note and link to changelog for js (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvolin authored Feb 4, 2025
1 parent 5238f76 commit 8e5caf3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ Supported features:
- Backward and forward Data Availability Sampling
- Native and browser persistent storage
- Streaming events happening on the node
- Native and wasm library, embed the node anywhere
- Native, wasm and uniffi libraries, embed the node anywhere
- Integration tests with Go implementation

> [!NOTE]
> Lumina implements [`shwap`](https://github.com/celestiaorg/CIPs/blob/main/cips/cip-19.md) protocol to perform DASing,
which is not yet enabled on all networks in the Go implementation. This means that even though Lumina will be sampling all
blocks, the network is unlikely to provide the requested data yet. Shwap is going to become the main DASing protocol in
the upcoming celestia-node versions.

## Installing the node

### Installing with cargo
Expand Down
17 changes: 12 additions & 5 deletions node-wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
A compatibility layer for the [`Lumina`](https://github.com/eigerco/lumina) node to
work within a browser environment and be operable with javascript.

# Changelog

You can find about the latest changes [here](https://github.com/eigerco/lumina/blob/main/node-wasm/CHANGELOG.md).

# Example
Starting lumina inside a dedicated worker

```javascript
import { spawnNode, NodeConfig, Network } from "lumina-node";
import { spawnNode, Network, NodeConfig } from "lumina-node";

const node = await spawnNode();
const mainnetConfig = NodeConfig.default(Network.Mainnet);
Expand All @@ -20,12 +24,12 @@ await node.requestHeadHeader();

## Manual setup

Note that `spawnNode` implicitly calls wasm initialisation code. If you want to set things up manually, make sure to call the default export before using any of the wasm functionality.
`spawnNode` sets up a `DedicatedWorker` instance and runs `NodeWorker` there. If you want to set things up manually
you need to connect client and worker using objects that have `MessagePort` interface.

```javascript
import init, { NodeConfig, Network } from "lumina-node";
import { Network, NodeClient, NodeConfig, NodeWorker } from "lumina-node";

await init();
const config = NodeConfig.default(Network.Mainnet);

// client and worker accept any object with MessagePort like interface e.g. Worker
Expand All @@ -43,5 +47,8 @@ await client.requestHeadHeader();

## Rust API

For comprehensive and fully typed interface documentation, see [lumina-node](https://docs.rs/lumina-node/latest/lumina_node/) and [celestia-types](https://docs.rs/celestia-types/latest/celestia_types/) documentation on docs.rs. You can see there the exact structure of more complex types, such as [`ExtendedHeader`](https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html). JavaScript API's goal is to provide similar interface to Rust when possible, e.g. `NodeClient` mirrors [`Node`](https://docs.rs/lumina-node/latest/lumina_node/node/struct.Node.html).
For comprehensive and fully typed interface documentation, see [lumina-node](https://docs.rs/lumina-node/latest/lumina_node/)
and [celestia-types](https://docs.rs/celestia-types/latest/celestia_types/) documentation on docs.rs.
You can see there the exact structure of more complex types, such as [`ExtendedHeader`](https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html).
JavaScript API's goal is to provide similar interface to Rust when possible, e.g. `NodeClient` mirrors [`Node`](https://docs.rs/lumina-node/latest/lumina_node/node/struct.Node.html).

0 comments on commit 8e5caf3

Please sign in to comment.