Giter Club home page Giter Club logo

fisco-bcos's Introduction

FISCO BCOS Node.js SDK

Node.js SDK为联盟链平台 FISCO BCOS 提供面向Node.js语言的应用程序接口,使用 Node.js SDK 可以简单快捷地开发基于 FISCO-BCOS 的 Node.js 应用。Node.js SDK 仅支持 v2.0.0 及以上版本的 FISCO BCOS

一、文档说明

本项目基于 FISCO-BCOS/nodejs-sdk 修改,并删除了 cli 部分,具体使用请查看官方文档

二、使用示例

安装 fisco-bcos sdk

npm install fisco-bcos --save

创建配置文件 config.json

{
    "encryptType": "ECDSA",
    "accounts": {
        "mmt": {
            "type": "pem",
            "value": "./accounts/xxx.pem"
        }
    },
    "nodes": [
        {
            "ip": "127.0.0.1",
            "port": "20200"
        }
    ],
    "authentication": {
        "key": "./sdk/sdk.key",
        "cert": "./sdk/sdk.crt",
        "ca": "./sdk/ca.crt"
    },
    "groupID": 1,
    "chainID": 1,
    "timeout": 30000
}

使用方法

const fisco = require('fisco-bcos');
const path = require('path');

const config = new fisco.Configuration(path.resolve('./config.json'));
const webj3 = new fisco.Web3jService(config);

(async () => {
  const result = await webj3.getTotalTransactionCount();
  console.log(result);
})();

三、License

Node.js SDK 的开源协议为 APACHE LICENSE, VERSION 2.0,详情请参考 LICENSE

fisco-bcos's People

Contributors

bxq2011hust avatar dependabot[bot] avatar haoxuan40404 avatar jiahonzheng avatar leayingly avatar longdacao avatar rexsea avatar sfsw avatar tom112233 avatar tumobi avatar vita-dounai avatar wangxingaoyan avatar yangshu502 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.