@@ -47,7 +47,7 @@ import { Client, TokenService, Wallet } from '@weisyn/client-sdk-js';
4747
4848// 1. 初始化客户端
4949const client = new Client ({
50- endpoint: ' http://localhost:8545 ' ,
50+ endpoint: ' http://localhost:28680 ' ,
5151 protocol: ' http' ,
5252});
5353
@@ -81,7 +81,7 @@ console.log(`转账成功!交易哈希: ${result.txHash}`);
8181 const { Client , TokenService , Wallet } = WESClientSDK;
8282
8383 const client = new Client ({
84- endpoint: ' http://localhost:8545 ' ,
84+ endpoint: ' http://localhost:28680 ' ,
8585 protocol: ' http' ,
8686 });
8787
@@ -102,14 +102,14 @@ SDK 支持两种传输协议(浏览器环境不支持 gRPC):
102102``` typescript
103103// HTTP 客户端(最常用)
104104const client = new Client ({
105- endpoint: ' http://localhost:8545 ' ,
105+ endpoint: ' http://localhost:28680 ' ,
106106 protocol: ' http' ,
107107 timeout: 30000 ,
108108});
109109
110110// WebSocket 客户端(用于事件订阅)
111111const wsClient = new Client ({
112- endpoint: ' ws://localhost:8081 ' ,
112+ endpoint: ' ws://localhost:28681 ' ,
113113 protocol: ' websocket' ,
114114});
115115```
@@ -123,7 +123,7 @@ import { WESClient } from '@weisyn/client-sdk-js';
123123
124124// 创建 WESClient
125125const wesClient = new WESClient ({
126- endpoint: ' http://localhost:8545 ' ,
126+ endpoint: ' http://localhost:28680 ' ,
127127 protocol: ' http' ,
128128});
129129
@@ -215,18 +215,18 @@ sequenceDiagram
215215``` typescript
216216// 单客户端模式
217217const client = new Client ({
218- endpoint: ' http://localhost:8545 ' ,
218+ endpoint: ' http://localhost:28680 ' ,
219219 protocol: ' http' ,
220220});
221221
222222// 多客户端模式(HTTP + WebSocket)
223223const httpClient = new Client ({
224- endpoint: ' http://localhost:8545 ' ,
224+ endpoint: ' http://localhost:28680 ' ,
225225 protocol: ' http' ,
226226});
227227
228228const wsClient = new Client ({
229- endpoint: ' ws://localhost:8081 ' ,
229+ endpoint: ' ws://localhost:28681 ' ,
230230 protocol: ' websocket' ,
231231});
232232```
@@ -300,7 +300,7 @@ try {
300300``` typescript
301301// 使用 WebSocket 客户端订阅事件
302302const wsClient = new WESClient ({
303- endpoint: ' ws://localhost:8081 ' ,
303+ endpoint: ' ws://localhost:28681 ' ,
304304 protocol: ' websocket' ,
305305});
306306
@@ -468,7 +468,7 @@ const result = await resourceService.deployContract({
468468``` typescript
469469// 创建 WebSocket 客户端
470470const wsClient = new WESClient ({
471- endpoint: ' ws://localhost:8081 ' ,
471+ endpoint: ' ws://localhost:28681 ' ,
472472 protocol: ' websocket' ,
473473});
474474
@@ -524,7 +524,7 @@ type WESClientErrorCode =
524524``` typescript
525525// HTTP 客户端自动管理连接
526526const client = new Client ({
527- endpoint: ' http://localhost:8545 ' ,
527+ endpoint: ' http://localhost:28680 ' ,
528528 protocol: ' http' ,
529529 timeout: 30000 ,
530530});
@@ -550,7 +550,7 @@ import { Client, TokenService, Wallet, WESClient } from '@weisyn/client-sdk-js';
550550
551551// 类型安全
552552const client: Client = new Client ({
553- endpoint: ' http://localhost:8545 ' ,
553+ endpoint: ' http://localhost:28680 ' ,
554554 protocol: ' http' ,
555555});
556556
@@ -578,7 +578,7 @@ if (typeof window !== 'undefined') {
578578``` typescript
579579// 确保节点 API 支持 CORS
580580const client = new Client ({
581- endpoint: ' https://api.example.com:8545 ' , // 使用 HTTPS
581+ endpoint: ' https://api.example.com:28680 ' , // 使用 HTTPS
582582 protocol: ' http' ,
583583});
584584```
0 commit comments