Skip to content

Commit 9b267c7

Browse files
committed
more c1 updates
1 parent eac4580 commit 9b267c7

File tree

4 files changed

+37
-23
lines changed

4 files changed

+37
-23
lines changed

docs/protocol/ceramic-one/concepts.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ Consumers can either handle the event `data` payloads directly using their own b
9191
or they can leverage Ceramic's standard data pipeline to combine messages into new forms, including
9292
mutable data structures and other key components of a modern data environment.
9393

94-
## Archival Storage on Recall
94+
## Archival Storage on S3
9595

96-
The Ceramic Network in the context of Recall is a communication, synchronization, and validation for
97-
ephemeral events. While this architecture is intentionally flexible to allow for bespoke molding of
96+
The Ceramic Network is a communication, synchronization, and validation for persistent or ephemeral
97+
events. While this architecture is intentionally flexible to allow for bespoke molding of
9898
custom data pipelines, schema, and other logic, it requires a data availability layer to provide
9999
archival assurances and programmatic access.
100100

@@ -103,7 +103,7 @@ transformations across the Ceramic data pipeline, giving developers access to ra
103103
document states, or custom document states based on bespoke logic developers implement into their
104104
pipelines.
105105

106-
These parquet files containing Ceramic events are stored in Recall buckets. The columnar storage
106+
These parquet files containing Ceramic events are stored in S3 buckets. The columnar storage
107107
format of parquet files is highly efficient for analytical queries, therefore reducing data transfer
108108
and storage costs. Parquet also supports performant compression schemes which reduces file sizes
109109
further without compromising performance.

docs/protocol/ceramic-one/usage/consume.mdx

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ assumes that you've already followed our
1111

1212
:::
1313

14-
Let's explore how use Ceramic to read messages from a stream. Ceramic nodes in the Recall network
14+
Let's explore how use Ceramic to read messages from a stream. Nodes in the Ceramic Network
1515
subscribe to data by expressing an [interest](/docs/protocol/ceramic-one/concepts#interests) in a
1616
given data model. This interest is broadcast to the node's peers in the network, who will then
1717
initiate periodic synchronization of all data conforming to that model via [Recon](#), a protocol
@@ -29,11 +29,15 @@ This method allows end users to register interest in a specific data model withi
2929
network. The model's identifier is, itself, the ID of a stream that defines its schema.
3030

3131
```typescript
32-
// My moddel stream ID
32+
import { CeramicClient, EventsFeedParams } from "@ceramic-sdk/http-client";
33+
34+
const ceramic = new CeramicClient({ url: "http://localhost:5101" });
35+
36+
// My model stream ID
3337
const modelId = "kjzl6hvfrbw6c5i55ks5m4hhyuh0jylw4g7x0asndu97i7luts4dfzvm35oev65";
3438

3539
// Listen to all events written to instances of this modela
36-
await ceramic.registerInterestModel(model);
40+
await ceramic.registerInterestModel(modelId);
3741
```
3842

3943
Upon success, the function won't return anything, but it will throw if there's an issue. You're now
@@ -53,9 +57,9 @@ but we'll define them to illustrate their purpose. If no limit is defined, the S
5357
new events from the resume token.
5458

5559
```typescript
56-
const params: EventFeedParams = {
60+
const params: EventsFeedParams = {
5761
limit: 50,
58-
resumeAt: "myResumeToken", // The resumeToken returned from the last call to `getEventsFeed`
62+
resumeAt: "0", // The resumeToken returned from the last call to `getEventsFeed`
5963
};
6064
```
6165

@@ -92,10 +96,11 @@ type Event = {
9296
};
9397
```
9498

95-
To fetch an event by it's id, we use `getEvent`
99+
To fetch an event by its id, we use `getEvent`:
96100

97101
```typescript
98-
const event = await ceramic.getEvent(myEventId);
102+
const eventId = events.events[0].id; // The ID of the event we want to fetch
103+
const event = await ceramic.getEvent(eventId);
99104
```
100105

101106
There are also a small collection of simple helper functions to extract specific parts of an event.
@@ -105,32 +110,41 @@ There are also a small collection of simple helper functions to extract specific
105110
Extract the data payload from an event.
106111

107112
```typescript
108-
const data = await ceramic.getEventData(myEventId);
113+
const data = await ceramic.getEventData(eventId);
109114
```
110115

111-
This is equivalent to
116+
This is equivalent to:
112117

113118
```typescript
114-
ceramic.getEvent(myEventId).then((event) => event.data);
119+
ceramic.getEvent(eventId).then((event) => event.data);
115120
```
116121

117122
#### `getEventCAR`
118123

119124
Extract the data payload from an event and parse it as a CAR file.
120125

121126
```typescript
122-
const data = await ceramic.getEventCAR(myEventId);
127+
const data = await ceramic.getEventCAR(eventId);
123128
```
124129

125130
`data` will be the parsed payload of the event.
126131

127132
#### `getEventType`
128133

129-
This method is useful for cases where you know the schema of the payload. To use it, you must have a
130-
[codeco](https://github.com/ceramicnetwork/codeco) codec handy.
134+
This method is useful for cases where you know the schema of the payload. To use it, you must have the
135+
[codeco](https://github.com/ceramicnetwork/codeco) package and your codec handy.
136+
137+
```bash
138+
npm install --save codeco
139+
```
140+
141+
Then, you can use it like this:
131142

132143
```typescript
144+
import { Decoder } from "codeco";
145+
133146
type MyPayload = /* ... */;
134147
const decoder: Decoder<unknown, MyPayload> = /* ... */;
135-
const data: MyPayload = await ceramic.getEventType(decoder, myEventId);
148+
149+
const data: MyPayload = await ceramic.getEventType(decoder, eventId);
136150
```

docs/protocol/ceramic-one/usage/installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The SDK is written in TypeScript and published to NPM as `@ceramic-sdk`, with a
1212
sub-packages:
1313

1414
- `@ceramic-sdk/events`: Utilities for creating and signing events that comply to the
15-
[Recall Event Store standards.](https://developers.ceramic.network/docs/protocol/js-ceramic/streams/event-log)
15+
[Ceramic Event Log specifications](https://developers.ceramic.network/docs/protocol/js-ceramic/streams/event-log)
1616
- `@ceramic-sdk/http-client`: A simple client for
1717
[ceramic-one's](https://github.com/ceramicnetwork/rust-ceramic) HTTP APIs.
1818
- `@ceramic-sdk/identifiers`: A handful of useful types for identifying streams and events.

docs/protocol/ceramic-one/usage/query.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ queried and transmitted efficiently, ideal for intense data workloads.
4545

4646
The `@ceramic-sdk/flight-sql-client` is a package designed to run server-side only. Using this
4747
client needs a [ceramic-one](https://github.com/ceramicnetwork/rust-ceramic) daemon running with
48-
experimental flags which point to your Recall-S3 adapter:
48+
experimental flags which point to your S3 bucket:
4949

5050
```bash
51-
ceramic-one -- daemon --experimental-features --flight-sql-bind-address 0.0.0.0:5102 --s3-bucket your-recall-account.your-bucket-name
51+
ceramic-one -- daemon --experimental-features --flight-sql-bind-address 0.0.0.0:5102 --object-store-url s3://your-bucket-name
5252
```
5353

5454
### Install the flight-sql package
5555

5656
```bash
57-
npm install --save @ceramic-sdk/flight-sql-client
57+
npm install --save @ceramic-sdk/flight-sql-client apache-arrow
5858
```
5959

6060
### Create a client instance
@@ -79,7 +79,7 @@ const client = await createFlightSqlClient(OPTIONS);
7979
### Execute a query
8080

8181
```typescript
82-
const buffer = await client.preparedStatement(
82+
const buffer = await client.preparedQuery(
8383
"SELECT * from conclusion_events where stream_type = $1",
8484
new Array(["$1", "3"])
8585
);

0 commit comments

Comments
 (0)