You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,17 +25,20 @@ go get github.com/trufnetwork/sdk-go
25
25
### Setting Up a Local Node
26
26
27
27
1.**Prerequisites:**
28
+
28
29
- Docker
29
30
- Docker Compose
30
31
- Git
31
32
32
33
2.**Clone the TN Node Repository:**
34
+
33
35
```bash
34
36
git clone https://github.com/trufnetwork/node.git
35
37
cd node
36
38
```
37
39
38
40
3.**Start the Local Node:**
41
+
39
42
```bash
40
43
# Start the node in development mode
41
44
task single:start
@@ -120,8 +123,8 @@ func main() {
120
123
// Display retrieved records
121
124
fmt.Println("AI Index Records from Local Node:")
122
125
for_, record:=range records {
123
-
fmt.Printf("Event Time: %d, Value: %s\n",
124
-
record.EventTime,
126
+
fmt.Printf("Event Time: %d, Value: %s\n",
127
+
record.EventTime,
125
128
record.Value.String(),
126
129
)
127
130
}
@@ -184,7 +187,7 @@ func main() {
184
187
185
188
-**Primitive Streams**: Direct data sources from providers. Examples include indexes from known sources, aggregation output such as sentiment analysis, and off-chain/on-chain data.
186
189
-**Composed Streams**: Aggregate and process data from multiple streams.
187
-
-**System Streams**: Contract-managed streams audited and accepted by TN governance to ensure quality.
190
+
-**System Streams**: Contract-managed streams audited and accepted by TN governance to ensure quality.
188
191
189
192
See [type of streams](./docs/type-of-streams.md) and [default TN contracts](./docs/contracts.md) guides for more information.
190
193
@@ -231,7 +234,7 @@ The SDK-Go repository is licensed under the Apache License, Version 2.0. See [LI
231
234
232
235
## Stream Creation and Management
233
236
234
-
The TN SDK provides comprehensive support for creating and managing both primitive and composed streams.
237
+
The TN SDK provides comprehensive support for creating and managing both primitive and composed streams.
235
238
236
239
### Primitive Streams
237
240
@@ -295,6 +298,7 @@ For a comprehensive example demonstrating stream creation, taxonomy setup, and d
295
298
- Retrieving composed stream records
296
299
297
300
Key steps include:
301
+
298
302
1. Generating unique stream IDs
299
303
2. Deploying primitive and composed streams
300
304
3. Inserting records into primitive streams
@@ -308,14 +312,17 @@ This example provides a practical walkthrough of creating and managing streams i
308
312
#### Stream Locators
309
313
310
314
A `StreamLocator` is a unique identifier for a stream that consists of two key components:
315
+
311
316
1.`StreamId`: A unique identifier for the stream
312
317
2.`DataProvider`: The Ethereum address of the stream's creator/owner
313
318
314
319
The `OwnStreamLocator()` method is a convenience function that automatically creates a `StreamLocator` using:
320
+
315
321
- The provided `StreamId`
316
322
- The current client's Ethereum address
317
323
318
324
Example:
325
+
319
326
```go
320
327
// Creates a StreamLocator with:
321
328
// - The given stream ID
@@ -330,6 +337,7 @@ This is particularly useful when you're creating and managing your own streams,
330
337
A `DataProvider` is the Ethereum address responsible for creating and managing a stream. When inserting records or performing operations on a stream, you need to specify the data provider's address.
0 commit comments