From fcd2f8887466ec52f9536817607d5c6e333df206 Mon Sep 17 00:00:00 2001 From: Bach <99306893+Bachamht@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:33:57 +0800 Subject: [PATCH] Update node.js_sdk_quick_start.md (#1792) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update storage_security.md (#1700) * Update storage_security.md 1.在执行bash gen_data_secure_key.sh 127.0.0.1 8150 123456,输入内容有所改变。 2.查看共识(PBFT),需要启动三个及以上节点,原文档只启动了一个节点,无法产生共识 * Update storage_security.md key_manager_url 更改为 key_center_url * Update index.rst (#1788) 修改区块链网络搭建的超链为:<./docs/installation.html>`_ * Update node.js_sdk_quick_start.md * Update storage_security.md * Update index.rst --------- Co-authored-by: userInner <1239989762@qq.com> Co-authored-by: flowerrun <93572056+flowerrun@users.noreply.github.com> Co-authored-by: Kyon <32325790+kyonRay@users.noreply.github.com> --- .../articles/4_tools/44_sdk/node.js_sdk_quick_start.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/2.x/docs/articles/4_tools/44_sdk/node.js_sdk_quick_start.md b/2.x/docs/articles/4_tools/44_sdk/node.js_sdk_quick_start.md index 0d3c0b18d..a3152f3e1 100644 --- a/2.x/docs/articles/4_tools/44_sdk/node.js_sdk_quick_start.md +++ b/2.x/docs/articles/4_tools/44_sdk/node.js_sdk_quick_start.md @@ -66,14 +66,15 @@ Node.js SDK依赖下列软件: ``` const Configuration = require('./nodejs-sdk/packages/api/common/configuration').Configuration; -Configuration.setConfig(path.join(__dirname, args.config)); +const configFilePath = path.join(__dirname, 'Path to config.json'); +const configuration = new Configuration(configFilePath); ``` 2、获取当前块高的API位于Web3jService中,构造一个该对象: ``` const Web3jService = require('./nodejs-sdk/packages/api').Web3jService; -let web3jService = new Web3jService(); +let web3jService = new Web3jService(configuration); ``` 3、调用Web3jService的getBlockNumber接口,获取返回值并在控制台中输出: @@ -110,4 +111,4 @@ Node.js SDK除了提供API外,还提供了一个小巧的CLI工具供用户直 ## 五、Node.js SDK的未来需要你 -当前,Node.js SDK还在成长,在某些地方仍然需要进一步打磨,比如需要CLI工具能够解析SQL语句,或者SDK的性能需要优化……秉承开源的精神,我们相信社区的能量能够将Node.js SDK 变得更加方便易用,欢迎广大开发者踊跃在issue或PR中贡献自己的idea和力量! \ No newline at end of file +当前,Node.js SDK还在成长,在某些地方仍然需要进一步打磨,比如需要CLI工具能够解析SQL语句,或者SDK的性能需要优化……秉承开源的精神,我们相信社区的能量能够将Node.js SDK 变得更加方便易用,欢迎广大开发者踊跃在issue或PR中贡献自己的idea和力量!