permission: Code and documentation clean up

This commit is contained in:
vsmk98 2019-05-15 17:12:11 +08:00
parent e5b14b0a71
commit 045d936369
7 changed files with 17 additions and 16 deletions

View File

@ -345,7 +345,7 @@ func startNode(ctx *cli.Context, stack *node.Node) {
}
}()
//START - QUORUM Permissioning
//START - QUORUM permission service
go startQuorumPermissionService(ctx, stack)
// Start auxiliary services if enabled
@ -376,7 +376,7 @@ func startNode(ctx *cli.Context, stack *node.Node) {
}
// Starts the permissioning services. services will come up only when
// Starts the permission services. services will come up only when
// geth is brought up in --permissioned mode and permission-config.json is present
func startQuorumPermissionService(ctx *cli.Context, stack *node.Node) {

View File

@ -420,11 +420,11 @@ func (s *QuorumControlsAPI) valSubOrgBreadthDepth(porgId string) (ExecStatus, er
org := types.OrgInfoMap.GetOrg(porgId)
if s.permConfig.SubOrgDepth.Cmp(org.Level) == 0 {
return ErrMaxDepth, errors.New("max depth for suborgs reached")
return ErrMaxDepth, errors.New("max depth for sub orgs reached")
}
if s.permConfig.SubOrgBreadth.Cmp(big.NewInt(int64(len(org.SubOrgList)))) == 0 {
return ErrMaxBreadth, errors.New("max breadth for suborgs reached")
return ErrMaxBreadth, errors.New("max breadth for sub orgs reached")
}
return ExecSuccess, nil

View File

@ -1318,7 +1318,7 @@ func (t *txLookup) Remove(hash common.Hash) {
delete(t.all, hash)
}
// checks if the account is permissioned for transaction
// checks if the account is has the necessary access for the transaction
func checkAccount(fromAcct common.Address, toAcct *common.Address) error {
access := types.GetAcctAccess(fromAcct)

View File

@ -130,8 +130,8 @@ This returns the list of accounts, nodes, roles, and sub organizations linked to
}
```
#### quorumPermission.addOrg
This api can be executed by a network admin account only for proposing a new organization into the network
* Input: Unique alphanumeric organization id, enode id, account id
This api can be executed by a network admin account (`from:` in transactions args) only for proposing a new organization into the network
* Input: Unique alphanumeric organization id, enode id, account id (org admin account)
* Output: Status of the operation
* Example:
```
@ -162,8 +162,8 @@ If there are any pending items for approval, proposal of any new organization wi
```
#### quorumPermission.approveOrg
This api can be executed by a network admin account only for approving a proposed organization into the network.
* Input: Unique organization id, enode id, account id
This api can be executed by a network admin account (`from:` in transactions args) only for approving a proposed organization into the network.
* Input: Unique organization id, enode id, account id (org admin account)
* Output: Status of the operation
* Example:
```

View File

@ -347,7 +347,6 @@ func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode
if d.synchroniseMock != nil {
return d.synchroniseMock(id, hash)
}
// Make sure only one goroutine is ever allowed past this point at once
if !atomic.CompareAndSwapInt32(&d.synchronising, 0, 1) {
return errBusy

View File

@ -23,11 +23,13 @@ nav:
- Raft: Consensus/raft.md
- Istanbul: Consensus/istanbul-rpc-api.md
- Transaction Processing: Transaction Processing/Transaction Processing.md
- Security:
- Security & Permissioning: Security/Security & Permissioning.md
- Permissioning:
- Overview: Permissioning/Overview.md
- Design: Permissioning/Contract Design.md
- Setup: Permissioning/setup.md
- API: Permissioning/Permissioning apis.md
- API: Permissioning/Permissioning apis.md
- Usage: Permissioning/Usage.md
- Privacy:
- Tessera:

View File

@ -99,7 +99,7 @@ func populateConfig(config PermissionLocalConfig) types.PermissionConfig {
}
// function reads the permissions config file passed and populates the
// config structure accrodingly
// config structure accordingly
func ParsePermissionConifg(dir string) (types.PermissionConfig, error) {
fileName := "permission-config.json"
fullPath := filepath.Join(dir, fileName)
@ -133,8 +133,8 @@ func ParsePermissionConifg(dir string) (types.PermissionConfig, error) {
return permConfig, nil
}
// for cases where the node is joining an existing network, permissioning
// service can be brought up only after block syncing is complete. This function
// for cases where the node is joining an existing network, permission service
// can be brought up only after block syncing is complete. This function
// waits for block syncing before the starting permissions
func waitForSync(e *eth.Ethereum) {
for !types.GetSyncStatus() {
@ -147,7 +147,7 @@ func waitForSync(e *eth.Ethereum) {
// Creates the controls structure for permissions
func NewQuorumPermissionCtrl(stack *node.Node, permissionedMode, isRaft bool, pconfig *types.PermissionConfig) (*PermissionCtrl, error) {
// Create a new ethclient to for interfacing with the contract
// Create a new eth client to for interfacing with the contract
stateReader, e, err := CreateEthClient(stack)
waitForSync(e)
if err != nil {
@ -526,7 +526,7 @@ func (p *PermissionCtrl) disconnectNode(enodeId string) {
}
// Thus function checks if the initial network boot up status and if no
// populates permissioning model with details from permission-config.json
// populates permissions model with details from permission-config.json
func (p *PermissionCtrl) populateInitPermissions() error {
auth := bind.NewKeyedTransactor(p.key)
permInterfSession := &pbind.PermInterfaceSession{