
![JavaScript Style Guide]
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
$3
| Param | Type | Description |
| --- | --- | --- |
| config |
Object | JSON format configurations for initialization |
$3
Reset this class
Kind: instance method of
SECGroup
| Param | Type | Description |
| --- | --- | --- |
| config |
Object | JSON format configuration |
$3
Generate a group id
Kind: instance method of
SECGroup
$3
This function generates group ids for all the peer nodes
Kind: instance method of
SECGroup
| Param | Type | Description |
| --- | --- | --- |
| peerAddrList |
Array | Peer nodes' address list |
$3
This function returns the group ID for a specific address
Kind: instance method of
SECGroup
| Param | Type | Description |
| --- | --- | --- |
| accAddr |
String | Account address |
$3
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 |
$3
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 |
$3
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
$3
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' |