|
1 | | -# Truf Network (TN) SDK |
| 1 | +# TRUF.NETWORK (TN) SDK |
2 | 2 |
|
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. |
4 | 4 |
|
5 | 5 | ## Support |
6 | 6 |
|
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). |
8 | 8 |
|
9 | 9 | ## Quick Start |
10 | 10 |
|
@@ -38,51 +38,21 @@ go get github.com/trufnetwork/sdk-go |
38 | 38 | 3. **Start the Local Node:** |
39 | 39 | ```bash |
40 | 40 | # Start the node in development mode |
41 | | - make dev-start |
| 41 | + task single:start |
42 | 42 | ``` |
43 | 43 |
|
44 | 44 | **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. |
45 | 45 |
|
46 | 46 | 4. **Verify Node Synchronization** |
47 | 47 |
|
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: |
49 | 49 |
|
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 |
84 | 52 | ``` |
85 | 53 |
|
| 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 | + |
86 | 56 | ### Querying Streams from Local Node |
87 | 57 |
|
88 | 58 | Here's an example of querying the AI Index stream from a local node: |
@@ -167,7 +137,7 @@ func main() { |
167 | 137 |
|
168 | 138 | ## Mainnet Network |
169 | 139 |
|
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. |
171 | 141 |
|
172 | 142 | ### Connecting to Mainnet |
173 | 143 |
|
|
0 commit comments