SECGroup
This package is for SEC blockchain user account group related operations
-
SECGroup
- new SECGroup(config)
-
.reset(config) =>
None
-
.generateGroupId() =>
Number
-
.generateGroupIds(peerAddrList) =>
None
-
.getGroupId(accAddr) =>
Number
-
.setGroupId(accAddr, groupId) =>
None
-
.updateStatisticsDht(peerAccGroupIdDht) =>
None
-
.setGroupIdDht() =>
None
-
.storeGroupIdTableToFile(file, content) =>
None
new SECGroup(config)
Param | Type | Description |
---|---|---|
config | Object |
JSON format configurations for initialization |
None
secGroup.reset(config) => Reset this class
Kind: instance method of SECGroup
Param | Type | Description |
---|---|---|
config | Object |
JSON format configuration |
Number
secGroup.generateGroupId() => Generate a group id
Kind: instance method of SECGroup
None
secGroup.generateGroupIds(peerAddrList) => This function generates group ids for all the peer nodes
Kind: instance method of SECGroup
Param | Type | Description |
---|---|---|
peerAddrList | Array |
Peer nodes' address list |
Number
secGroup.getGroupId(accAddr) => This function returns the group ID for a specific address
Kind: instance method of SECGroup
Param | Type | Description |
---|---|---|
accAddr | String |
Account address |
None
secGroup.setGroupId(accAddr, groupId) => 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 |
None
secGroup.updateStatisticsDht(peerAccGroupIdDht) => 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 |
None
secGroup.setGroupIdDht() => 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
None
secGroup.storeGroupIdTableToFile(file, content) => 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' |