1.0.2 • Published 5 years ago

egg-eosjs v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

egg-eosjs

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-eosjs --save

Usage

// {app_root}/config/plugin.js
exports.eosjs = {
  enable: true,
  package: 'egg-eosjs',
};

Configuration

Change {app_root}/config/plugin.js to enable egg-eosjs plugin:

exports.eosjs = {
  enable: true,
  package: 'egg-eosjs',
};

connection

Config

// {app_root}/config/config.default.js
exports.eosjs = {
  client:{
  chainId='aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906', // 32 byte (64 char) hex string
  keyProvider=[ '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3' ], // WIF string or array of keys..
  httpEndpoint='http://127.0.0.1:8888'
  }
};

Example

// {app_root}/app/controller/home.js
'use strict';
const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    console.log(this.app.eosjs.getInfo())
  }
}

module.exports = HomeController;

MORE INFO

Please open here.

License

MIT

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago