mirror of https://github.com/poanetwork/quorum.git
permission: modify event handling
This commit is contained in:
parent
07f26bdb6c
commit
293370cb94
|
@ -28,7 +28,7 @@ var (
|
|||
)
|
||||
|
||||
// AcctManagerABI is the input ABI used to generate the binding from.
|
||||
const AcctManagerABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"_acct\",\"type\":\"address\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"checkOrgAdmin\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_acct\",\"type\":\"address\"}],\"name\":\"getAccountDetails\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_roleId\",\"type\":\"string\"}],\"name\":\"assignAccountRole\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumberOfAccounts\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_acct\",\"type\":\"address\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"valAcctAccessChange\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_acct\",\"type\":\"address\"}],\"name\":\"getAccountRole\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"orgAdminExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"aIndex\",\"type\":\"uint256\"}],\"name\":\"getAccountDetailsFromIndex\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"addNWAdminAccount\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_nwAdminRole\",\"type\":\"string\"},{\"name\":\"_oAdminRole\",\"type\":\"string\"}],\"name\":\"setDefaults\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"approveOrgAdminAccount\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"revokeAccountRole\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_permUpgradable\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_roleId\",\"type\":\"string\"}],\"name\":\"AccountAccessModified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_roleId\",\"type\":\"string\"}],\"name\":\"AccountAccessRevoked\",\"type\":\"event\"}]"
|
||||
const AcctManagerABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"_acct\",\"type\":\"address\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"checkOrgAdmin\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_acct\",\"type\":\"address\"}],\"name\":\"getAccountDetails\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_roleId\",\"type\":\"string\"}],\"name\":\"assignAccountRole\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumberOfAccounts\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_acct\",\"type\":\"address\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"valAcctAccessChange\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_acct\",\"type\":\"address\"}],\"name\":\"getAccountRole\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"orgAdminExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"aIndex\",\"type\":\"uint256\"}],\"name\":\"getAccountDetailsFromIndex\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"addNWAdminAccount\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_nwAdminRole\",\"type\":\"string\"},{\"name\":\"_oAdminRole\",\"type\":\"string\"}],\"name\":\"setDefaults\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"approveOrgAdminAccount\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"revokeAccountRole\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_permUpgradable\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_roleId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgAdmin\",\"type\":\"bool\"}],\"name\":\"AccountAccessModified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_roleId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgAdmin\",\"type\":\"bool\"}],\"name\":\"AccountAccessRevoked\",\"type\":\"event\"}]"
|
||||
|
||||
// AcctManager is an auto generated Go binding around an Ethereum contract.
|
||||
type AcctManager struct {
|
||||
|
@ -549,13 +549,15 @@ func (it *AcctManagerAccountAccessModifiedIterator) Close() error {
|
|||
// AcctManagerAccountAccessModified represents a AccountAccessModified event raised by the AcctManager contract.
|
||||
type AcctManagerAccountAccessModified struct {
|
||||
Address common.Address
|
||||
OrgId string
|
||||
RoleId string
|
||||
OrgAdmin bool
|
||||
Raw types.Log // Blockchain specific contextual infos
|
||||
}
|
||||
|
||||
// FilterAccountAccessModified is a free log retrieval operation binding the contract event 0xa27a0cd7d388ec744cb7682bd572d61c79f31251ceb87a4a81be026d2cb8a466.
|
||||
// FilterAccountAccessModified is a free log retrieval operation binding the contract event 0x0bb794229c395f517356b6da8c38dd52b0bca8356b7f56e5d4dcdf82609664e6.
|
||||
//
|
||||
// Solidity: e AccountAccessModified(_address address, _roleId string)
|
||||
// Solidity: e AccountAccessModified(_address address, _orgId string, _roleId string, _orgAdmin bool)
|
||||
func (_AcctManager *AcctManagerFilterer) FilterAccountAccessModified(opts *bind.FilterOpts) (*AcctManagerAccountAccessModifiedIterator, error) {
|
||||
|
||||
logs, sub, err := _AcctManager.contract.FilterLogs(opts, "AccountAccessModified")
|
||||
|
@ -565,9 +567,9 @@ func (_AcctManager *AcctManagerFilterer) FilterAccountAccessModified(opts *bind.
|
|||
return &AcctManagerAccountAccessModifiedIterator{contract: _AcctManager.contract, event: "AccountAccessModified", logs: logs, sub: sub}, nil
|
||||
}
|
||||
|
||||
// WatchAccountAccessModified is a free log subscription operation binding the contract event 0xa27a0cd7d388ec744cb7682bd572d61c79f31251ceb87a4a81be026d2cb8a466.
|
||||
// WatchAccountAccessModified is a free log subscription operation binding the contract event 0x0bb794229c395f517356b6da8c38dd52b0bca8356b7f56e5d4dcdf82609664e6.
|
||||
//
|
||||
// Solidity: e AccountAccessModified(_address address, _roleId string)
|
||||
// Solidity: e AccountAccessModified(_address address, _orgId string, _roleId string, _orgAdmin bool)
|
||||
func (_AcctManager *AcctManagerFilterer) WatchAccountAccessModified(opts *bind.WatchOpts, sink chan<- *AcctManagerAccountAccessModified) (event.Subscription, error) {
|
||||
|
||||
logs, sub, err := _AcctManager.contract.WatchLogs(opts, "AccountAccessModified")
|
||||
|
@ -672,13 +674,15 @@ func (it *AcctManagerAccountAccessRevokedIterator) Close() error {
|
|||
// AcctManagerAccountAccessRevoked represents a AccountAccessRevoked event raised by the AcctManager contract.
|
||||
type AcctManagerAccountAccessRevoked struct {
|
||||
Address common.Address
|
||||
OrgId string
|
||||
RoleId string
|
||||
OrgAdmin bool
|
||||
Raw types.Log // Blockchain specific contextual infos
|
||||
}
|
||||
|
||||
// FilterAccountAccessRevoked is a free log retrieval operation binding the contract event 0x9a957b8ffb4a984143ede8cab7c400c5956df3ee801159283039d401e18b365a.
|
||||
// FilterAccountAccessRevoked is a free log retrieval operation binding the contract event 0x6b5105396435a8a139aeed682dd573cd2a7e6279de77f8c11f95a30399212ad1.
|
||||
//
|
||||
// Solidity: e AccountAccessRevoked(_address address, _roleId string)
|
||||
// Solidity: e AccountAccessRevoked(_address address, _orgId string, _roleId string, _orgAdmin bool)
|
||||
func (_AcctManager *AcctManagerFilterer) FilterAccountAccessRevoked(opts *bind.FilterOpts) (*AcctManagerAccountAccessRevokedIterator, error) {
|
||||
|
||||
logs, sub, err := _AcctManager.contract.FilterLogs(opts, "AccountAccessRevoked")
|
||||
|
@ -688,9 +692,9 @@ func (_AcctManager *AcctManagerFilterer) FilterAccountAccessRevoked(opts *bind.F
|
|||
return &AcctManagerAccountAccessRevokedIterator{contract: _AcctManager.contract, event: "AccountAccessRevoked", logs: logs, sub: sub}, nil
|
||||
}
|
||||
|
||||
// WatchAccountAccessRevoked is a free log subscription operation binding the contract event 0x9a957b8ffb4a984143ede8cab7c400c5956df3ee801159283039d401e18b365a.
|
||||
// WatchAccountAccessRevoked is a free log subscription operation binding the contract event 0x6b5105396435a8a139aeed682dd573cd2a7e6279de77f8c11f95a30399212ad1.
|
||||
//
|
||||
// Solidity: e AccountAccessRevoked(_address address, _roleId string)
|
||||
// Solidity: e AccountAccessRevoked(_address address, _orgId string, _roleId string, _orgAdmin bool)
|
||||
func (_AcctManager *AcctManagerFilterer) WatchAccountAccessRevoked(opts *bind.WatchOpts, sink chan<- *AcctManagerAccountAccessRevoked) (event.Subscription, error) {
|
||||
|
||||
logs, sub, err := _AcctManager.contract.WatchLogs(opts, "AccountAccessRevoked")
|
||||
|
|
|
@ -28,7 +28,7 @@ var (
|
|||
)
|
||||
|
||||
// NodeManagerABI is the input ABI used to generate the binding from.
|
||||
const NodeManagerABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_status\",\"type\":\"uint256\"}],\"name\":\"updateNodeStatus\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"}],\"name\":\"getNodeStatus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"enodeId\",\"type\":\"string\"}],\"name\":\"getNodeDetails\",\"outputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_nodeStatus\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"addOrgNode\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"approveNode\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nodeIndex\",\"type\":\"uint256\"}],\"name\":\"getNodeDetailsFromIndex\",\"outputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_nodeStatus\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"addNode\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumberOfNodes\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"addAdminNode\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_permUpgradable\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_enodeId\",\"type\":\"string\"}],\"name\":\"NodeProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_enodeId\",\"type\":\"string\"}],\"name\":\"NodeApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_enodeId\",\"type\":\"string\"}],\"name\":\"NodeDeactivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_enodeId\",\"type\":\"string\"}],\"name\":\"NodeActivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_enodeId\",\"type\":\"string\"}],\"name\":\"NodeBlacklisted\",\"type\":\"event\"}]"
|
||||
const NodeManagerABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_status\",\"type\":\"uint256\"}],\"name\":\"updateNodeStatus\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"}],\"name\":\"getNodeStatus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"enodeId\",\"type\":\"string\"}],\"name\":\"getNodeDetails\",\"outputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_nodeStatus\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"addOrgNode\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"approveNode\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nodeIndex\",\"type\":\"uint256\"}],\"name\":\"getNodeDetailsFromIndex\",\"outputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_nodeStatus\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"addNode\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumberOfNodes\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_enodeId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"addAdminNode\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_permUpgradable\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_enodeId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"NodeProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_enodeId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"NodeApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_enodeId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"NodeDeactivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_enodeId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"NodeActivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_enodeId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"NodeBlacklisted\",\"type\":\"event\"}]"
|
||||
|
||||
// NodeManager is an auto generated Go binding around an Ethereum contract.
|
||||
type NodeManager struct {
|
||||
|
@ -479,12 +479,13 @@ func (it *NodeManagerNodeActivatedIterator) Close() error {
|
|||
// NodeManagerNodeActivated represents a NodeActivated event raised by the NodeManager contract.
|
||||
type NodeManagerNodeActivated struct {
|
||||
EnodeId string
|
||||
OrgId string
|
||||
Raw types.Log // Blockchain specific contextual infos
|
||||
}
|
||||
|
||||
// FilterNodeActivated is a free log retrieval operation binding the contract event 0xeee4ff0a0bd593fd1a0d7504eca37b4027b72bc4cc3df6bf3d1c7e27848d279e.
|
||||
// FilterNodeActivated is a free log retrieval operation binding the contract event 0x49796be3ca168a59c8ae46c75a36a9bb3a84753d3e12a812f93ae010e783b14f.
|
||||
//
|
||||
// Solidity: e NodeActivated(_enodeId string)
|
||||
// Solidity: e NodeActivated(_enodeId string, _orgId string)
|
||||
func (_NodeManager *NodeManagerFilterer) FilterNodeActivated(opts *bind.FilterOpts) (*NodeManagerNodeActivatedIterator, error) {
|
||||
|
||||
logs, sub, err := _NodeManager.contract.FilterLogs(opts, "NodeActivated")
|
||||
|
@ -494,9 +495,9 @@ func (_NodeManager *NodeManagerFilterer) FilterNodeActivated(opts *bind.FilterOp
|
|||
return &NodeManagerNodeActivatedIterator{contract: _NodeManager.contract, event: "NodeActivated", logs: logs, sub: sub}, nil
|
||||
}
|
||||
|
||||
// WatchNodeActivated is a free log subscription operation binding the contract event 0xeee4ff0a0bd593fd1a0d7504eca37b4027b72bc4cc3df6bf3d1c7e27848d279e.
|
||||
// WatchNodeActivated is a free log subscription operation binding the contract event 0x49796be3ca168a59c8ae46c75a36a9bb3a84753d3e12a812f93ae010e783b14f.
|
||||
//
|
||||
// Solidity: e NodeActivated(_enodeId string)
|
||||
// Solidity: e NodeActivated(_enodeId string, _orgId string)
|
||||
func (_NodeManager *NodeManagerFilterer) WatchNodeActivated(opts *bind.WatchOpts, sink chan<- *NodeManagerNodeActivated) (event.Subscription, error) {
|
||||
|
||||
logs, sub, err := _NodeManager.contract.WatchLogs(opts, "NodeActivated")
|
||||
|
@ -601,12 +602,13 @@ func (it *NodeManagerNodeApprovedIterator) Close() error {
|
|||
// NodeManagerNodeApproved represents a NodeApproved event raised by the NodeManager contract.
|
||||
type NodeManagerNodeApproved struct {
|
||||
EnodeId string
|
||||
OrgId string
|
||||
Raw types.Log // Blockchain specific contextual infos
|
||||
}
|
||||
|
||||
// FilterNodeApproved is a free log retrieval operation binding the contract event 0xc8f0c6e7f31c7ba4e6e29615ae2ab658fdda704c49912bb6118db07a4c36d478.
|
||||
// FilterNodeApproved is a free log retrieval operation binding the contract event 0x0413ce00d5de406d9939003416263a7530eaeb13f9d281c8baeba1601def960d.
|
||||
//
|
||||
// Solidity: e NodeApproved(_enodeId string)
|
||||
// Solidity: e NodeApproved(_enodeId string, _orgId string)
|
||||
func (_NodeManager *NodeManagerFilterer) FilterNodeApproved(opts *bind.FilterOpts) (*NodeManagerNodeApprovedIterator, error) {
|
||||
|
||||
logs, sub, err := _NodeManager.contract.FilterLogs(opts, "NodeApproved")
|
||||
|
@ -616,9 +618,9 @@ func (_NodeManager *NodeManagerFilterer) FilterNodeApproved(opts *bind.FilterOpt
|
|||
return &NodeManagerNodeApprovedIterator{contract: _NodeManager.contract, event: "NodeApproved", logs: logs, sub: sub}, nil
|
||||
}
|
||||
|
||||
// WatchNodeApproved is a free log subscription operation binding the contract event 0xc8f0c6e7f31c7ba4e6e29615ae2ab658fdda704c49912bb6118db07a4c36d478.
|
||||
// WatchNodeApproved is a free log subscription operation binding the contract event 0x0413ce00d5de406d9939003416263a7530eaeb13f9d281c8baeba1601def960d.
|
||||
//
|
||||
// Solidity: e NodeApproved(_enodeId string)
|
||||
// Solidity: e NodeApproved(_enodeId string, _orgId string)
|
||||
func (_NodeManager *NodeManagerFilterer) WatchNodeApproved(opts *bind.WatchOpts, sink chan<- *NodeManagerNodeApproved) (event.Subscription, error) {
|
||||
|
||||
logs, sub, err := _NodeManager.contract.WatchLogs(opts, "NodeApproved")
|
||||
|
@ -723,12 +725,13 @@ func (it *NodeManagerNodeBlacklistedIterator) Close() error {
|
|||
// NodeManagerNodeBlacklisted represents a NodeBlacklisted event raised by the NodeManager contract.
|
||||
type NodeManagerNodeBlacklisted struct {
|
||||
EnodeId string
|
||||
OrgId string
|
||||
Raw types.Log // Blockchain specific contextual infos
|
||||
}
|
||||
|
||||
// FilterNodeBlacklisted is a free log retrieval operation binding the contract event 0xf97ae29ad6493ecc1ebba750b96015715fca52d1f0160b48f39788cbc6204a8e.
|
||||
// FilterNodeBlacklisted is a free log retrieval operation binding the contract event 0x4714623279994517c446c8fb72c3fdaca26434da1e2490d3976fe0cd880cfa7a.
|
||||
//
|
||||
// Solidity: e NodeBlacklisted(_enodeId string)
|
||||
// Solidity: e NodeBlacklisted(_enodeId string, _orgId string)
|
||||
func (_NodeManager *NodeManagerFilterer) FilterNodeBlacklisted(opts *bind.FilterOpts) (*NodeManagerNodeBlacklistedIterator, error) {
|
||||
|
||||
logs, sub, err := _NodeManager.contract.FilterLogs(opts, "NodeBlacklisted")
|
||||
|
@ -738,9 +741,9 @@ func (_NodeManager *NodeManagerFilterer) FilterNodeBlacklisted(opts *bind.Filter
|
|||
return &NodeManagerNodeBlacklistedIterator{contract: _NodeManager.contract, event: "NodeBlacklisted", logs: logs, sub: sub}, nil
|
||||
}
|
||||
|
||||
// WatchNodeBlacklisted is a free log subscription operation binding the contract event 0xf97ae29ad6493ecc1ebba750b96015715fca52d1f0160b48f39788cbc6204a8e.
|
||||
// WatchNodeBlacklisted is a free log subscription operation binding the contract event 0x4714623279994517c446c8fb72c3fdaca26434da1e2490d3976fe0cd880cfa7a.
|
||||
//
|
||||
// Solidity: e NodeBlacklisted(_enodeId string)
|
||||
// Solidity: e NodeBlacklisted(_enodeId string, _orgId string)
|
||||
func (_NodeManager *NodeManagerFilterer) WatchNodeBlacklisted(opts *bind.WatchOpts, sink chan<- *NodeManagerNodeBlacklisted) (event.Subscription, error) {
|
||||
|
||||
logs, sub, err := _NodeManager.contract.WatchLogs(opts, "NodeBlacklisted")
|
||||
|
@ -845,12 +848,13 @@ func (it *NodeManagerNodeDeactivatedIterator) Close() error {
|
|||
// NodeManagerNodeDeactivated represents a NodeDeactivated event raised by the NodeManager contract.
|
||||
type NodeManagerNodeDeactivated struct {
|
||||
EnodeId string
|
||||
OrgId string
|
||||
Raw types.Log // Blockchain specific contextual infos
|
||||
}
|
||||
|
||||
// FilterNodeDeactivated is a free log retrieval operation binding the contract event 0xb4551525dafbacbcbad53f3a1ad477e2de2428dcd5832ae46d8edacf8c2959d5.
|
||||
// FilterNodeDeactivated is a free log retrieval operation binding the contract event 0xc6c3720fe673e87bb26e06be713d514278aa94c3939cfe7c64b9bea4d486824a.
|
||||
//
|
||||
// Solidity: e NodeDeactivated(_enodeId string)
|
||||
// Solidity: e NodeDeactivated(_enodeId string, _orgId string)
|
||||
func (_NodeManager *NodeManagerFilterer) FilterNodeDeactivated(opts *bind.FilterOpts) (*NodeManagerNodeDeactivatedIterator, error) {
|
||||
|
||||
logs, sub, err := _NodeManager.contract.FilterLogs(opts, "NodeDeactivated")
|
||||
|
@ -860,9 +864,9 @@ func (_NodeManager *NodeManagerFilterer) FilterNodeDeactivated(opts *bind.Filter
|
|||
return &NodeManagerNodeDeactivatedIterator{contract: _NodeManager.contract, event: "NodeDeactivated", logs: logs, sub: sub}, nil
|
||||
}
|
||||
|
||||
// WatchNodeDeactivated is a free log subscription operation binding the contract event 0xb4551525dafbacbcbad53f3a1ad477e2de2428dcd5832ae46d8edacf8c2959d5.
|
||||
// WatchNodeDeactivated is a free log subscription operation binding the contract event 0xc6c3720fe673e87bb26e06be713d514278aa94c3939cfe7c64b9bea4d486824a.
|
||||
//
|
||||
// Solidity: e NodeDeactivated(_enodeId string)
|
||||
// Solidity: e NodeDeactivated(_enodeId string, _orgId string)
|
||||
func (_NodeManager *NodeManagerFilterer) WatchNodeDeactivated(opts *bind.WatchOpts, sink chan<- *NodeManagerNodeDeactivated) (event.Subscription, error) {
|
||||
|
||||
logs, sub, err := _NodeManager.contract.WatchLogs(opts, "NodeDeactivated")
|
||||
|
@ -967,12 +971,13 @@ func (it *NodeManagerNodeProposedIterator) Close() error {
|
|||
// NodeManagerNodeProposed represents a NodeProposed event raised by the NodeManager contract.
|
||||
type NodeManagerNodeProposed struct {
|
||||
EnodeId string
|
||||
OrgId string
|
||||
Raw types.Log // Blockchain specific contextual infos
|
||||
}
|
||||
|
||||
// FilterNodeProposed is a free log retrieval operation binding the contract event 0xaddedf3fcf588a85e0b0c3210c30da3f5597ae35221859f7e19427397a2ba80a.
|
||||
// FilterNodeProposed is a free log retrieval operation binding the contract event 0xb1a7eec7dd1a516c3132d6d1f770758b19aa34c3a07c138caf662688b7e3556f.
|
||||
//
|
||||
// Solidity: e NodeProposed(_enodeId string)
|
||||
// Solidity: e NodeProposed(_enodeId string, _orgId string)
|
||||
func (_NodeManager *NodeManagerFilterer) FilterNodeProposed(opts *bind.FilterOpts) (*NodeManagerNodeProposedIterator, error) {
|
||||
|
||||
logs, sub, err := _NodeManager.contract.FilterLogs(opts, "NodeProposed")
|
||||
|
@ -982,9 +987,9 @@ func (_NodeManager *NodeManagerFilterer) FilterNodeProposed(opts *bind.FilterOpt
|
|||
return &NodeManagerNodeProposedIterator{contract: _NodeManager.contract, event: "NodeProposed", logs: logs, sub: sub}, nil
|
||||
}
|
||||
|
||||
// WatchNodeProposed is a free log subscription operation binding the contract event 0xaddedf3fcf588a85e0b0c3210c30da3f5597ae35221859f7e19427397a2ba80a.
|
||||
// WatchNodeProposed is a free log subscription operation binding the contract event 0xb1a7eec7dd1a516c3132d6d1f770758b19aa34c3a07c138caf662688b7e3556f.
|
||||
//
|
||||
// Solidity: e NodeProposed(_enodeId string)
|
||||
// Solidity: e NodeProposed(_enodeId string, _orgId string)
|
||||
func (_NodeManager *NodeManagerFilterer) WatchNodeProposed(opts *bind.WatchOpts, sink chan<- *NodeManagerNodeProposed) (event.Subscription, error) {
|
||||
|
||||
logs, sub, err := _NodeManager.contract.WatchLogs(opts, "NodeProposed")
|
||||
|
|
|
@ -28,7 +28,7 @@ var (
|
|||
)
|
||||
|
||||
// RoleManagerABI is the input ABI used to generate the binding from.
|
||||
const RoleManagerABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"getRoleDetails\",\"outputs\":[{\"name\":\"roleId\",\"type\":\"string\"},{\"name\":\"orgId\",\"type\":\"string\"},{\"name\":\"accessType\",\"type\":\"uint256\"},{\"name\":\"voter\",\"type\":\"bool\"},{\"name\":\"active\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"isVoterRole\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"isFullAccessRole\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_baseAccess\",\"type\":\"uint256\"},{\"name\":\"_voter\",\"type\":\"bool\"}],\"name\":\"addRole\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"roleExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumberOfRoles\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"rIndex\",\"type\":\"uint256\"}],\"name\":\"getRoleDetailsFromIndex\",\"outputs\":[{\"name\":\"roleId\",\"type\":\"string\"},{\"name\":\"orgId\",\"type\":\"string\"},{\"name\":\"accessType\",\"type\":\"uint256\"},{\"name\":\"voter\",\"type\":\"bool\"},{\"name\":\"active\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"removeRole\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_permUpgradable\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_roleId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"RoleCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_roleId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"}]"
|
||||
const RoleManagerABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"getRoleDetails\",\"outputs\":[{\"name\":\"roleId\",\"type\":\"string\"},{\"name\":\"orgId\",\"type\":\"string\"},{\"name\":\"accessType\",\"type\":\"uint256\"},{\"name\":\"voter\",\"type\":\"bool\"},{\"name\":\"active\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"isVoterRole\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"isFullAccessRole\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_baseAccess\",\"type\":\"uint256\"},{\"name\":\"_voter\",\"type\":\"bool\"}],\"name\":\"addRole\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"roleExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumberOfRoles\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"rIndex\",\"type\":\"uint256\"}],\"name\":\"getRoleDetailsFromIndex\",\"outputs\":[{\"name\":\"roleId\",\"type\":\"string\"},{\"name\":\"orgId\",\"type\":\"string\"},{\"name\":\"accessType\",\"type\":\"uint256\"},{\"name\":\"voter\",\"type\":\"bool\"},{\"name\":\"active\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_roleId\",\"type\":\"string\"},{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"removeRole\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_permUpgradable\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_roleId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_baseAccess\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"_isVoter\",\"type\":\"bool\"}],\"name\":\"RoleCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_roleId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"}]"
|
||||
|
||||
// RoleManager is an auto generated Go binding around an Ethereum contract.
|
||||
type RoleManager struct {
|
||||
|
@ -485,12 +485,14 @@ func (it *RoleManagerRoleCreatedIterator) Close() error {
|
|||
type RoleManagerRoleCreated struct {
|
||||
RoleId string
|
||||
OrgId string
|
||||
BaseAccess *big.Int
|
||||
IsVoter bool
|
||||
Raw types.Log // Blockchain specific contextual infos
|
||||
}
|
||||
|
||||
// FilterRoleCreated is a free log retrieval operation binding the contract event 0xe44ae3f9d1b71c756407a3b80db5bf832c02915e3e6ca3e177055646b2e80a3c.
|
||||
// FilterRoleCreated is a free log retrieval operation binding the contract event 0x386ac6109c3e45c782fc5c1ad923957645d668ed4197e3173966eb66413e07c6.
|
||||
//
|
||||
// Solidity: e RoleCreated(_roleId string, _orgId string)
|
||||
// Solidity: e RoleCreated(_roleId string, _orgId string, _baseAccess uint256, _isVoter bool)
|
||||
func (_RoleManager *RoleManagerFilterer) FilterRoleCreated(opts *bind.FilterOpts) (*RoleManagerRoleCreatedIterator, error) {
|
||||
|
||||
logs, sub, err := _RoleManager.contract.FilterLogs(opts, "RoleCreated")
|
||||
|
@ -500,9 +502,9 @@ func (_RoleManager *RoleManagerFilterer) FilterRoleCreated(opts *bind.FilterOpts
|
|||
return &RoleManagerRoleCreatedIterator{contract: _RoleManager.contract, event: "RoleCreated", logs: logs, sub: sub}, nil
|
||||
}
|
||||
|
||||
// WatchRoleCreated is a free log subscription operation binding the contract event 0xe44ae3f9d1b71c756407a3b80db5bf832c02915e3e6ca3e177055646b2e80a3c.
|
||||
// WatchRoleCreated is a free log subscription operation binding the contract event 0x386ac6109c3e45c782fc5c1ad923957645d668ed4197e3173966eb66413e07c6.
|
||||
//
|
||||
// Solidity: e RoleCreated(_roleId string, _orgId string)
|
||||
// Solidity: e RoleCreated(_roleId string, _orgId string, _baseAccess uint256, _isVoter bool)
|
||||
func (_RoleManager *RoleManagerFilterer) WatchRoleCreated(opts *bind.WatchOpts, sink chan<- *RoleManagerRoleCreated) (event.Subscription, error) {
|
||||
|
||||
logs, sub, err := _RoleManager.contract.WatchLogs(opts, "RoleCreated")
|
||||
|
|
|
@ -26,7 +26,7 @@ contract NodeManager {
|
|||
event NodeProposed(string _enodeId, string _orgId);
|
||||
event NodeApproved(string _enodeId, string _orgId);
|
||||
|
||||
// node permission events for node decativation
|
||||
// node permission events for node deactivation
|
||||
event NodeDeactivated(string _enodeId, string _orgId);
|
||||
|
||||
// node permission events for node activation
|
||||
|
|
|
@ -240,53 +240,7 @@ func (p *PermissionCtrl) updateNodeChange(url string) {
|
|||
if rs, err := permAcctSession.GetNodeDetails(url); err != nil {
|
||||
log.Error("AJ-failed to read node info ", "err", err)
|
||||
} else {
|
||||
types.NodeInfoMap.UpsertNode(rs.OrgId, rs.EnodeId, int(rs.NodeStatus.Uint64()))
|
||||
}
|
||||
}
|
||||
|
||||
func (p *PermissionCtrl) updateOrgChange(orgId string) {
|
||||
auth := bind.NewKeyedTransactor(p.key)
|
||||
permAcctSession := &pbind.OrgManagerSession{
|
||||
Contract: p.permOrg,
|
||||
CallOpts: bind.CallOpts{
|
||||
Pending: true,
|
||||
},
|
||||
TransactOpts: bind.TransactOpts{
|
||||
From: auth.From,
|
||||
Signer: auth.Signer,
|
||||
GasLimit: 47000000,
|
||||
GasPrice: big.NewInt(0),
|
||||
},
|
||||
}
|
||||
if rs, err := permAcctSession.GetOrgIndex(orgId); err != nil {
|
||||
log.Error("AJ-failed to read org index info ", "err", err)
|
||||
} else {
|
||||
if org, status, err := permAcctSession.GetOrgInfo(rs); err != nil {
|
||||
log.Error("AJ-failed to read org detail info ", "err", err)
|
||||
} else {
|
||||
types.OrgInfoMap.UpsertOrg(org, int(status.Uint64()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (p *PermissionCtrl) updateRoleChange(orgId string, role string) {
|
||||
auth := bind.NewKeyedTransactor(p.key)
|
||||
permAcctSession := &pbind.RoleManagerSession{
|
||||
Contract: p.permRole,
|
||||
CallOpts: bind.CallOpts{
|
||||
Pending: true,
|
||||
},
|
||||
TransactOpts: bind.TransactOpts{
|
||||
From: auth.From,
|
||||
Signer: auth.Signer,
|
||||
GasLimit: 47000000,
|
||||
GasPrice: big.NewInt(0),
|
||||
},
|
||||
}
|
||||
if rs, err := permAcctSession.GetRoleDetails(role, orgId); err != nil {
|
||||
log.Error("AJ-failed to read role info ", "err", err)
|
||||
} else {
|
||||
types.RoleInfoMap.UpsertRole(rs.OrgId, rs.RoleId, rs.Voter, int(rs.AccessType.Uint64()), rs.Active)
|
||||
types.NodeInfoMap.UpsertNode(rs.OrgId, rs.EnodeId, types.NodeStatus(int(rs.NodeStatus.Uint64())))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -307,7 +261,7 @@ func (p *PermissionCtrl) monitorNodeDeactivation() {
|
|||
select {
|
||||
case evt = <-ch:
|
||||
p.updatePermissionedNodes(evt.EnodeId, NodeDelete)
|
||||
p.updateNodeChange(evt.EnodeId)
|
||||
types.NodeInfoMap.UpsertNode(evt.OrgId, evt.EnodeId, 3)
|
||||
log.Info("AJ-NodeDeactivated cached updated for ", "enode", evt.EnodeId)
|
||||
}
|
||||
|
||||
|
@ -332,7 +286,7 @@ func (p *PermissionCtrl) monitorNodeActivation() {
|
|||
select {
|
||||
case evt = <-ch:
|
||||
p.updatePermissionedNodes(evt.EnodeId, NodeAdd)
|
||||
p.updateNodeChange(evt.EnodeId)
|
||||
types.NodeInfoMap.UpsertNode(evt.OrgId, evt.EnodeId, 2)
|
||||
log.Info("AJ-newNodeActivated cached updated for ", "enode", evt.EnodeId)
|
||||
}
|
||||
}
|
||||
|
@ -358,7 +312,7 @@ func (p *PermissionCtrl) monitorNodeBlacklisting() {
|
|||
log.Info("AJ-nodeBlackListed", "event", evt)
|
||||
p.updatePermissionedNodes(evt.EnodeId, NodeDelete)
|
||||
p.updateDisallowedNodes(evt.EnodeId)
|
||||
p.updateNodeChange(evt.EnodeId)
|
||||
types.NodeInfoMap.UpsertNode(evt.OrgId, evt.EnodeId, 4)
|
||||
log.Info("AJ-newNodeABlacklisted cached updated for ", "enode", evt.EnodeId)
|
||||
}
|
||||
|
||||
|
@ -467,8 +421,8 @@ func (p *PermissionCtrl) manageAccountPermissions() {
|
|||
if !p.permissionedMode {
|
||||
return
|
||||
}
|
||||
go p.monitorAccountPermissions()
|
||||
|
||||
go p.monitorAccountPermissionsAccessModified()
|
||||
go p.monitorAccountPermissionsAccessRevoked()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -502,13 +456,13 @@ func (p *PermissionCtrl) populatePermissionedNodes() error {
|
|||
}
|
||||
|
||||
// Monitors permissions changes at acount level and uodate the account permissions cache
|
||||
func (p *PermissionCtrl) monitorAccountPermissions() {
|
||||
func (p *PermissionCtrl) monitorAccountPermissionsAccessModified() {
|
||||
ch := make(chan *pbind.AcctManagerAccountAccessModified)
|
||||
|
||||
opts := &bind.WatchOpts{}
|
||||
var blockNumber uint64 = 1
|
||||
opts.Start = &blockNumber
|
||||
var newEvent *pbind.AcctManagerAccountAccessModified
|
||||
var evt *pbind.AcctManagerAccountAccessModified
|
||||
|
||||
_, err := p.permAcct.AcctManagerFilterer.WatchAccountAccessModified(opts, ch)
|
||||
if err != nil {
|
||||
|
@ -517,30 +471,38 @@ func (p *PermissionCtrl) monitorAccountPermissions() {
|
|||
|
||||
for {
|
||||
select {
|
||||
case newEvent = <-ch:
|
||||
log.Info("AJ-AccountAccessModified", "address", newEvent.Address, "role", newEvent.RoleId)
|
||||
types.AddAccountAccess(newEvent.Address, newEvent.RoleId)
|
||||
auth := bind.NewKeyedTransactor(p.key)
|
||||
permAcctSession := &pbind.AcctManagerSession{
|
||||
Contract: p.permAcct,
|
||||
CallOpts: bind.CallOpts{
|
||||
Pending: true,
|
||||
},
|
||||
TransactOpts: bind.TransactOpts{
|
||||
From: auth.From,
|
||||
Signer: auth.Signer,
|
||||
GasLimit: 47000000,
|
||||
GasPrice: big.NewInt(0),
|
||||
},
|
||||
}
|
||||
if addr, org, role, status, orgAdmin, err := permAcctSession.GetAccountDetails(newEvent.Address); err != nil {
|
||||
log.Error("AJ-failed to read account info ", "err", err)
|
||||
} else {
|
||||
types.AcctInfoMap.UpsertAccount(org, role, addr, orgAdmin, int(status.Uint64()))
|
||||
log.Info("AJ-AccountAccessModified cached updated for ", "acct", addr)
|
||||
case evt = <-ch:
|
||||
log.Info("AJ-AccountAccessModified", "address", evt.Address, "role", evt.RoleId)
|
||||
types.AddAccountAccess(evt.Address, evt.RoleId)
|
||||
types.AcctInfoMap.UpsertAccount(evt.OrgId, evt.RoleId, evt.Address, evt.OrgAdmin, types.AcctActive)
|
||||
log.Info("AJ-AccountAccessModified cached updated for ", "acct", evt.Address)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func (p *PermissionCtrl) monitorAccountPermissionsAccessRevoked() {
|
||||
ch := make(chan *pbind.AcctManagerAccountAccessRevoked)
|
||||
|
||||
opts := &bind.WatchOpts{}
|
||||
var blockNumber uint64 = 1
|
||||
opts.Start = &blockNumber
|
||||
var evt *pbind.AcctManagerAccountAccessRevoked
|
||||
|
||||
_, err := p.permAcct.AcctManagerFilterer.WatchAccountAccessRevoked(opts, ch)
|
||||
if err != nil {
|
||||
log.Info("AJ-Failed NewNodeProposed: %v", err)
|
||||
}
|
||||
|
||||
for {
|
||||
select {
|
||||
case evt = <-ch:
|
||||
log.Info("AJ-AccountAccessModified", "address", evt.Address, "role", evt.RoleId)
|
||||
types.AddAccountAccess(evt.Address, evt.RoleId)
|
||||
types.AcctInfoMap.UpsertAccount(evt.OrgId, evt.RoleId, evt.Address, evt.OrgAdmin, types.AcctActive)
|
||||
log.Info("AJ-AccountAccessModified cached updated for ", "acct", evt.Address)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -726,7 +688,7 @@ func (p *PermissionCtrl) populateAccountsFromContract(auth *bind.TransactOpts) {
|
|||
if addr, org, role, status, orgAdmin, err := permAcctSession.GetAccountDetailsFromIndex(big.NewInt(int64(k))); err != nil {
|
||||
log.Error("AJ-Org reading org info failed")
|
||||
} else {
|
||||
types.AcctInfoMap.UpsertAccount(org, role, addr, orgAdmin, int(status.Int64()))
|
||||
types.AcctInfoMap.UpsertAccount(org, role, addr, orgAdmin, types.AcctStatus(int(status.Int64())))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -758,7 +720,7 @@ func (p *PermissionCtrl) populateRolesFromContract(auth *bind.TransactOpts) {
|
|||
if roleStruct, err := permRoleSession.GetRoleDetailsFromIndex(big.NewInt(int64(k))); err != nil {
|
||||
log.Error("AJ-role reading org info failed")
|
||||
} else {
|
||||
types.RoleInfoMap.UpsertRole(roleStruct.OrgId, roleStruct.RoleId, roleStruct.Voter, int(roleStruct.AccessType.Int64()), roleStruct.Active)
|
||||
types.RoleInfoMap.UpsertRole(roleStruct.OrgId, roleStruct.RoleId, roleStruct.Voter, types.AccessType(int(roleStruct.AccessType.Int64())), roleStruct.Active)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -790,7 +752,7 @@ func (p *PermissionCtrl) populateNodesFromContract(auth *bind.TransactOpts) {
|
|||
if nodeStruct, err := permNodeSession.GetNodeDetailsFromIndex(big.NewInt(int64(k))); err != nil {
|
||||
log.Error("AJ-node reading org info failed")
|
||||
} else {
|
||||
types.NodeInfoMap.UpsertNode(nodeStruct.OrgId, nodeStruct.EnodeId, int(nodeStruct.NodeStatus.Int64()))
|
||||
types.NodeInfoMap.UpsertNode(nodeStruct.OrgId, nodeStruct.EnodeId, types.NodeStatus(int(nodeStruct.NodeStatus.Int64())))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -822,7 +784,7 @@ func (p *PermissionCtrl) populateOrgsFromContract(auth *bind.TransactOpts) {
|
|||
if o, s, err := permOrgSession.GetOrgInfo(big.NewInt(int64(k))); err != nil {
|
||||
log.Error("AJ-Org reading org info failed")
|
||||
} else {
|
||||
types.OrgInfoMap.UpsertOrg(o, int(s.Int64()))
|
||||
types.OrgInfoMap.UpsertOrg(o, types.OrgStatus(int(s.Int64())))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -903,7 +865,7 @@ func (p *PermissionCtrl) monitorOrgActivation() {
|
|||
select {
|
||||
case evt = <-ch:
|
||||
log.Info("AJ-OrgActivated", "node", evt.OrgId)
|
||||
p.updateOrgChange(evt.OrgId)
|
||||
types.OrgInfoMap.UpsertOrg(evt.OrgId, 5)
|
||||
log.Info("AJ-newOrgActivated cached updated for ", "orgid", evt.OrgId)
|
||||
}
|
||||
}
|
||||
|
@ -926,7 +888,7 @@ func (p *PermissionCtrl) monitorNewOrgAdd() {
|
|||
select {
|
||||
case evt = <-ch:
|
||||
log.Info("AJ-newOrgApproved", "node", evt.OrgId)
|
||||
p.updateOrgChange(evt.OrgId)
|
||||
types.OrgInfoMap.UpsertOrg(evt.OrgId, 2)
|
||||
log.Info("AJ-newOrgApproved cached updated for ", "orgid", evt.OrgId)
|
||||
}
|
||||
}
|
||||
|
@ -950,7 +912,7 @@ func (p *PermissionCtrl) monitorOrgDeactivation() {
|
|||
select {
|
||||
case evt = <-ch:
|
||||
log.Info("AJ-newOrgSuspended", "node", evt.OrgId)
|
||||
p.updateOrgChange(evt.OrgId)
|
||||
types.OrgInfoMap.UpsertOrg(evt.OrgId, 4)
|
||||
log.Info("AJ-newOrgSuspended cached updated for ", "orgid", evt.OrgId)
|
||||
}
|
||||
}
|
||||
|
@ -983,7 +945,7 @@ func (p *PermissionCtrl) monitorNewRoleAdd() {
|
|||
select {
|
||||
case evt = <-ch:
|
||||
log.Info("AJ-newRoleCreated", "org", evt.OrgId, "role", evt.RoleId)
|
||||
p.updateRoleChange(evt.OrgId, evt.RoleId)
|
||||
types.RoleInfoMap.UpsertRole(evt.OrgId, evt.RoleId, evt.IsVoter, types.AccessType(int(evt.BaseAccess.Uint64())), true)
|
||||
log.Info("AJ-newRoleCreated cached updated for ", "orgid", evt.OrgId, "role", evt.RoleId)
|
||||
}
|
||||
}
|
||||
|
@ -1007,8 +969,13 @@ func (p *PermissionCtrl) monitorNewRoleRemove() {
|
|||
select {
|
||||
case evt = <-ch:
|
||||
log.Info("AJ-newRoleRemoved", "org", evt.OrgId, "role", evt.RoleId)
|
||||
p.updateRoleChange(evt.OrgId, evt.RoleId)
|
||||
if r := types.RoleInfoMap.GetRole(evt.OrgId, evt.RoleId); r != nil {
|
||||
types.RoleInfoMap.UpsertRole(evt.OrgId, evt.RoleId, r.IsVoter, r.Access, true)
|
||||
log.Info("AJ-newRoleRemoved cached updated for ", "orgid", evt.OrgId, "role", evt.RoleId)
|
||||
} else {
|
||||
log.Error("AJ-revoke role - cache is missing role", "org", evt.OrgId, "role", evt.RoleId)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,41 +19,46 @@ const (
|
|||
type OrgStatus uint8
|
||||
|
||||
const (
|
||||
Proposed OrgStatus = 1
|
||||
Approved
|
||||
PendingSuspension
|
||||
Suspended
|
||||
RevokeSuspension
|
||||
OrgProposed OrgStatus = iota + 1
|
||||
OrgApproved
|
||||
OrgPendingSuspension
|
||||
OrgSuspended
|
||||
OrgRevokeSuspension
|
||||
)
|
||||
|
||||
type OrgInfo struct {
|
||||
OrgId string
|
||||
Status int
|
||||
Status OrgStatus
|
||||
}
|
||||
|
||||
type NodeStatus uint8
|
||||
|
||||
const (
|
||||
PendingApproval NodeStatus = 1
|
||||
NodePendingApproval NodeStatus = iota + 1
|
||||
NodeApproved
|
||||
PendingDeactivation
|
||||
Deactivated
|
||||
PendingActivation
|
||||
PendingBlacklisting
|
||||
NodeDeactivated
|
||||
Blacklisted
|
||||
)
|
||||
|
||||
type AcctStatus uint8
|
||||
|
||||
const (
|
||||
AcctPendingApproval AcctStatus = iota + 1
|
||||
AcctActive
|
||||
AcctInactive
|
||||
)
|
||||
|
||||
type NodeInfo struct {
|
||||
OrgId string
|
||||
Url string
|
||||
Status int
|
||||
Status NodeStatus
|
||||
}
|
||||
|
||||
type RoleInfo struct {
|
||||
OrgId string
|
||||
RoleId string
|
||||
IsVoter bool
|
||||
Access int
|
||||
Access AccessType
|
||||
Active bool
|
||||
}
|
||||
|
||||
|
@ -62,7 +67,7 @@ type AccountInfo struct {
|
|||
RoleId string
|
||||
AcctId common.Address
|
||||
IsOrgAdmin bool
|
||||
Status int
|
||||
Status AcctStatus
|
||||
}
|
||||
|
||||
type PermStruct struct {
|
||||
|
@ -178,7 +183,7 @@ func SetDefaultAccess() {
|
|||
DefaultAccess = FullAccess
|
||||
}
|
||||
|
||||
func (o *OrgCache) UpsertOrg(orgId string, status int) {
|
||||
func (o *OrgCache) UpsertOrg(orgId string, status OrgStatus) {
|
||||
defer o.mux.Unlock()
|
||||
o.mux.Lock()
|
||||
key := OrgKey{OrgId: orgId}
|
||||
|
@ -218,7 +223,7 @@ func (o *OrgCache) GetOrgList() []OrgInfo {
|
|||
return olist
|
||||
}
|
||||
|
||||
func (n *NodeCache) UpsertNode(orgId string, url string, status int) {
|
||||
func (n *NodeCache) UpsertNode(orgId string, url string, status NodeStatus) {
|
||||
defer n.mux.Unlock()
|
||||
n.mux.Lock()
|
||||
key := NodeKey{OrgId: orgId, Url: url}
|
||||
|
@ -270,7 +275,7 @@ func (o *NodeCache) GetNodeList() []NodeInfo {
|
|||
return olist
|
||||
}
|
||||
|
||||
func (a *AcctCache) UpsertAccount(orgId string, role string, acct common.Address, orgAdmin bool, status int) {
|
||||
func (a *AcctCache) UpsertAccount(orgId string, role string, acct common.Address, orgAdmin bool, status AcctStatus) {
|
||||
defer a.mux.Unlock()
|
||||
a.mux.Lock()
|
||||
key := AccountKey{orgId, role, acct}
|
||||
|
@ -322,7 +327,7 @@ func (o *AcctCache) GetAcctList() []AccountInfo {
|
|||
return olist
|
||||
}
|
||||
|
||||
func (r *RoleCache) UpsertRole(orgId string, role string, voter bool, access int, active bool) {
|
||||
func (r *RoleCache) UpsertRole(orgId string, role string, voter bool, access AccessType, active bool) {
|
||||
defer r.mux.Unlock()
|
||||
r.mux.Lock()
|
||||
key := RoleKey{orgId, role}
|
||||
|
|
Loading…
Reference in New Issue