Documentation
¶
Index ¶
- Constants
- func BytesCmp(a FixLengthBytes, b FixLengthBytes) int
- func MarshalAddress(addr Address) ([]byte, error)
- func MarshalHash(hash Hash) ([]byte, error)
- type AccountHolder
- type Address
- type Address20
- func BigToAddress20(v *big.Int) *Address20
- func BytesToAddress20(b []byte) *Address20
- func CreateAddress20(b Address20, nonce uint64) Address20
- func CreateAddress20_2(b Address20, salt Hash32, inithash []byte) Address20
- func HexToAddress20(hex string) (*Address20, error)
- func RandomAddress20() *Address20
- func (a *Address20) AddressKey() AddressKey
- func (a *Address20) AddressShortString() string
- func (a *Address20) AddressString() string
- func (a *Address20) Big() *big.Int
- func (a *Address20) Bytes() []byte
- func (a *Address20) Cmp(another FixLengthBytes) int
- func (a *Address20) FromBytes(b []byte)
- func (a *Address20) FromHex(s string) (err error)
- func (a *Address20) FromHexNoError(s string)
- func (a *Address20) Hex() string
- func (a *Address20) Length() int
- func (a *Address20) MarshalMsg() ([]byte, error)
- func (a *Address20) MsgSize() int
- func (a *Address20) UnmarshalMsg(b []byte) ([]byte, error)
- type AddressConverter
- type AddressKey
- type BlockContent
- type BlockContentType
- type BlsConsensusAccount
- type CommitteeMemberStore
- type CommitteeStore
- type CryptoType
- type FixLengthBytes
- type Genesis
- type GenesisStore
- type Hash
- type Hash32
- func (a *Hash32) Bytes() []byte
- func (a *Hash32) Cmp(another FixLengthBytes) int
- func (a *Hash32) FromBytes(b []byte)
- func (a *Hash32) FromHex(s string) (err error)
- func (a *Hash32) FromHexNoError(s string)
- func (a *Hash32) HashKey() HashKey
- func (a *Hash32) HashShortString() string
- func (a *Hash32) HashString() string
- func (a *Hash32) Hex() string
- func (a *Hash32) Length() int
- func (a *Hash32) MarshalMsg() ([]byte, error)
- func (a *Hash32) MsgSize() int
- func (a *Hash32) UnmarshalMsg(data []byte) ([]byte, error)
- type HashKey
- type Ledger
- type LedgerAccountProvider
- type LedgerSigner
- type NewHeightDetectedEvent
- type NewHeightDetectedEventSubscriber
- type NodeInfoProvider
- type OgLedgerAccount
- type OgSequencer
- type OgTx
- type PeerJoinedEvent
- type PeerJoinedEventSubscriber
- type PeerLeftEvent
- type PeerLeftEventSubscriber
- type PrivateGenerator
- type Syncer
- type Unknown
- type UnknownHash
- type UnknownHeight
- type UnknownManager
- type UnknownType
Constants ¶
View Source
const ( FlagAddressNone byte = iota FlagAddress20 )
View Source
const ( FlagHashNone byte = iota FlagHash32 )
View Source
const (
Address20Length = 20
)
View Source
const CryptoTypeECDSA = CryptoType(cryptopb.KeyType_ECDSA)
View Source
const CryptoTypeEd25519 = CryptoType(cryptopb.KeyType_Ed25519)
View Source
const CryptoTypeRSA = CryptoType(cryptopb.KeyType_RSA)
View Source
const CryptoTypeSecp256k1 = CryptoType(cryptopb.KeyType_Secp256k1)
View Source
const (
Hash32Length = 32
)
Variables ¶
This section is empty.
Functions ¶
func BytesCmp ¶
func BytesCmp(a FixLengthBytes, b FixLengthBytes) int
func MarshalAddress ¶
func MarshalHash ¶
Types ¶
type AccountHolder ¶
type Address ¶
type Address interface { FixLengthBytes AddressKey() AddressKey AddressString() string // just for type safety between Address and Hash AddressShortString() string marshaller.IMarshaller }
func AddressFromAddressKey ¶
func AddressFromAddressKey(key AddressKey) (Address, error)
func AddressFromHex ¶
type Address20 ¶
type Address20 struct {
// contains filtered or unexported fields
}
func BigToAddress20 ¶
func BytesToAddress20 ¶
func CreateAddress20 ¶
CreateAddress creates an address20 given the bytes and the nonce
func CreateAddress20_2 ¶
CreateAddress2 creates an address20 given the address bytes, initial contract code hash and a salt.
func HexToAddress20 ¶
func RandomAddress20 ¶
func RandomAddress20() *Address20
func (*Address20) AddressKey ¶
func (a *Address20) AddressKey() AddressKey
func (*Address20) AddressShortString ¶
func (*Address20) AddressString ¶
func (*Address20) Cmp ¶
func (a *Address20) Cmp(another FixLengthBytes) int
func (*Address20) FromHexNoError ¶
func (*Address20) MarshalMsg ¶
type AddressConverter ¶
type AddressConverter interface {
AddressFromAccount(account *OgLedgerAccount) (addr Address, err error)
}
type AddressKey ¶
type AddressKey string
func (AddressKey) Bytes ¶
func (k AddressKey) Bytes() []byte
type BlockContent ¶
type BlockContent interface { GetType() BlockContentType String() string FromString(string) GetHash() Hash GetHeight() int64 }
type BlockContentType ¶
type BlockContentType int
const (
BlockContentTypeInt BlockContentType = iota
)
type BlsConsensusAccount ¶
type BlsConsensusAccount struct {
// contains filtered or unexported fields
}
func (BlsConsensusAccount) Id ¶
func (b BlsConsensusAccount) Id() string
type CommitteeMemberStore ¶
type CommitteeStore ¶
type CommitteeStore struct { Version int Peers []CommitteeMemberStore }
type CryptoType ¶
type CryptoType int
type FixLengthBytes ¶
type Genesis ¶
type Genesis struct { //RootSequencerHash og_interface.Hash FirstCommittee *consensus_interface.Committee }
type GenesisStore ¶
type GenesisStore struct { //RootSequencerHash string FirstCommittee CommitteeStore }
type Hash ¶
type Hash interface { FixLengthBytes HashKey() HashKey HashString() string HashShortString() string marshaller.IMarshaller }
type Hash32 ¶
type Hash32 [Hash32Length]byte
func BigToHash32 ¶
func BytesToHash32 ¶
func HexToHash32 ¶
func RandomHash32 ¶
func RandomHash32() *Hash32
func (*Hash32) Cmp ¶
func (a *Hash32) Cmp(another FixLengthBytes) int
func (*Hash32) FromHexNoError ¶
func (*Hash32) HashShortString ¶
func (*Hash32) HashString ¶
func (*Hash32) MarshalMsg ¶
type Ledger ¶
type Ledger interface { CurrentHeight() int64 CurrentCommittee() *consensus_interface.Committee GetBlock(height int64) BlockContent ConfirmBlock(block BlockContent) GetResource(request ResourceRequest) Resource }
type LedgerAccountProvider ¶
type LedgerAccountProvider interface { ProvideAccount() (*OgLedgerAccount, error) Generate() (account *OgLedgerAccount, err error) Load() (account *OgLedgerAccount, err error) Save() (err error) }
type LedgerSigner ¶
type LedgerSigner interface {
Sign(msg []byte, account OgLedgerAccount) []byte
}
type NewHeightDetectedEvent ¶
type NewHeightDetectedEventSubscriber ¶
type NewHeightDetectedEventSubscriber interface { Name() string NewHeightDetectedEventChannel() chan *NewHeightDetectedEvent }
type NodeInfoProvider ¶
type OgLedgerAccount ¶
OgLedgerAccount represents a full account of a user.
type OgSequencer ¶
type OgSequencer struct { }
type PeerJoinedEvent ¶
type PeerJoinedEvent struct {
PeerId string
}
type PeerJoinedEventSubscriber ¶
type PeerJoinedEventSubscriber interface {
EventChannelPeerJoined() chan *PeerJoinedEvent
}
type PeerLeftEvent ¶
type PeerLeftEvent struct {
PeerId string
}
type PeerLeftEventSubscriber ¶
type PeerLeftEventSubscriber interface {
EventChannelPeerLeft() chan *PeerLeftEvent
}
type PrivateGenerator ¶
type Unknown ¶
type Unknown interface { GetType() UnknownType GetValue() interface{} }
Unknown represents a resource that needs to be synced from others
type UnknownHash ¶
type UnknownHash struct {
// contains filtered or unexported fields
}
func (UnknownHash) GetType ¶
func (u UnknownHash) GetType() UnknownType
func (UnknownHash) GetValue ¶
func (u UnknownHash) GetValue() interface{}
type UnknownHeight ¶
type UnknownHeight struct {
// contains filtered or unexported fields
}
func (UnknownHeight) GetType ¶
func (u UnknownHeight) GetType() UnknownType
func (UnknownHeight) GetValue ¶
func (u UnknownHeight) GetValue() interface{}
type UnknownManager ¶
type UnknownManager interface { }
type UnknownType ¶
type UnknownType int
const ( UnknownTypeHeight UnknownType = iota UnknownTypeHash )
Click to show internal directories.
Click to hide internal directories.