egg-eosjs
v1.0.2
Published
[![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][codecov-image]][codecov-url] [![David deps][david-image]][david-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![npm download][download-image]][down
Downloads
4
Readme
egg-eosjs
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.