Documentation ¶
Index ¶
- Constants
- func BubbleSortUint32(arr []uint32) []uint32
- func CheckTimestamp(time []byte, timeEntered int64) bool
- type AnchorSigningKey
- type AnchorSigningKeySort
- type Authority
- func (a *Authority) Clone() *Authority
- func (e *Authority) GetAuthorityChainID() (rval interfaces.IHash)
- func (a *Authority) GetCoinbaseHumanReadable() string
- func (auth *Authority) GetSigningKey() []byte
- func (e *Authority) Init()
- func (e *Authority) IsSameAs(b *Authority) bool
- func (e *Authority) MarshalBinary() (rval []byte, err error)
- func (auth *Authority) MarshalJSON() (rval []byte, err error)
- func (auth *Authority) Type() int
- func (e *Authority) UnmarshalBinary(p []byte) error
- func (e *Authority) UnmarshalBinaryData(p []byte) (newData []byte, err error)
- func (auth *Authority) VerifySignature(msg []byte, sig *[constants.SIGNATURE_LENGTH]byte) (bool, error)
- type AuthoritySort
- type CoinbaseCancelManager
- func (cm *CoinbaseCancelManager) AddCancel(cc identityEntries.NewCoinbaseCancelStruct)
- func (cm *CoinbaseCancelManager) AddNewProposalHeight(descriptorHeight uint32)
- func (cm *CoinbaseCancelManager) CanceledOutputs(descriptorHeight uint32) []uint32
- func (c *CoinbaseCancelManager) GC(dbheight uint32)
- func (cm *CoinbaseCancelManager) IsAdminBlockRecorded(descriptorHeight uint32, index uint32) bool
- func (cm *CoinbaseCancelManager) IsCoinbaseCancelled(descriptorHeight, index uint32) bool
- func (cm *CoinbaseCancelManager) MarkAdminBlockRecorded(descriptorHeight uint32, index uint32)
- type EntryBlockMarker
- func (e *EntryBlockMarker) Clone() *EntryBlockMarker
- func (a *EntryBlockMarker) IsSameAs(b *EntryBlockMarker) bool
- func (e *EntryBlockMarker) MarshalBinary() (rval []byte, err error)
- func (e *EntryBlockMarker) Size() int
- func (e *EntryBlockMarker) UnmarshalBinary(p []byte) error
- func (e *EntryBlockMarker) UnmarshalBinaryData(p []byte) (newData []byte, err error)
- type EntryBlockMarkerList
- type EntryBlockSync
- func (a *EntryBlockSync) AddNewHead(keymr interfaces.IHash, seq uint32, ht uint32, ...)
- func (a *EntryBlockSync) AddNewHeadMarker(marker EntryBlockMarker)
- func (a *EntryBlockSync) BlockParsed(block EntryBlockMarker)
- func (e *EntryBlockSync) Clone() *EntryBlockSync
- func (a *EntryBlockSync) IsSameAs(b *EntryBlockSync) bool
- func (e *EntryBlockSync) MarshalBinary() (rval []byte, err error)
- func (a *EntryBlockSync) NextEBlock() *EntryBlockMarker
- func (a *EntryBlockSync) Synced() bool
- func (e *EntryBlockSync) UnmarshalBinary(p []byte) error
- func (e *EntryBlockSync) UnmarshalBinaryData(p []byte) (newData []byte, err error)
- type HistoricKey
- type Identity
- func (e *Identity) Clone() *Identity
- func (id *Identity) GetCoinbaseHumanReadable() string
- func (e *Identity) Init()
- func (id *Identity) IsComplete() (bool, error)
- func (id *Identity) IsFull() bool
- func (id *Identity) IsPromteable() (bool, error)
- func (id *Identity) IsRegistrationValid() (bool, error)
- func (e *Identity) IsSameAs(b *Identity) bool
- func (e *Identity) JSONByte() ([]byte, error)
- func (e *Identity) JSONString() (string, error)
- func (e *Identity) MarshalBinary() (rval []byte, err error)
- func (e *Identity) String() string
- func (id *Identity) ToAuthority() *Authority
- func (e *Identity) UnmarshalBinary(p []byte) error
- func (e *Identity) UnmarshalBinaryData(p []byte) (newData []byte, err error)
- func (id *Identity) VerifySignature(msg []byte, sig *[constants.SIGNATURE_LENGTH]byte) (bool, error)
- type IdentityManager
- func (im *IdentityManager) ApplyAddAuditServer(entry interfaces.IABEntry, st interfaces.IState) error
- func (im *IdentityManager) ApplyAddEfficiency(entry interfaces.IABEntry) error
- func (im *IdentityManager) ApplyAddFactoidAddress(entry interfaces.IABEntry) error
- func (im *IdentityManager) ApplyAddFederatedServer(entry interfaces.IABEntry, st interfaces.IState) error
- func (im *IdentityManager) ApplyAddFederatedServerBitcoinAnchorKey(entry interfaces.IABEntry) error
- func (im *IdentityManager) ApplyAddFederatedServerSigningKey(entry interfaces.IABEntry) error
- func (im *IdentityManager) ApplyAddReplaceMatryoshkaHash(entry interfaces.IABEntry) error
- func (im *IdentityManager) ApplyCancelCoinbaseDescriptor(entry interfaces.IABEntry) error
- func (im *IdentityManager) ApplyIdentityChainStructure(ic *IdentityChainStructure, chainID interfaces.IHash, dBlockHeight uint32) (bool, error)
- func (im *IdentityManager) ApplyIncreaseServerCount(entry interfaces.IABEntry) error
- func (im *IdentityManager) ApplyNewBitcoinKeyStructure(bnk *NewBitcoinKeyStructure, subChainID interfaces.IHash, BlockChain string, ...) (bool, bool, error)
- func (im *IdentityManager) ApplyNewBlockSigningKeyStruct(nbsk *NewBlockSigningKeyStruct, subchainID interfaces.IHash, ...) (bool, bool, error)
- func (im *IdentityManager) ApplyNewCoinbaseAddressStruct(ncas *NewCoinbaseAddressStruct, rootchainID interfaces.IHash, ...) (bool, bool, error)
- func (im *IdentityManager) ApplyNewCoinbaseCancelStruct(nccs *NewCoinbaseCancelStruct, managechain interfaces.IHash, ...) (bool, bool, error)
- func (im *IdentityManager) ApplyNewMatryoshkaHashStructure(nmh *NewMatryoshkaHashStructure, dBlockTimestamp interfaces.Timestamp, ...) (bool, bool, error)
- func (im *IdentityManager) ApplyNewServerEfficiencyStruct(nses *NewServerEfficiencyStruct, subchainID interfaces.IHash, ...) (bool, bool, error)
- func (im *IdentityManager) ApplyRegisterFactomIdentityStructure(rfi *RegisterFactomIdentityStructure, dBlockHeight uint32) (bool, error)
- func (im *IdentityManager) ApplyRegisterServerManagementStructure(rsm *RegisterServerManagementStructure, chainID interfaces.IHash, ...) (bool, error)
- func (im *IdentityManager) ApplyRemoveFederatedServer(entry interfaces.IABEntry) error
- func (im *IdentityManager) ApplyRevealMatryoshkaHash(entry interfaces.IABEntry) error
- func (im *IdentityManager) ApplyServerFault(entry interfaces.IABEntry) error
- func (im *IdentityManager) ApplyServerManagementStructure(sm *ServerManagementStructure, chainID interfaces.IHash, dBlockHeight uint32) (bool, error)
- func (im *IdentityManager) AuditServerCount() int
- func (im *IdentityManager) AuthorityServerCount() int
- func (im *IdentityManager) CheckDBSignatureEntries(aBlock interfaces.IAdminBlock, dBlock interfaces.IDirectoryBlock, ...) error
- func (im *IdentityManager) Clone() *IdentityManager
- func (im *IdentityManager) FedServerCount() int
- func (im *IdentityManager) GetAuthorities() []interfaces.IAuthority
- func (im *IdentityManager) GetAuthority(chainID interfaces.IHash) *Authority
- func (im *IdentityManager) GetIdentities() []*Identity
- func (im *IdentityManager) GetIdentity(chainID interfaces.IHash) *Identity
- func (im *IdentityManager) GetRegistrations() []*identityEntries.RegisterFactomIdentityStructure
- func (im *IdentityManager) GetSortedAuthorities() []interfaces.IAuthority
- func (im *IdentityManager) GetSortedIdentities() []*Identity
- func (im *IdentityManager) GetSortedRegistrations() []*identityEntries.RegisterFactomIdentityStructure
- func (im *IdentityManager) GobDecode(data []byte) error
- func (im *IdentityManager) GobEncode() ([]byte, error)
- func (im *IdentityManager) Init()
- func (a *IdentityManager) IsSameAs(b *IdentityManager) bool
- func (im *IdentityManager) MarshalBinary() ([]byte, error)
- func (im *IdentityManager) ProcessABlockEntry(entry interfaces.IABEntry, st interfaces.IState) error
- func (im *IdentityManager) ProcessIdentityEntry(entry interfaces.IEBEntry, dBlockHeight uint32, ...) (bool, error)
- func (im *IdentityManager) ProcessIdentityEntryWithABlockUpdate(entry interfaces.IEBEntry, dBlockHeight uint32, ...) (bool, error)
- func (im *IdentityManager) ProcessOldEntries() (bool, error)
- func (im *IdentityManager) PushEntryForLater(entry interfaces.IEBEntry, dBlockHeight uint32, ...) error
- func (im *IdentityManager) RemoveAuthority(chainID interfaces.IHash) bool
- func (im *IdentityManager) RemoveIdentity(chainID interfaces.IHash) bool
- func (im *IdentityManager) SetAuthority(chainID interfaces.IHash, auth *Authority)
- func (im *IdentityManager) SetBootstrapIdentity(id interfaces.IHash, key interfaces.IHash) error
- func (im *IdentityManager) SetIdentity(chainID interfaces.IHash, id *Identity)
- func (im *IdentityManager) SetIdentityRegistration(chain interfaces.IHash) error
- func (im *IdentityManager) SetSkeletonIdentity(chain interfaces.IHash) error
- func (im *IdentityManager) String() string
- func (e *IdentityManager) UnmarshalBinary(p []byte) error
- func (im *IdentityManager) UnmarshalBinaryData(p []byte) (newData []byte, err error)
- type IdentityManagerWithoutMutex
- type IdentitySort
- type OldEntry
Constants ¶
const (
TWELVE_HOURS_S uint64 = 12 * 60 * 60
)
Variables ¶
This section is empty.
Functions ¶
func BubbleSortUint32 ¶
func CheckTimestamp ¶
Makes sure the timestamp is within the designated window to be valid : 12 hours TimeEntered is in seconds
Types ¶
type AnchorSigningKey ¶
type AnchorSigningKey struct { BlockChain string `json:"blockchain"` KeyLevel byte `json:"level"` KeyType byte `json:"keytype"` SigningKey primitives.ByteSlice20 `json:"key"` //if bytes, it is hex }
func RandomAnchorSigningKey ¶
func RandomAnchorSigningKey() *AnchorSigningKey
func (*AnchorSigningKey) IsSameAs ¶
func (e *AnchorSigningKey) IsSameAs(b *AnchorSigningKey) bool
func (*AnchorSigningKey) MarshalBinary ¶
func (e *AnchorSigningKey) MarshalBinary() (rval []byte, err error)
func (*AnchorSigningKey) UnmarshalBinary ¶
func (e *AnchorSigningKey) UnmarshalBinary(p []byte) error
func (*AnchorSigningKey) UnmarshalBinaryData ¶
func (e *AnchorSigningKey) UnmarshalBinaryData(p []byte) (newData []byte, err error)
type AnchorSigningKeySort ¶
type AnchorSigningKeySort []AnchorSigningKey
sort.Sort interface implementation
func (AnchorSigningKeySort) Len ¶
func (p AnchorSigningKeySort) Len() int
func (AnchorSigningKeySort) Less ¶
func (p AnchorSigningKeySort) Less(i, j int) bool
func (AnchorSigningKeySort) Swap ¶
func (p AnchorSigningKeySort) Swap(i, j int)
type Authority ¶
type Authority struct { AuthorityChainID interfaces.IHash `json:"chainid"` ManagementChainID interfaces.IHash `json:"manageid"` MatryoshkaHash interfaces.IHash `json:"matroyshka"` SigningKey primitives.PublicKey `json:"signingkey"` Status uint8 `json:"status"` AnchorKeys []AnchorSigningKey `json:"anchorkeys"` KeyHistory []HistoricKey `json:"-"` Efficiency uint16 `json:"efficiency"` CoinbaseAddress interfaces.IAddress `json:"coinbaseaddress"` }
func NewAuthority ¶
func NewAuthority() *Authority
func RandomAuthority ¶
func RandomAuthority() *Authority
func (*Authority) GetAuthorityChainID ¶
func (e *Authority) GetAuthorityChainID() (rval interfaces.IHash)
func (*Authority) GetCoinbaseHumanReadable ¶
func (*Authority) GetSigningKey ¶
func (*Authority) MarshalBinary ¶
func (*Authority) MarshalJSON ¶
func (*Authority) UnmarshalBinary ¶
func (*Authority) UnmarshalBinaryData ¶
func (*Authority) VerifySignature ¶
type AuthoritySort ¶
type AuthoritySort []interfaces.IAuthority
sort.Sort interface implementation
func (AuthoritySort) Len ¶
func (p AuthoritySort) Len() int
func (AuthoritySort) Less ¶
func (p AuthoritySort) Less(i, j int) bool
func (AuthoritySort) Swap ¶
func (p AuthoritySort) Swap(i, j int)
type CoinbaseCancelManager ¶
type CoinbaseCancelManager struct { // Heights of various descriptor cancel proposals. This list will be // sorted, and is used for garbage collecting proposals that have failed ProposalsList []uint32 // Proposals is all cancel proposals for a given descriptor height // [descriptorheight][cancel index][id chain]Cancel identity entry Proposals map[uint32]map[uint32]map[[32]byte]identityEntries.NewCoinbaseCancelStruct // Boolean indicator if it's been recorded to the admin block. We do not do this more than once // [descriptorheight][cancel index] AdminBlockRecord map[uint32]map[uint32]bool // contains filtered or unexported fields }
CoinbaseCancelManager handles keeping track of coinbase cancel signals in identity chains. Specifically keeps track of the tallies, then can determine if an admin block entry should be created.
func NewCoinbaseCancelManager ¶
func NewCoinbaseCancelManager(im *IdentityManager) *CoinbaseCancelManager
func (*CoinbaseCancelManager) AddCancel ¶
func (cm *CoinbaseCancelManager) AddCancel(cc identityEntries.NewCoinbaseCancelStruct)
AddCancel will add a proposal to the list. It assumes the height check has already been done
func (*CoinbaseCancelManager) AddNewProposalHeight ¶
func (cm *CoinbaseCancelManager) AddNewProposalHeight(descriptorHeight uint32)
AddNewProposalHeight does a insert into the sorted list. It does not use binary search as this list should be relatively small, and infrequently used. Only used when canceling a coinbase in the future.
func (*CoinbaseCancelManager) CanceledOutputs ¶
func (cm *CoinbaseCancelManager) CanceledOutputs(descriptorHeight uint32) []uint32
CanceledOutputs will return the indices of all indices to be canceled for a given descriptor height
It will only return indicies not already marked as cancelled (in the admin block)
This function is used in unit tests, not in dcnt
func (*CoinbaseCancelManager) GC ¶
func (c *CoinbaseCancelManager) GC(dbheight uint32)
GC is garbage collecting old proposals
dbheight is the current height.
func (*CoinbaseCancelManager) IsAdminBlockRecorded ¶
func (cm *CoinbaseCancelManager) IsAdminBlockRecorded(descriptorHeight uint32, index uint32) bool
IsAdminBlockRecorded returns boolean if marked already recorded. Garbage collected heights will return false, so the caller will have to check if the dbheight is valid.
func (*CoinbaseCancelManager) IsCoinbaseCancelled ¶
func (cm *CoinbaseCancelManager) IsCoinbaseCancelled(descriptorHeight, index uint32) bool
IsCoinbaseCancelled returns true if the coinbase transaction is cancelled for a given descriptor height and (output) index.
func (*CoinbaseCancelManager) MarkAdminBlockRecorded ¶
func (cm *CoinbaseCancelManager) MarkAdminBlockRecorded(descriptorHeight uint32, index uint32)
MarkAdminBlockRecorded will mark a given index for a descriptor already canceled. This is to prevent a given index from being recorded multiple times
type EntryBlockMarker ¶
type EntryBlockMarker struct { KeyMr interfaces.IHash Sequence uint32 DBHeight uint32 DblockTimestamp interfaces.Timestamp }
func NewEntryBlockMarker ¶
func NewEntryBlockMarker() *EntryBlockMarker
func RandomEntryBlockMarker ¶
func RandomEntryBlockMarker() *EntryBlockMarker
func (*EntryBlockMarker) Clone ¶
func (e *EntryBlockMarker) Clone() *EntryBlockMarker
func (*EntryBlockMarker) IsSameAs ¶
func (a *EntryBlockMarker) IsSameAs(b *EntryBlockMarker) bool
func (*EntryBlockMarker) MarshalBinary ¶
func (e *EntryBlockMarker) MarshalBinary() (rval []byte, err error)
func (*EntryBlockMarker) Size ¶
func (e *EntryBlockMarker) Size() int
Returns the byte size when marshaled
func (*EntryBlockMarker) UnmarshalBinary ¶
func (e *EntryBlockMarker) UnmarshalBinary(p []byte) error
func (*EntryBlockMarker) UnmarshalBinaryData ¶
func (e *EntryBlockMarker) UnmarshalBinaryData(p []byte) (newData []byte, err error)
type EntryBlockMarkerList ¶
type EntryBlockMarkerList []EntryBlockMarker
func (EntryBlockMarkerList) Len ¶
func (p EntryBlockMarkerList) Len() int
func (EntryBlockMarkerList) Less ¶
func (p EntryBlockMarkerList) Less(i, j int) bool
func (EntryBlockMarkerList) Swap ¶
func (p EntryBlockMarkerList) Swap(i, j int)
type EntryBlockSync ¶
type EntryBlockSync struct { Current EntryBlockMarker Target EntryBlockMarker BlocksToBeParsed []EntryBlockMarker }
EntryBlockSync has the current eblock synced to, and the target Eblock
It also has the blocks in between in order. This makes it so traversing only needs to happen once
func NewEntryBlockSync ¶
func NewEntryBlockSync() *EntryBlockSync
func RandomEntryBlockSync ¶
func RandomEntryBlockSync() *EntryBlockSync
func (*EntryBlockSync) AddNewHead ¶
func (a *EntryBlockSync) AddNewHead(keymr interfaces.IHash, seq uint32, ht uint32, dblockTimestamp interfaces.Timestamp)
func (*EntryBlockSync) AddNewHeadMarker ¶
func (a *EntryBlockSync) AddNewHeadMarker(marker EntryBlockMarker)
AddNewHead will add a new eblock to be parsed to the head (tail of list)
Since the block needs to be parsed, it is the new target and added to the blocks to be parsed
func (*EntryBlockSync) BlockParsed ¶
func (a *EntryBlockSync) BlockParsed(block EntryBlockMarker)
BlockParsed indicates a block has been parsed. We update our current
func (*EntryBlockSync) Clone ¶
func (e *EntryBlockSync) Clone() *EntryBlockSync
func (*EntryBlockSync) IsSameAs ¶
func (a *EntryBlockSync) IsSameAs(b *EntryBlockSync) bool
func (*EntryBlockSync) MarshalBinary ¶
func (e *EntryBlockSync) MarshalBinary() (rval []byte, err error)
func (*EntryBlockSync) NextEBlock ¶
func (a *EntryBlockSync) NextEBlock() *EntryBlockMarker
NextEBlock returns the next eblock that is needed to be parsed
func (*EntryBlockSync) Synced ¶
func (a *EntryBlockSync) Synced() bool
Synced returns if fully synced (current == target)
func (*EntryBlockSync) UnmarshalBinary ¶
func (e *EntryBlockSync) UnmarshalBinary(p []byte) error
func (*EntryBlockSync) UnmarshalBinaryData ¶
func (e *EntryBlockSync) UnmarshalBinaryData(p []byte) (newData []byte, err error)
type HistoricKey ¶
type HistoricKey struct { ActiveDBHeight uint32 SigningKey primitives.PublicKey }
func RandomHistoricKey ¶
func RandomHistoricKey() *HistoricKey
func (*HistoricKey) IsSameAs ¶
func (e *HistoricKey) IsSameAs(b *HistoricKey) bool
func (*HistoricKey) MarshalBinary ¶
func (e *HistoricKey) MarshalBinary() (rval []byte, err error)
func (*HistoricKey) UnmarshalBinary ¶
func (e *HistoricKey) UnmarshalBinary(p []byte) error
func (*HistoricKey) UnmarshalBinaryData ¶
func (e *HistoricKey) UnmarshalBinaryData(p []byte) (newData []byte, err error)
type Identity ¶
type Identity struct { IdentityChainID interfaces.IHash `json:"identity_chainid"` IdentityChainSync EntryBlockSync `json:"-"` IdentityRegistered uint32 `json:"identity_registered` IdentityCreated uint32 `json:"identity_created` ManagementChainID interfaces.IHash `json:"management_chaind` ManagementChainSync EntryBlockSync `json:"-"` ManagementRegistered uint32 `json:"management_registered` ManagementCreated uint32 `json:"management_created` MatryoshkaHash interfaces.IHash `json:"matryoshka_hash` // All 4 levels keys, 0 indexed. // Keys[0] --> Key 1 // Keys[1] --> Key 2 // Keys[2] --> Key 3 // Keys[3] --> Key 4 Keys [4]interfaces.IHash `json:"identity_keys"` SigningKey interfaces.IHash `json:"signing_key"` Status uint8 `json:"status"` AnchorKeys []AnchorSigningKey `json:"anchor_keys"` Efficiency uint16 `json:"efficiency"` CoinbaseAddress interfaces.IHash `json:"coinbase_address"` }
https://github.com/DCNT-Hammer/dcntocs/blob/master/Identity.md
func NewIdentity ¶
func NewIdentity() *Identity
func RandomIdentity ¶
func RandomIdentity() *Identity
func (*Identity) GetCoinbaseHumanReadable ¶
func (*Identity) IsComplete ¶
IsComplete returns if the identity is complete, meaning it has all of the required information for an authority server. If the identity is not valid, a list of missing things will be returned in the error
func (*Identity) IsPromteable ¶
IsPromteable will return if the identity is able to be promoted.
Checks if the Identity is complete Checks if the registration is valid
func (*Identity) IsRegistrationValid ¶
IsRegistrationValid will return if the registration of the identity is valid. It is determined by the block heights of registration to creation and is all time based (where time is measured in blocks)
func (*Identity) JSONString ¶
func (*Identity) MarshalBinary ¶
func (*Identity) ToAuthority ¶
ToAuthority should ONLY be used in TESTING
Helpful for unit tests, useless for anything else
func (*Identity) UnmarshalBinary ¶
func (*Identity) UnmarshalBinaryData ¶
func (*Identity) VerifySignature ¶
type IdentityManager ¶
type IdentityManager struct { Mutex sync.RWMutex IdentityManagerWithoutMutex }
func NewIdentityManager ¶
func NewIdentityManager() *IdentityManager
func RandomIdentityManager ¶
func RandomIdentityManager() *IdentityManager
func RandomIdentityManagerWithCounts ¶
func RandomIdentityManagerWithCounts(fedCount, audCount int) *IdentityManager
func (*IdentityManager) ApplyAddAuditServer ¶
func (im *IdentityManager) ApplyAddAuditServer(entry interfaces.IABEntry, st interfaces.IState) error
func (*IdentityManager) ApplyAddEfficiency ¶
func (im *IdentityManager) ApplyAddEfficiency(entry interfaces.IABEntry) error
func (*IdentityManager) ApplyAddFactoidAddress ¶
func (im *IdentityManager) ApplyAddFactoidAddress(entry interfaces.IABEntry) error
func (*IdentityManager) ApplyAddFederatedServer ¶
func (im *IdentityManager) ApplyAddFederatedServer(entry interfaces.IABEntry, st interfaces.IState) error
func (*IdentityManager) ApplyAddFederatedServerBitcoinAnchorKey ¶
func (im *IdentityManager) ApplyAddFederatedServerBitcoinAnchorKey(entry interfaces.IABEntry) error
func (*IdentityManager) ApplyAddFederatedServerSigningKey ¶
func (im *IdentityManager) ApplyAddFederatedServerSigningKey(entry interfaces.IABEntry) error
func (*IdentityManager) ApplyAddReplaceMatryoshkaHash ¶
func (im *IdentityManager) ApplyAddReplaceMatryoshkaHash(entry interfaces.IABEntry) error
func (*IdentityManager) ApplyCancelCoinbaseDescriptor ¶
func (im *IdentityManager) ApplyCancelCoinbaseDescriptor(entry interfaces.IABEntry) error
func (*IdentityManager) ApplyIdentityChainStructure ¶
func (im *IdentityManager) ApplyIdentityChainStructure(ic *IdentityChainStructure, chainID interfaces.IHash, dBlockHeight uint32) (bool, error)
func (*IdentityManager) ApplyIncreaseServerCount ¶
func (im *IdentityManager) ApplyIncreaseServerCount(entry interfaces.IABEntry) error
func (*IdentityManager) ApplyNewBitcoinKeyStructure ¶
func (im *IdentityManager) ApplyNewBitcoinKeyStructure(bnk *NewBitcoinKeyStructure, subChainID interfaces.IHash, BlockChain string, dBlockTimestamp interfaces.Timestamp, a interfaces.IAdminBlock) (bool, bool, error)
Returns
bool change If a key has been changed bool tryagain If this is set to true, this entry can be reprocessed if it is *new* error err Any errors
func (*IdentityManager) ApplyNewBlockSigningKeyStruct ¶
func (im *IdentityManager) ApplyNewBlockSigningKeyStruct(nbsk *NewBlockSigningKeyStruct, subchainID interfaces.IHash, dBlockTimestamp interfaces.Timestamp, a interfaces.IAdminBlock) (bool, bool, error)
ApplyNewBlockSigningKeyStruct will parse a new block signing key and attempt to add the signing to the proper identity.
Returns bool change If a key has been changed bool tryagain If this is set to true, this entry can be reprocessed if it is *new* error err Any errors
func (*IdentityManager) ApplyNewCoinbaseAddressStruct ¶
func (im *IdentityManager) ApplyNewCoinbaseAddressStruct(ncas *NewCoinbaseAddressStruct, rootchainID interfaces.IHash, dBlockTimestamp interfaces.Timestamp, a interfaces.IAdminBlock) (bool, bool, error)
ApplyNewCoinbaseAddressStruct will parse a new coinbase address and attempt to add the signing to the proper identity.
Returns bool change If a key has been changed bool tryagain If this is set to true, this entry can be reprocessed if it is *new* error err Any errors
func (*IdentityManager) ApplyNewCoinbaseCancelStruct ¶
func (im *IdentityManager) ApplyNewCoinbaseCancelStruct(nccs *NewCoinbaseCancelStruct, managechain interfaces.IHash, dblockHeight uint32, a interfaces.IAdminBlock) (bool, bool, error)
ApplyNewCoinbaseCancelStruct will parse a new coinbase cancel
Validation Difference: Most entries check the timestamps to ensure entry is within 12 hours of dblock. That does not apply to coinbase, it can be replayed as long as it is between the block window. Returns bool change If a key has been changed bool tryagain If this is set to true, this entry can be reprocessed if it is *new* error err Any errors
func (*IdentityManager) ApplyNewMatryoshkaHashStructure ¶
func (im *IdentityManager) ApplyNewMatryoshkaHashStructure(nmh *NewMatryoshkaHashStructure, dBlockTimestamp interfaces.Timestamp, a interfaces.IAdminBlock) (bool, bool, error)
ApplyNewMatryoshkaHashStructure will parse a new matryoshka hash and attempt to add the signing to the proper identity.
Returns bool change If a key has been changed bool tryagain If this is set to true, this entry can be reprocessed if it is *new* error err Any errors
func (*IdentityManager) ApplyNewServerEfficiencyStruct ¶
func (im *IdentityManager) ApplyNewServerEfficiencyStruct(nses *NewServerEfficiencyStruct, subchainID interfaces.IHash, dBlockTimestamp interfaces.Timestamp, a interfaces.IAdminBlock) (bool, bool, error)
ApplyNewServerEfficiencyStruct will parse a new server efficiency and attempt to add the signing to the proper identity.
Returns bool change If a key has been changed bool tryagain If this is set to true, this entry can be reprocessed if it is *new* error err Any errors
func (*IdentityManager) ApplyRegisterFactomIdentityStructure ¶
func (im *IdentityManager) ApplyRegisterFactomIdentityStructure(rfi *RegisterFactomIdentityStructure, dBlockHeight uint32) (bool, error)
func (*IdentityManager) ApplyRegisterServerManagementStructure ¶
func (im *IdentityManager) ApplyRegisterServerManagementStructure(rsm *RegisterServerManagementStructure, chainID interfaces.IHash, dBlockHeight uint32) (bool, error)
func (*IdentityManager) ApplyRemoveFederatedServer ¶
func (im *IdentityManager) ApplyRemoveFederatedServer(entry interfaces.IABEntry) error
func (*IdentityManager) ApplyRevealMatryoshkaHash ¶
func (im *IdentityManager) ApplyRevealMatryoshkaHash(entry interfaces.IABEntry) error
func (*IdentityManager) ApplyServerFault ¶
func (im *IdentityManager) ApplyServerFault(entry interfaces.IABEntry) error
func (*IdentityManager) ApplyServerManagementStructure ¶
func (im *IdentityManager) ApplyServerManagementStructure(sm *ServerManagementStructure, chainID interfaces.IHash, dBlockHeight uint32) (bool, error)
ApplyServerManagementStructure is the first entry in the management chain
DO NOT set the management chain in the identity, as it will be set on the register "Server Management"
func (*IdentityManager) AuditServerCount ¶
func (im *IdentityManager) AuditServerCount() int
func (*IdentityManager) AuthorityServerCount ¶
func (im *IdentityManager) AuthorityServerCount() int
AuthorityServerCount returns the total count of Federated + Audit Servers
func (*IdentityManager) CheckDBSignatureEntries ¶
func (im *IdentityManager) CheckDBSignatureEntries(aBlock interfaces.IAdminBlock, dBlock interfaces.IDirectoryBlock, prevHeader []byte) error
func (*IdentityManager) Clone ¶
func (im *IdentityManager) Clone() *IdentityManager
Used when cloning state into sim nodes
func (*IdentityManager) FedServerCount ¶
func (im *IdentityManager) FedServerCount() int
func (*IdentityManager) GetAuthorities ¶
func (im *IdentityManager) GetAuthorities() []interfaces.IAuthority
func (*IdentityManager) GetAuthority ¶
func (im *IdentityManager) GetAuthority(chainID interfaces.IHash) *Authority
func (*IdentityManager) GetIdentities ¶
func (im *IdentityManager) GetIdentities() []*Identity
func (*IdentityManager) GetIdentity ¶
func (im *IdentityManager) GetIdentity(chainID interfaces.IHash) *Identity
func (*IdentityManager) GetRegistrations ¶
func (im *IdentityManager) GetRegistrations() []*identityEntries.RegisterFactomIdentityStructure
func (*IdentityManager) GetSortedAuthorities ¶
func (im *IdentityManager) GetSortedAuthorities() []interfaces.IAuthority
func (*IdentityManager) GetSortedIdentities ¶
func (im *IdentityManager) GetSortedIdentities() []*Identity
func (*IdentityManager) GetSortedRegistrations ¶
func (im *IdentityManager) GetSortedRegistrations() []*identityEntries.RegisterFactomIdentityStructure
func (*IdentityManager) GobDecode ¶
func (im *IdentityManager) GobDecode(data []byte) error
func (*IdentityManager) GobEncode ¶
func (im *IdentityManager) GobEncode() ([]byte, error)
func (*IdentityManager) Init ¶
func (im *IdentityManager) Init()
func (*IdentityManager) IsSameAs ¶
func (a *IdentityManager) IsSameAs(b *IdentityManager) bool
func (*IdentityManager) MarshalBinary ¶
func (im *IdentityManager) MarshalBinary() ([]byte, error)
func (*IdentityManager) ProcessABlockEntry ¶
func (im *IdentityManager) ProcessABlockEntry(entry interfaces.IABEntry, st interfaces.IState) error
func (*IdentityManager) ProcessIdentityEntry ¶
func (im *IdentityManager) ProcessIdentityEntry(entry interfaces.IEBEntry, dBlockHeight uint32, dBlockTimestamp interfaces.Timestamp, newEntry bool) (bool, error)
func (*IdentityManager) ProcessIdentityEntryWithABlockUpdate ¶
func (im *IdentityManager) ProcessIdentityEntryWithABlockUpdate(entry interfaces.IEBEntry, dBlockHeight uint32, dBlockTimestamp interfaces.Timestamp, a interfaces.IAdminBlock, newEntry bool) (bool, error)
ProcessIdentityEntryWithABlockUpdate will process an entry and update an entry. It will also update the admin block with any changes. There are some special parameters:
Params: entry dBlockHeight dBlockTimestamp d DBState If not nil, it means to update the admin block with changes newEntry bool Setting this to true means it can be put into the oldEntries queue to be reprocesses (helps for out of order entries) Returns change bool If a key has been changed err error
func (*IdentityManager) ProcessOldEntries ¶
func (im *IdentityManager) ProcessOldEntries() (bool, error)
func (*IdentityManager) PushEntryForLater ¶
func (im *IdentityManager) PushEntryForLater(entry interfaces.IEBEntry, dBlockHeight uint32, dBlockTimestamp interfaces.Timestamp) error
func (*IdentityManager) RemoveAuthority ¶
func (im *IdentityManager) RemoveAuthority(chainID interfaces.IHash) bool
func (*IdentityManager) RemoveIdentity ¶
func (im *IdentityManager) RemoveIdentity(chainID interfaces.IHash) bool
func (*IdentityManager) SetAuthority ¶
func (im *IdentityManager) SetAuthority(chainID interfaces.IHash, auth *Authority)
func (*IdentityManager) SetBootstrapIdentity ¶
func (im *IdentityManager) SetBootstrapIdentity(id interfaces.IHash, key interfaces.IHash) error
func (*IdentityManager) SetIdentity ¶
func (im *IdentityManager) SetIdentity(chainID interfaces.IHash, id *Identity)
func (*IdentityManager) SetIdentityRegistration ¶
func (im *IdentityManager) SetIdentityRegistration(chain interfaces.IHash) error
func (*IdentityManager) SetSkeletonIdentity ¶
func (im *IdentityManager) SetSkeletonIdentity(chain interfaces.IHash) error
func (*IdentityManager) String ¶
func (im *IdentityManager) String() string
Full print of Identity Manager
func (*IdentityManager) UnmarshalBinary ¶
func (e *IdentityManager) UnmarshalBinary(p []byte) error
func (*IdentityManager) UnmarshalBinaryData ¶
func (im *IdentityManager) UnmarshalBinaryData(p []byte) (newData []byte, err error)
type IdentityManagerWithoutMutex ¶
type IdentityManagerWithoutMutex struct { Authorities map[[32]byte]*Authority Identities map[[32]byte]*Identity // All Identity Registrations. IdentityRegistrations map[[32]byte]*identityEntries.RegisterFactomIdentityStructure MaxAuthorityServerCount int // Not Marshalled // Tracks cancellation of coinbases CancelManager *CoinbaseCancelManager // Map of all coinbase outputs that are cancelled. // The map key is the block height of the DESCRIPTOR // The list of ints are the indices of the outputs to be // removed. The keys from the map should be deleted when the // descriptor+declaration height is hit. // [descriptorheight]List of cancelled outputs CanceledCoinbaseOutputs map[uint32][]uint32 OldEntries []*OldEntry }
type IdentitySort ¶
type IdentitySort []*Identity
sort.Sort interface implementation
func (IdentitySort) Len ¶
func (p IdentitySort) Len() int
func (IdentitySort) Less ¶
func (p IdentitySort) Less(i, j int) bool
func (IdentitySort) Swap ¶
func (p IdentitySort) Swap(i, j int)