@sec-block/secjs-group
sec blockchain group ID class
Last updated 2 years ago by zuweihan1992 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @sec-block/secjs-group 
SYNC missed versions from official npm registry.

JavaScript Style Guide

[JavaScript Style Guide]

SECGroup

This package is for SEC blockchain user account group related operations

new SECGroup(config)

Param Type Description
config Object JSON format configurations for initialization

secGroup.reset(config) => None

Reset this class

Kind: instance method of SECGroup

Param Type Description
config Object JSON format configuration

secGroup.generateGroupId() => Number

Generate a group id

Kind: instance method of SECGroup

secGroup.generateGroupIds(peerAddrList) => None

This function generates group ids for all the peer nodes

Kind: instance method of SECGroup

Param Type Description
peerAddrList Array Peer nodes' address list

secGroup.getGroupId(accAddr) => Number

This function returns the group ID for a specific address

Kind: instance method of SECGroup

Param Type Description
accAddr String Account address

secGroup.setGroupId(accAddr, groupId) => None

This function sets the group ID for a specific address

Kind: instance method of SECGroup

Param Type Description
accAddr String Account address
groupId Number Group ID value which will be set to the corresponding account address

secGroup.updateStatisticsDht(peerAccGroupIdDht) => None

This function updates the table which stores the frequency of each group ID generated by its peer nodes

Kind: instance method of SECGroup

Param Type Description
peerAccGroupIdDht Object Other peer nodes generated group ID table

secGroup.setGroupIdDht() => None

This function finally determined the located group ID for each node (unchangable during this working period). If there are two group IDs have the same value, then pick up the smaller one as its group ID

Kind: instance method of SECGroup

secGroup.storeGroupIdTableToFile(file, content) => None

This function writes(appends) the group ID statistics table into a JSON file

Kind: instance method of SECGroup

Param Type Description
file String The json file path and name
content Object Data to be written, default data is 'this.accGroupIdDht'

Current Tags

  • 1.0.3                                ...           latest (2 years ago)

4 Versions

  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |