Skip to content

Commit 90336b5

Browse files
authored
fix: correct wrong command and delete wrong function from README (#123)
1 parent f709f0f commit 90336b5

File tree

2 files changed

+14
-44
lines changed

2 files changed

+14
-44
lines changed

README.md

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Truf Network (TN) SDK
1+
# TRUF.NETWORK (TN) SDK
22

3-
The Truf Node SDK provides developers with tools to interact with the Truf Network, a decentralized platform for publishing, composing, and consuming economic data streams.
3+
The TRUF.NETWORK SDK provides developers with tools to interact with the TRUF.NETWORK, a decentralized platform for publishing, composing, and consuming economic data streams.
44

55
## Support
66

7-
This documentation is a work in progress. If you need help, don't hesitate to [open an issue](https://github.com/trufnetwork/sdk-go/issues).
7+
If you need help, don't hesitate to [open an issue](https://github.com/trufnetwork/sdk-go/issues).
88

99
## Quick Start
1010

@@ -38,51 +38,21 @@ go get github.com/trufnetwork/sdk-go
3838
3. **Start the Local Node:**
3939
```bash
4040
# Start the node in development mode
41-
make dev-start
41+
task single:start
4242
```
4343

4444
**Note:** Setting up a local node as described above will initialize an empty database. This setup is primarily for testing the technology or development purposes. If you are a node operator and wish to sync with the Truf Network to access real data, please follow the [Node Operator Guide](https://github.com/trufnetwork/node/blob/main/docs/node-operator-guide.md) for instructions on connecting to the network and syncing data.
4545

4646
4. **Verify Node Synchronization**
4747

48-
When running a local node, it's crucial to ensure it's fully synchronized before querying data. Use the following example to check node status:
48+
When running a local node, it's crucial to ensure it's fully synchronized before querying data. If you are running as a node operator or are connected to the network, use the following command to check node status:
4949

50-
```go
51-
package main
52-
53-
import (
54-
"context"
55-
"fmt"
56-
"log"
57-
58-
"github.com/trufnetwork/sdk-go/core/tnclient"
59-
)
60-
61-
func main() {
62-
ctx := context.Background()
63-
64-
// Connect to local node
65-
client, err := tnclient.NewClient(
66-
ctx,
67-
"http://localhost:8484", // Local node endpoint
68-
// Add signer if needed
69-
)
70-
if err != nil {
71-
log.Fatalf("Failed to create client: %v", err)
72-
}
73-
74-
// Check node synchronization
75-
nodeInfo, err := client.GetNodeInfo(ctx)
76-
if err != nil {
77-
log.Fatalf("Failed to get node info: %v", err)
78-
}
79-
80-
fmt.Printf("Node Synchronization Status:\n")
81-
fmt.Printf("Current Block Height: %d\n", nodeInfo.BlockHeight)
82-
fmt.Printf("Network: %s\n", nodeInfo.NetworkName)
83-
}
50+
```bash
51+
kwild admin status
8452
```
8553

54+
**Note:** If you are running a setup without operating as a node operator or connecting to the network, this command is not needed.
55+
8656
### Querying Streams from Local Node
8757

8858
Here's an example of querying the AI Index stream from a local node:
@@ -167,7 +137,7 @@ func main() {
167137

168138
## Mainnet Network
169139

170-
We have a mainnet network accessible at https://gateway.mainnet.truf.network. You can interact with it to test and experiment with the TN SDK. Please use it responsibly, as TN is currently in an experimental phase. Any contributions and feedback are welcome.
140+
We have a mainnet network accessible at https://gateway.mainnet.truf.network. You can interact with it to test and experiment with the TN SDK. Please use it responsibly. Any contributions and feedback are welcome.
171141

172142
### Connecting to Mainnet
173143

examples/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ func main() {
4646

4747
// 4. Load composed actions and retrieve records
4848
// Note: AI Index is a composed stream that aggregates data from multiple primitive streams
49-
primitiveActions, err := tnClient.LoadComposedActions()
49+
composedActions, err := tnClient.LoadComposedActions()
5050
if err != nil {
5151
log.Fatalf("Failed to load primitive actions: %v", err)
5252
}
5353

54-
records, err := primitiveActions.GetRecord(ctx, types.GetRecordInput{
54+
records, err := composedActions.GetRecord(ctx, types.GetRecordInput{
5555
DataProvider: dataProvider,
5656
StreamId: streamId,
5757
From: &fromTime,
@@ -65,8 +65,8 @@ func main() {
6565
fmt.Println("\nAI Index Records:")
6666
fmt.Println("----------------------------")
6767
for _, record := range records {
68-
fmt.Printf("Event Time: %d, Value: %s\n",
69-
record.EventTime,
68+
fmt.Printf("Event Time: %d, Value: %s\n",
69+
record.EventTime,
7070
record.Value.String(),
7171
)
7272
}

0 commit comments

Comments
 (0)