Wondering what’s next for npm?Check out our public roadmap! »

    @sec-block/secjs-group

    1.0.3 • Public • Published

    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'

    Install

    npm i @sec-block/secjs-group

    DownloadsWeekly Downloads

    1

    Version

    1.0.3

    License

    ISC

    Unpacked Size

    19.8 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar