SchainsInternal

Contract contains all functionality logic to internally manage Schains.

Functions
Events

onlySchainTypeManager onlySchainTypeManager() modifier

onlyDebugger onlyDebugger() modifier

initializeSchain initializeSchain(string name, address from, uint256 lifetime, uint256 deposit) external

Allows Schain contract to initialize an schain.

createGroupForSchain createGroupForSchain(bytes32 schainHash, uint256 numberOfNodes, uint8 partOfNode) → uint256[] external

Allows Schain contract to create a node group for an schain.

setSchainIndex setSchainIndex(bytes32 schainHash, address from) external

Allows Schains contract to set index in owner list.

changeLifetime changeLifetime(bytes32 schainHash, uint256 lifetime, uint256 deposit) external

Allows Schains contract to change the Schain lifetime through an additional SKL token deposit.

removeSchain removeSchain(bytes32 schainHash, address from) external

Allows Schains contract to remove an schain from the network. Generally schains are not removed from the system; instead they are simply allowed to expire.

removeNodeFromSchain removeNodeFromSchain(uint256 nodeIndex, bytes32 schainHash) external

Allows Schains and SkaleDKG contracts to remove a node from an schain for node rotation or DKG failure.

deleteGroup deleteGroup(bytes32 schainHash) external

Allows Schains contract to delete a group of schains

setException setException(bytes32 schainHash, uint256 nodeIndex) external

Allows Schain and NodeRotation contracts to set a Node like exception for a given schain and nodeIndex.

setNodeInGroup setNodeInGroup(bytes32 schainHash, uint256 nodeIndex) external

Allows Schains and NodeRotation contracts to add node to an schain group.

removeHolesForSchain removeHolesForSchain(bytes32 schainHash) external

Allows Schains contract to remove holes for schains

addSchainType addSchainType(uint8 partOfNode, uint256 numberOfNodes) external

Allows Admin to add schain type

removeSchainType removeSchainType(uint256 typeOfSchain) external

Allows Admin to remove schain type

setNumberOfSchainTypes setNumberOfSchainTypes(uint256 newNumberOfSchainTypes) external

Allows Admin to set number of schain types

moveToPlaceOfSchainOnNode moveToPlaceOfSchainOnNode(bytes32 schainHash) external

Allows Admin to move schain to placeOfSchainOnNode map

removeNodeFromAllExceptionSchains removeNodeFromAllExceptionSchains(uint256 nodeIndex) external

makeSchainNodesInvisible makeSchainNodesInvisible(bytes32 schainHash) external

makeSchainNodesVisible makeSchainNodesVisible(bytes32 schainHash) external

getSchains getSchains() → bytes32[] external

Returns all Schains in the network.

getSchainsPartOfNode getSchainsPartOfNode(bytes32 schainHash) → uint8 external

Returns all occupied resources on one node for an Schain.

getSchainListSize getSchainListSize(address from) → uint256 external

Returns number of schains by schain owner.

getSchainHashesByAddress getSchainHashesByAddress(address from) → bytes32[] external

Returns hashes of schain names by schain owner.

getSchainIdsByAddress getSchainIdsByAddress(address from) → bytes32[] external

Returns hashes of schain names by schain owner.

getSchainHashesForNode getSchainHashesForNode(uint256 nodeIndex) → bytes32[] external

Returns hashes of schain names running on a node.

getSchainIdsForNode getSchainIdsForNode(uint256 nodeIndex) → bytes32[] external

Returns hashes of schain names running on a node.

getSchainOwner getSchainOwner(bytes32 schainHash) → address external

Returns the owner of an schain.

isSchainNameAvailable isSchainNameAvailable(string name) → bool external

Checks whether schain name is available. TODO Need to delete - copy of web3.utils.soliditySha3

isTimeExpired isTimeExpired(bytes32 schainHash) → bool external

Checks whether schain lifetime has expired.

isOwnerAddress isOwnerAddress(address from, bytes32 schainHash) → bool external

Checks whether address is owner of schain.

isSchainExist isSchainExist(bytes32 schainHash) → bool external

Checks whether schain exists.

getSchainName getSchainName(bytes32 schainHash) → string external

Returns schain name.

getActiveSchain getActiveSchain(uint256 nodeIndex) → bytes32 external

Returns last active schain of a node.

getActiveSchains getActiveSchains(uint256 nodeIndex) → bytes32[] activeSchains external

Returns active schains of a node.

getNumberOfNodesInGroup getNumberOfNodesInGroup(bytes32 schainHash) → uint256 external

Returns number of nodes in an schain group.

getNodesInGroup getNodesInGroup(bytes32 schainHash) → uint256[] external

Returns nodes in an schain group.

isNodeAddressesInGroup isNodeAddressesInGroup(bytes32 schainHash, address sender) → bool external

Checks whether sender is a node address from a given schain group.

getNodeIndexInGroup getNodeIndexInGroup(bytes32 schainHash, uint256 nodeId) → uint256 external

Returns node index in schain group.

isAnyFreeNode isAnyFreeNode(bytes32 schainHash) → bool external

Checks whether there are any nodes with free resources for given schain.

checkException checkException(bytes32 schainHash, uint256 nodeIndex) → bool external

Returns whether any exceptions exist for node in a schain group.

checkHoleForSchain checkHoleForSchain(bytes32 schainHash, uint256 indexOfNode) → bool external

getLengthOfSchainsForNode getLengthOfSchainsForNode(uint256 nodeIndex) → uint256 external

Returns number of Schains on a node.

getSchainType getSchainType(uint256 typeOfSchain) → uint8, uint256 external

initialize initialize(address newContractsAddress) public

addSchainForNode addSchainForNode(uint256 nodeIndex, bytes32 schainHash) public

Allows Schains and NodeRotation contracts to add schain to node.

removeSchainForNode removeSchainForNode(uint256 nodeIndex, uint256 schainIndex) public

Allows Schains, NodeRotation, and SkaleDKG contracts to remove an schain from a node.

removeNodeFromExceptions removeNodeFromExceptions(bytes32 schainHash, uint256 nodeIndex) public

Allows Schains contract to remove node from exceptions

findSchainAtSchainsForNode findSchainAtSchainsForNode(uint256 nodeIndex, bytes32 schainHash) → uint256 public

Returns index of Schain in list of schains for a given node.

_getNodeToLockedSchains _getNodeToLockedSchains() → mapping(uint256 => bytes32[]) internal

_getSchainToExceptionNodes _getSchainToExceptionNodes() → mapping(bytes32 => uint256[]) internal