Documentation ¶
Index ¶
- Constants
- Variables
- func AddPocketNodeByFilePVKey(fpvKey privval.FilePVKey, logger log.Logger)
- func AddressVerification(addr string) sdk.Error
- func BlockHash(ctx sdk.Context) string
- func CleanPocketNodes()
- func ClearEvidence(evidenceStore *CacheStorage)
- func ClearSessionCache(sessionStore *CacheStorage)
- func ConvertEvidenceToProto(config types.Config) error
- func DeleteEvidence(header SessionHeader, evidenceType EvidenceType, evidenceStore *CacheStorage) error
- func DeleteSession(header SessionHeader, sessionStore *CacheStorage)
- func ErrorWarrantsDispatch(err error) bool
- func FlushSessionCache()
- func GenerateProofs(height int64, p []Proof, index int) (mProof MerkleProof, leaf Proof)
- func GenerateRoot(height int64, data []Proof) (r HashRange, sortedData []Proof)
- func GetApp(ctx sdk.Ctx, appsKeeper AppsKeeper, address sdk.Address) (a exported.ApplicationI, found bool)
- func GetAppFromPublicKey(ctx sdk.Ctx, appsKeeper AppsKeeper, pubKey string) (app exported.ApplicationI, found bool)
- func GetRPCTimeout() time.Duration
- func Hash(b []byte) []byte
- func HashVerification(hash string) sdk.Error
- func InitClientBlockAllowance(allowance int)
- func InitConfig(chains *HostedBlockchains, logger log.Logger, c types.Config)
- func InitGlobalServiceMetric(hostedBlockchains *HostedBlockchains, logger log.Logger, addr string, ...)
- func InitPocketNodeCache(node *PocketNode, c types.Config, logger log.Logger)
- func InitPocketNodeCaches(c types.Config, logger log.Logger)
- func IsUniqueProof(p Proof, evidence Evidence) bool
- func KeyForClaim(ctx sdk.Ctx, addr sdk.Address, header SessionHeader, evidenceType EvidenceType) ([]byte, error)
- func KeyForClaims(addr sdk.Address) ([]byte, error)
- func KeyForEvidence(header SessionHeader, evidenceType EvidenceType) ([]byte, error)
- func KeyForServiceMetrics() []byte
- func MaxPossibleRelays(app appexported.ApplicationI, sessionNodeCount int64) sdk.BigInt
- func MultiAppend(dest []byte, s ...[]byte) []byte
- func NetworkIdentifierVerification(hash string) sdk.Error
- func NewAddressInvalidLengthError(codespace sdk.CodespaceType) sdk.Error
- func NewAppNotFoundError(codespace sdk.CodespaceType) sdk.Error
- func NewChainNotSupportedErr(codespace sdk.CodespaceType) sdk.Error
- func NewChainsOverLimitError(codespace sdk.CodespaceType, gotChains, maxChains int64) sdk.Error
- func NewClaimNotFoundError(codespace sdk.CodespaceType) sdk.Error
- func NewCousinLeafEquivalentError(codespace sdk.CodespaceType) sdk.Error
- func NewDuplicateProofError(codespace sdk.CodespaceType) sdk.Error
- func NewDuplicatePublicKeyError(codespace sdk.CodespaceType) sdk.Error
- func NewEmptyAddressError(codespace sdk.CodespaceType) sdk.Error
- func NewEmptyBlockIDError(codespace sdk.CodespaceType) sdk.Error
- func NewEmptyChainError(codespace sdk.CodespaceType) sdk.Error
- func NewEmptyHashError(codespace sdk.CodespaceType) sdk.Error
- func NewEmptyMerkleTreeError(codespace sdk.CodespaceType) sdk.Error
- func NewEmptyNonNativeChainError(codespace sdk.CodespaceType) sdk.Error
- func NewEmptyPayloadDataError(codespace sdk.CodespaceType) sdk.Error
- func NewEmptyProofsError(codespace sdk.CodespaceType) sdk.Error
- func NewEmptyResponseError(codespace sdk.CodespaceType) sdk.Error
- func NewErrorChainNotHostedError(codespace sdk.CodespaceType) sdk.Error
- func NewExpiredProofsSubmissionError(codespace sdk.CodespaceType) sdk.Error
- func NewFilterNodesError(codespace sdk.CodespaceType, err error) sdk.Error
- func NewHTTPExecutionError(codespace sdk.CodespaceType, err error) sdk.Error
- func NewHTTPStatusCodeError(codespace sdk.CodespaceType, statusCode int) sdk.Error
- func NewHexDecodeError(codespace sdk.CodespaceType, err error) sdk.Error
- func NewInsufficientNodesError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidAppPubKeyError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidBlockHeightError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidChainParamsError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidEntropyError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidEvidenceErr(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidExpirationHeightErr(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidHashError(codespace sdk.CodespaceType, err error, h string) sdk.Error
- func NewInvalidHashLengthError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidHostedChainError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidLeafCousinProofsComboError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidMerkleRangeError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidMerkleVerifyError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidNetIDLengthError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidNodePubKeyError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidPKError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidProofsError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidRootError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidSessionError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidSessionKeyError(codespace sdk.CodespaceType, err error) sdk.Error
- func NewInvalidSignatureError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidSignatureSizeError(codespace sdk.CodespaceType) sdk.Error
- func NewInvalidTokenError(codespace sdk.CodespaceType, err error) sdk.Error
- func NewJSONMarshalError(codespace sdk.CodespaceType, err error) sdk.Error
- func NewKeybaseError(codespace sdk.CodespaceType, err error) sdk.Error
- func NewMerkleNodeNotFoundError(codespace sdk.CodespaceType) sdk.Error
- func NewMismatchedAppPubKeyError(codespace sdk.CodespaceType) sdk.Error
- func NewMismatchedBlockchainsError(codespace sdk.CodespaceType) sdk.Error
- func NewMismatchedRequestHashError(codespace sdk.CodespaceType) sdk.Error
- func NewMismatchedSessionHeightError(codespace sdk.CodespaceType) sdk.Error
- func NewMsgDecodeError(codespace sdk.CodespaceType) sdk.Error
- func NewNoEvidenceTypeErr(codespace sdk.CodespaceType) sdk.Error
- func NewNoMajorityResponseError(codespace sdk.CodespaceType) sdk.Error
- func NewNodeNotFoundErr(codespace sdk.CodespaceType) sdk.Error
- func NewNodeNotInSessionError(codespace sdk.CodespaceType) sdk.Error
- func NewOutOfSyncRequestError(codespace sdk.CodespaceType) sdk.Error
- func NewOverServiceError(codespace sdk.CodespaceType) sdk.Error
- func NewPubKeyDecodeError(codespace sdk.CodespaceType) sdk.Error
- func NewPubKeyError(codespace sdk.CodespaceType, err error) sdk.Error
- func NewPubKeySizeError(codespace sdk.CodespaceType) sdk.Error
- func NewReplayAttackError(codespace sdk.CodespaceType) sdk.Error
- func NewRequestHashError(codespace sdk.CodespaceType) sdk.Error
- func NewResponseSignatureError(codespace sdk.CodespaceType) sdk.Error
- func NewSealedEvidenceError(codespace sdk.CodespaceType) sdk.Error
- func NewSelfNotFoundError(codespace sdk.CodespaceType) sdk.Error
- func NewSigDecodeError(codespace sdk.CodespaceType) sdk.Error
- func NewSignatureError(codespace sdk.CodespaceType, err error) sdk.Error
- func NewUnsupportedBlockchainAppError(codespace sdk.CodespaceType) sdk.Error
- func NewUnsupportedBlockchainError(codespace sdk.CodespaceType) sdk.Error
- func NewUnsupportedBlockchainNodeError(codespace sdk.CodespaceType) sdk.Error
- func NewXORError(codespace sdk.CodespaceType, err error) sdk.Error
- func NodeHasChain(chain string, node exported.ValidatorI) bool
- func PseudorandomSelection(max sdk.BigInt, hash []byte) (index sdk.BigInt)
- func PubKeyVerification(pk string) sdk.Error
- func RegisterCodec(cdc *codec.Codec)
- func SetEvidence(evidence Evidence, evidenceStore *CacheStorage)
- func SetProof(header SessionHeader, evidenceType EvidenceType, p Proof, max sdk.BigInt, ...)
- func SetRPCTimeout(timeout int64)
- func SetSession(session Session, sessionStore *CacheStorage)
- func SignatureVerification(publicKeyHex, msgHex, sigHex string) sdk.Error
- func StopServiceMetrics()
- func ValidateGenesis(gs GenesisState) error
- type AAT
- func (a AAT) Bytes() []byte
- func (*AAT) Descriptor() ([]byte, []int)
- func (a AAT) Hash() []byte
- func (a AAT) HashString() string
- func (m *AAT) Marshal() (dAtA []byte, err error)
- func (m *AAT) MarshalTo(dAtA []byte) (int, error)
- func (m *AAT) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AAT) ProtoMessage()
- func (m *AAT) Reset()
- func (m *AAT) Size() (n int)
- func (m *AAT) String() string
- func (m *AAT) Unmarshal(dAtA []byte) error
- func (a AAT) Validate() error
- func (a AAT) ValidateMessage() error
- func (a AAT) ValidateSignature() error
- func (a AAT) ValidateVersion() error
- func (a AAT) VersionIsIncluded() bool
- func (a AAT) VersionIsSupported() bool
- func (m *AAT) XXX_DiscardUnknown()
- func (m *AAT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AAT) XXX_Merge(src proto.Message)
- func (m *AAT) XXX_Size() int
- func (m *AAT) XXX_Unmarshal(b []byte) error
- type AppsKeeper
- type AuthKeeper
- type BasicAuth
- type CacheObject
- type CacheStorage
- func (cs *CacheStorage) Clear()
- func (cs *CacheStorage) Delete(key []byte)
- func (cs *CacheStorage) FlushToDB() error
- func (cs *CacheStorage) FlushToDBWithoutLock() error
- func (cs *CacheStorage) Get(key []byte, object CacheObject) (interface{}, bool)
- func (cs *CacheStorage) GetWithoutLock(key []byte, object CacheObject) (interface{}, bool)
- func (cs *CacheStorage) Init(dir, name string, options config.LevelDBOptions, maxEntries int, ...)
- func (cs *CacheStorage) IsSealed(object CacheObject) bool
- func (cs *CacheStorage) IsSealedWithoutLock(object CacheObject) bool
- func (cs *CacheStorage) Iterator() (db.Iterator, error)
- func (cs *CacheStorage) Seal(object CacheObject) (cacheObject CacheObject, isOK bool)
- func (cs *CacheStorage) Set(key []byte, val CacheObject)
- func (cs *CacheStorage) SetWithoutLockAndSealCheck(key string, val CacheObject)
- type ChallengeProofInvalidData
- func (c ChallengeProofInvalidData) Bytes() []byte
- func (*ChallengeProofInvalidData) Descriptor() ([]byte, []int)
- func (c ChallengeProofInvalidData) GetSigner() sdk.Address
- func (c ChallengeProofInvalidData) Hash() []byte
- func (c ChallengeProofInvalidData) HashString() string
- func (m *ChallengeProofInvalidData) Marshal() (dAtA []byte, err error)
- func (m *ChallengeProofInvalidData) MarshalTo(dAtA []byte) (int, error)
- func (m *ChallengeProofInvalidData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ChallengeProofInvalidData) ProtoMessage()
- func (m *ChallengeProofInvalidData) Reset()
- func (c ChallengeProofInvalidData) SessionHeader() SessionHeader
- func (m *ChallengeProofInvalidData) Size() (n int)
- func (c ChallengeProofInvalidData) Store(maxChallenges sdk.BigInt, evidenceStore *CacheStorage)
- func (m *ChallengeProofInvalidData) String() string
- func (c ChallengeProofInvalidData) ToProto() ProofI
- func (m *ChallengeProofInvalidData) Unmarshal(dAtA []byte) error
- func (c ChallengeProofInvalidData) Validate(appSupportedBlockchains []string, sessionNodeCount int, ...) sdk.Error
- func (c ChallengeProofInvalidData) ValidateBasic() sdk.Error
- func (c ChallengeProofInvalidData) ValidateLocal(h SessionHeader, maxRelays sdk.BigInt, supportedBlockchains []string, ...) sdk.Error
- func (m *ChallengeProofInvalidData) XXX_DiscardUnknown()
- func (m *ChallengeProofInvalidData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ChallengeProofInvalidData) XXX_Merge(src proto.Message)
- func (m *ChallengeProofInvalidData) XXX_Size() int
- func (m *ChallengeProofInvalidData) XXX_Unmarshal(b []byte) error
- type ChallengeResponse
- type DispatchResponse
- type DispatchSession
- type Evidence
- func GetEvidence(header SessionHeader, evidenceType EvidenceType, max sdk.BigInt, ...) (evidence Evidence, err error)
- func GetTotalProofs(h SessionHeader, et EvidenceType, maxPossibleRelays sdk.BigInt, ...) (Evidence, int64)
- func SealEvidence(evidence Evidence, storage *CacheStorage) (Evidence, bool)
- func (e *Evidence) AddProof(p Proof)
- func (e *Evidence) GenerateMerkleProof(height int64, index int, maxRelays int64) (proof MerkleProof, leaf Proof)
- func (e *Evidence) GenerateMerkleRoot(height int64, maxRelays int64, storage *CacheStorage) (root HashRange)
- func (e Evidence) IsSealable() bool
- func (e Evidence) Key() ([]byte, error)
- func (e Evidence) LegacyAminoMarshal() ([]byte, error)
- func (e Evidence) LegacyAminoUnmarshal(b []byte) (CacheObject, error)
- func (e *Evidence) Marshal() ([]byte, error)
- func (e Evidence) MarshalObject() ([]byte, error)
- func (e *Evidence) MarshalTo(data []byte) (n int, err error)
- func (e *Evidence) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (e *Evidence) ProtoMessage()
- func (e *Evidence) Reset()
- func (e *Evidence) Size() int
- func (e *Evidence) String() string
- func (e *Evidence) ToProto() (*ProtoEvidence, error)
- func (e *Evidence) Unmarshal(data []byte) error
- func (e Evidence) UnmarshalObject(b []byte) (CacheObject, error)
- type EvidenceIt
- type EvidenceType
- type GenesisState
- type HashRange
- func (*HashRange) Descriptor() ([]byte, []int)
- func (hr HashRange) Equal(hr2 HashRange) bool
- func (m *HashRange) GetHash() []byte
- func (m *HashRange) GetRange() Range
- func (m *HashRange) Marshal() (dAtA []byte, err error)
- func (m *HashRange) MarshalTo(dAtA []byte) (int, error)
- func (m *HashRange) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*HashRange) ProtoMessage()
- func (m *HashRange) Reset()
- func (m *HashRange) Size() (n int)
- func (m *HashRange) String() string
- func (m *HashRange) Unmarshal(dAtA []byte) error
- func (m *HashRange) XXX_DiscardUnknown()
- func (m *HashRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HashRange) XXX_Merge(src proto.Message)
- func (m *HashRange) XXX_Size() int
- func (m *HashRange) XXX_Unmarshal(b []byte) error
- type HostedBlockchain
- type HostedBlockchains
- type MerkleProof
- func (*MerkleProof) Descriptor() ([]byte, []int)
- func (m *MerkleProof) Marshal() (dAtA []byte, err error)
- func (m *MerkleProof) MarshalTo(dAtA []byte) (int, error)
- func (m *MerkleProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MerkleProof) ProtoMessage()
- func (m *MerkleProof) Reset()
- func (m *MerkleProof) Size() (n int)
- func (m *MerkleProof) String() string
- func (m *MerkleProof) Unmarshal(dAtA []byte) error
- func (mp MerkleProof) Validate(height int64, root HashRange, leaf Proof, numOfLevels int) (isValid bool, isReplayAttack bool)
- func (m *MerkleProof) XXX_DiscardUnknown()
- func (m *MerkleProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MerkleProof) XXX_Merge(src proto.Message)
- func (m *MerkleProof) XXX_Size() int
- func (m *MerkleProof) XXX_Unmarshal(b []byte) error
- type MsgClaim
- func (*MsgClaim) Descriptor() ([]byte, []int)
- func (msg MsgClaim) GetFee() sdk.BigInt
- func (msg MsgClaim) GetRecipient() sdk.Address
- func (msg MsgClaim) GetSignBytes() []byte
- func (msg MsgClaim) GetSigners() []sdk.Address
- func (msg MsgClaim) IsEmpty() bool
- func (m *MsgClaim) Marshal() (dAtA []byte, err error)
- func (m *MsgClaim) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgClaim) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgClaim) ProtoMessage()
- func (m *MsgClaim) Reset()
- func (msg MsgClaim) Route() string
- func (m *MsgClaim) Size() (n int)
- func (m *MsgClaim) String() string
- func (msg MsgClaim) Type() string
- func (m *MsgClaim) Unmarshal(dAtA []byte) error
- func (msg MsgClaim) ValidateBasic() sdk.Error
- func (m *MsgClaim) XXX_DiscardUnknown()
- func (m *MsgClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgClaim) XXX_Merge(src proto.Message)
- func (*MsgClaim) XXX_MessageName() string
- func (m *MsgClaim) XXX_Size() int
- func (m *MsgClaim) XXX_Unmarshal(b []byte) error
- type MsgProof
- func (msg MsgProof) GetFee() sdk.BigInt
- func (msg MsgProof) GetLeaf() Proof
- func (msg MsgProof) GetRecipient() sdk.Address
- func (msg MsgProof) GetSignBytes() []byte
- func (msg MsgProof) GetSigners() []sdk.Address
- func (msg *MsgProof) Marshal() ([]byte, error)
- func (msg *MsgProof) MarshalTo(data []byte) (n int, err error)
- func (msg *MsgProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (msg *MsgProof) ProtoMessage()
- func (msg *MsgProof) Reset()
- func (msg MsgProof) Route() string
- func (msg *MsgProof) Size() int
- func (msg MsgProof) String() string
- func (msg MsgProof) ToProto() MsgProtoProof
- func (msg MsgProof) Type() string
- func (msg *MsgProof) Unmarshal(data []byte) error
- func (msg MsgProof) ValidateBasic() sdk.Error
- type MsgProtoProof
- func (*MsgProtoProof) Descriptor() ([]byte, []int)
- func (m *MsgProtoProof) Marshal() (dAtA []byte, err error)
- func (m *MsgProtoProof) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgProtoProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgProtoProof) ProtoMessage()
- func (m *MsgProtoProof) Reset()
- func (m *MsgProtoProof) Size() (n int)
- func (m *MsgProtoProof) String() string
- func (m *MsgProtoProof) Unmarshal(dAtA []byte) error
- func (m *MsgProtoProof) XXX_DiscardUnknown()
- func (m *MsgProtoProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgProtoProof) XXX_Merge(src proto.Message)
- func (*MsgProtoProof) XXX_MessageName() string
- func (m *MsgProtoProof) XXX_Size() int
- func (m *MsgProtoProof) XXX_Unmarshal(b []byte) error
- type Params
- type Payload
- type PocketKeeper
- type PocketNode
- type PosKeeper
- type Proof
- type ProofI
- func (*ProofI) Descriptor() ([]byte, []int)
- func (pi ProofI) FromProto() Proof
- func (m *ProofI) GetChallengeProof() *ChallengeProofInvalidData
- func (m *ProofI) GetProof() isProofI_Proof
- func (m *ProofI) GetRelayProof() *RelayProof
- func (m *ProofI) Marshal() (dAtA []byte, err error)
- func (m *ProofI) MarshalTo(dAtA []byte) (int, error)
- func (m *ProofI) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ProofI) ProtoMessage()
- func (m *ProofI) Reset()
- func (m *ProofI) Size() (n int)
- func (m *ProofI) String() string
- func (m *ProofI) Unmarshal(dAtA []byte) error
- func (m *ProofI) XXX_DiscardUnknown()
- func (m *ProofI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProofI) XXX_Merge(src proto.Message)
- func (*ProofI) XXX_OneofWrappers() []interface{}
- func (m *ProofI) XXX_Size() int
- func (m *ProofI) XXX_Unmarshal(b []byte) error
- type ProofI_ChallengeProof
- type ProofI_RelayProof
- type ProofIs
- type Proofs
- type ProtoEvidence
- func (*ProtoEvidence) Descriptor() ([]byte, []int)
- func (pe *ProtoEvidence) FromProto() (Evidence, error)
- func (m *ProtoEvidence) Marshal() (dAtA []byte, err error)
- func (m *ProtoEvidence) MarshalTo(dAtA []byte) (int, error)
- func (m *ProtoEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ProtoEvidence) ProtoMessage()
- func (m *ProtoEvidence) Reset()
- func (m *ProtoEvidence) Size() (n int)
- func (m *ProtoEvidence) String() string
- func (m *ProtoEvidence) Unmarshal(dAtA []byte) error
- func (m *ProtoEvidence) XXX_DiscardUnknown()
- func (m *ProtoEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProtoEvidence) XXX_Merge(src proto.Message)
- func (m *ProtoEvidence) XXX_Size() int
- func (m *ProtoEvidence) XXX_Unmarshal(b []byte) error
- type QueryChallengeParams
- type QueryDispatchParams
- type QueryReceiptParams
- type QueryReceiptsParams
- type QueryRelayParams
- type Range
- func (r Range) Bytes() []byte
- func (*Range) Descriptor() ([]byte, []int)
- func (r Range) Equal(r2 Range) bool
- func (m *Range) Marshal() (dAtA []byte, err error)
- func (m *Range) MarshalTo(dAtA []byte) (int, error)
- func (m *Range) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Range) ProtoMessage()
- func (m *Range) Reset()
- func (m *Range) Size() (n int)
- func (m *Range) String() string
- func (m *Range) Unmarshal(dAtA []byte) error
- func (m *Range) XXX_DiscardUnknown()
- func (m *Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Range) XXX_Merge(src proto.Message)
- func (m *Range) XXX_Size() int
- func (m *Range) XXX_Unmarshal(b []byte) error
- type Relay
- func (r Relay) Bytes() []byte
- func (r Relay) Execute(hostedBlockchains *HostedBlockchains, address *sdk.Address) (string, sdk.Error)
- func (r Relay) RequestHash() []byte
- func (r Relay) RequestHashString() string
- func (r *Relay) Validate(ctx sdk.Ctx, posKeeper PosKeeper, appsKeeper AppsKeeper, ...) (maxPossibleRelays sdk.BigInt, err sdk.Error)
- type RelayMeta
- type RelayProof
- func (rp RelayProof) Bytes() []byte
- func (rp RelayProof) BytesWithSignature() []byte
- func (*RelayProof) Descriptor() ([]byte, []int)
- func (rp RelayProof) GetSigner() sdk.Address
- func (rp RelayProof) Hash() []byte
- func (rp RelayProof) HashString() string
- func (rp RelayProof) HashStringWithSignature() string
- func (rp RelayProof) HashWithSignature() []byte
- func (m *RelayProof) Marshal() (dAtA []byte, err error)
- func (m *RelayProof) MarshalTo(dAtA []byte) (int, error)
- func (m *RelayProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RelayProof) ProtoMessage()
- func (m *RelayProof) Reset()
- func (rp RelayProof) SessionHeader() SessionHeader
- func (m *RelayProof) Size() (n int)
- func (rp RelayProof) Store(maxRelays sdk.BigInt, evidenceStore *CacheStorage)
- func (m *RelayProof) String() string
- func (rp RelayProof) ToProto() ProofI
- func (m *RelayProof) Unmarshal(dAtA []byte) error
- func (rp RelayProof) Validate(appSupportedBlockchains []string, _ int, sessionBlockHeight int64) sdk.Error
- func (rp RelayProof) ValidateBasic() sdk.Error
- func (rp RelayProof) ValidateLocal(appSupportedBlockchains []string, sessionNodeCount int, ...) sdk.Error
- func (m *RelayProof) XXX_DiscardUnknown()
- func (m *RelayProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RelayProof) XXX_Merge(src proto.Message)
- func (m *RelayProof) XXX_Size() int
- func (m *RelayProof) XXX_Unmarshal(b []byte) error
- type RelayResponse
- func (*RelayResponse) Descriptor() ([]byte, []int)
- func (rr RelayResponse) Hash() []byte
- func (rr RelayResponse) HashString() string
- func (m *RelayResponse) Marshal() (dAtA []byte, err error)
- func (m *RelayResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *RelayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RelayResponse) ProtoMessage()
- func (m *RelayResponse) Reset()
- func (m *RelayResponse) Size() (n int)
- func (m *RelayResponse) String() string
- func (m *RelayResponse) Unmarshal(dAtA []byte) error
- func (rr RelayResponse) Validate() sdk.Error
- func (m *RelayResponse) XXX_DiscardUnknown()
- func (m *RelayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RelayResponse) XXX_Merge(src proto.Message)
- func (m *RelayResponse) XXX_Size() int
- func (m *RelayResponse) XXX_Unmarshal(b []byte) error
- type ServiceMetric
- type ServiceMetrics
- func (sm *ServiceMetrics) AddChallengeFor(networkID string, nodeAddress *sdk.Address)
- func (sm *ServiceMetrics) AddClaimTiming(networkID string, time float64, nodeAddress *sdk.Address)
- func (sm *ServiceMetrics) AddErrorFor(networkID string, nodeAddress *sdk.Address)
- func (sm *ServiceMetrics) AddProofTiming(networkID string, time float64, nodeAddress *sdk.Address)
- func (sm *ServiceMetrics) AddRelayFor(networkID string, nodeAddress *sdk.Address)
- func (sm *ServiceMetrics) AddRelayTimingFor(networkID string, relayTime float64, nodeAddress *sdk.Address)
- func (sm *ServiceMetrics) AddSessionFor(networkID string, nodeAddress *sdk.Address)
- func (sm *ServiceMetrics) AddUPOKTEarnedFor(networkID string, upoktEarned float64, nodeAddress *sdk.Address)
- func (sm *ServiceMetrics) StartPrometheusServer(addr string, maxOpenConn int) *http.Server
- type ServiceMetricsEncodable
- type Session
- func (*Session) Descriptor() ([]byte, []int)
- func (s Session) HashString() string
- func (s Session) IsSealable() bool
- func (s Session) Key() ([]byte, error)
- func (m *Session) Marshal() (dAtA []byte, err error)
- func (s Session) MarshalObject() ([]byte, error)
- func (m *Session) MarshalTo(dAtA []byte) (int, error)
- func (m *Session) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Session) ProtoMessage()
- func (m *Session) Reset()
- func (m *Session) Size() (n int)
- func (m *Session) String() string
- func (m *Session) Unmarshal(dAtA []byte) error
- func (s Session) UnmarshalObject(b []byte) (CacheObject, error)
- func (s Session) Validate(node sdk.Address, app appexported.ApplicationI, sessionNodeCount int) sdk.Error
- func (m *Session) XXX_DiscardUnknown()
- func (m *Session) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Session) XXX_Merge(src proto.Message)
- func (m *Session) XXX_Size() int
- func (m *Session) XXX_Unmarshal(b []byte) error
- type SessionHeader
- func (sh SessionHeader) Bytes() []byte
- func (*SessionHeader) Descriptor() ([]byte, []int)
- func (sh SessionHeader) Hash() []byte
- func (sh SessionHeader) HashString() string
- func (m *SessionHeader) Marshal() (dAtA []byte, err error)
- func (m *SessionHeader) MarshalTo(dAtA []byte) (int, error)
- func (m *SessionHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SessionHeader) ProtoMessage()
- func (m *SessionHeader) Reset()
- func (m *SessionHeader) Size() (n int)
- func (m *SessionHeader) String() string
- func (m *SessionHeader) Unmarshal(dAtA []byte) error
- func (sh SessionHeader) ValidateHeader() sdk.Error
- func (m *SessionHeader) XXX_DiscardUnknown()
- func (m *SessionHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SessionHeader) XXX_Merge(src proto.Message)
- func (m *SessionHeader) XXX_Size() int
- func (m *SessionHeader) XXX_Unmarshal(b []byte) error
- type SessionIt
- type SessionKey
- type SessionNodes
- type SortByProof
Constants ¶
const ( DefaultRPCTimeout = 3000 MaxRPCTimeout = 1000000 MinRPCTimeout = 1 )
const ( CodeSessionGenerationError = 1 CodeHttpStatusCodeError = 2 CodeInvalidTokenError = 4 CodeInvalidEvidenceError = 5 CodePublKeyDecodeError = 6 CodeEmptyChainError = 8 CodeEmptyBlockIDError = 9 CodeAppPubKeyError = 10 CodeEmptyProofsError = 11 CodeUnsupportedBlockchainAppError = 13 CodeInvalidSessionError = 14 CodeInsufficientNodesError = 17 CodeEmptyNonNativeChainError = 18 CodeInvalidSessionKeyError = 19 CodeFilterNodesError = 20 CodeXORError = 21 CodeInvalidHashError = 22 CodeEmptyBlockHashError = 23 CodeEmptyBlockchainError = 24 CodeEmptyPayloadDataError = 25 CodeUnsupportedBlockchainNodeError = 26 CodeNotStakedBlockchainError = 27 CodeHTTPExecutionError = 28 CodeInvalidEntropyError = 29 CodeEmptyResponseError = 30 CodeResponseSignatureError = 31 CodeNegativeICCounterError = 32 CodeMaximumEntropyError = 33 CodeInvalidNodePubKeyError = 34 CodeTicketsNotFoundError = 35 CodeDuplicateTicketError = 36 CodeDuplicateProofError = 37 CodeInvalidSignatureSizeError = 38 CodeSigDecodeError = 39 CodeMsgDecodeError = 40 CodeInvalidSigError = 41 CodePubKeySizeError = 42 CodeEmptyKeybaseError = 43 CodeSelfNotFoundError = 44 CodeAppNotFoundError = 45 CodeChainNotHostedError = 46 CodeInvalidHostedChainsError = 47 CodeNodeNotFoundError = 48 CodeInvalidProofsError = 49 CodeInconsistentPubKeyError = 50 CodeInvalidChainParamsError = 51 CodeNewHexDecodeError = 52 CodeChainNotSupportedErr = 53 CodePubKeyError = 54 CodeSignatureError = 55 CodeInvalidChainError = 56 CodeJSONMarshalError = 57 CodeInvalidBlockchainHashLengthError = 58 CodeEmptySessionKeyError = 59 CodeInvalidBlockHeightError = 60 CodeInvalidAppPubKeyError = 61 CodeInvalidHashLengthError = 62 CodeInvalidLeafCousinProofsCombo = 63 CodeEmptyAddressError = 64 CodeClaimNotFoundError = 65 CodeInvalidMerkleVerifyError = 66 CodeEmptyMerkleTreeError = 67 CodeMerkleNodeNotFoundError = 68 CodeExpiredProofsSubmissionError = 69 CodeAddressError = 70 CodeOverServiceError = 71 CodeCousinLeafEquivalentError = 72 CodeInvalidRootError = 73 CodeRequestHash = 74 CodeOutOfSyncRequestError = 75 CodeUnsupportedBlockchainError = 76 CodeDuplicatePublicKeyError = 77 CodeMismatchedRequestHashError = 78 CodeNewMismatchedAppPubKeyError = 79 CodeMismatchedSessionHeightError = 80 CodeMismatchedBlockchainsError = 81 CodeNoMajorityResponseError = 82 CodeNodeNotInSessionError = 83 CodeNoEvidenceTypeErr = 84 CodeInvalidPkFileErr = 85 CodeReplayAttackError = 86 CodeInvalidNetworkIDError = 87 CodeInvalidExpirationHeightErr = 88 CodeInvalidMerkleRangeError = 89 CodeEvidenceSealed = 90 CodeChainsOverLimitError = 91 )
const ( EventTypeClaim = MsgClaimName // an event for emitting a claim message EventTypeProof = MsgProofName // an event for emitting a proof message AttributeKeyValidator = "validator" // a validator attribute )
const ( ClaimFee = 10000 // fee for claim message (in uPOKT) ProofFee = 10000 // fee for proof message (in uPOKT) )
const ( ModuleName = "pocketcore" // name of the module StoreKey = ModuleName // key for state store TStoreKey = "transient_" + StoreKey // transient key for state store )
const ( ServiceMetricsKey = "service" ServiceMetricsNamespace = ServiceMetricsKey RelayCountName = "relay_count_for_" RelayCountHelp = "the number of relays executed against: " ChallengeCountName = "challenge_count_for_" ChallengeCountHelp = "the number of challenges executed against: " ErrCountName = "err_count_for_" ErrCountHelp = "the number of errors resulting from relays executed against: " AvgRelayHistName = "avg_relay_time_for_" AvgrelayHistHelp = "the average relay time in ms executed against: " SessionsCountName = "sessions_count_for_" SessionsCountHelp = "the number of unique sessions generated for: " UPOKTCountName = "tokens_earned_for_" UPOKTCountHelp = "the number of tokens earned in uPOKT for : " AvgClaimTimeName = "avg_claim_time_for_" AvgClaimTimeHelp = "the average time in ms to generate the work needed for claim tx:" AvgProofTimeName = "avg_proof_time_for_" AvgProofTimeHelp = "the average time in ms to generate the work needed for claim tx:" )
const ( RouterKey = ModuleName // router name is module name MsgClaimName = "claim" // name for the claim message MsgProofName = "proof" // name for the proof message )
RouterKey is the module name router key
const ( // DefaultParamspace for params keeper DefaultParamspace = ModuleName DefaultSessionNodeCount = int64(5) // default number of nodes in a session DefaultClaimSubmissionWindow = int64(3) // default sessions to submit a claim DefaultClaimExpiration = int64(100) // default sessions to expire claims DefaultReplayAttackBurnMultiplier = int64(3) // default replay attack burn multiplier DefaultMinimumNumberOfProofs = int64(5) // default minimum number of proofs DefaultBlockByteSize = int64(4000000) // default block size in bytes at genesis; 4MB )
POS params default values
const ( QueryReceipt = "receipt" QueryReceipts = "receipts" QuerySupportedBlockchains = "supportedBlockchains" QueryRelay = "relay" QueryDispatch = "dispatch" QueryChallenge = "challenge" QueryParameters = "parameters" )
query endpoints supported by the staking Querier
const DEFAULTHTTPMETHOD = "POST"
const MerkleHashLength = blake2b.Size256
Variables ¶
var ( GlobalPocketConfig types.PocketConfig GlobalTenderMintConfig config.Config )
var ( Hasher = sha.SHA3_256 HashLength = sha.SHA3_256.Size() NetworkIdentifierLength = 4 AddrLength = tmhash.TruncatedSize )
var ( MissingTokenVersionError = errors.New("the application authentication token version is missing") UnsupportedTokenVersionError = errors.New("the application authentication token version is not supported") MissingApplicationPublicKeyError = errors.New("the application public key included in the AAT is not valid") MissingClientPublicKeyError = errors.New("the client public key included in the AAT is not valid") InvalidTokenSignatureError = errors.New("the application signature on the AAT is not valid") NegativeICCounterError = errors.New("the IC counter is less than 0") MaximumEntropyError = errors.New("the entropy exceeds the maximum allowed relays") NodeNotInSessionError = errors.New("the node is not within the session") InvalidNodePubKeyError = errors.New("the node public key in the service Proof does not match this nodes public key") InvalidTokenError = errors.New("the application authentication token is invalid") EmptyProofsError = errors.New("the service proofs object is empty") DuplicateProofError = errors.New("the Proof with specific merkleHash already found, check entropy") InvalidEntropyError = errors.New("the entropy included in the relay request is invalid") EmptyResponseError = errors.New("the relay response payload is empty") ResponseSignatureError = errors.New("response signing errored out: ") EmptyBlockchainError = errors.New("the blockchain included in the relay request is empty") EmptyPayloadDataError = errors.New("the payload data of the relay request is empty") UnsupportedBlockchainError = errors.New("the blockchain in this request is not supported") UnsupportedBlockchainAppError = errors.New("the blockchain in the relay request is not supported for this app") UnsupportedBlockchainNodeError = errors.New("the blockchain in the relay request is not supported on this node") HttpStatusCodeError = errors.New("HTTP status code returned not okay: ") InvalidSessionError = errors.New("this node (self) is not responsible for this session provided by the client") ServiceSessionGenerationError = errors.New("unable to generate a session for the seed data: ") NotStakedBlockchainError = errors.New("the blockchain is not staked for this application") EmptyAppPubKeyError = errors.New("the public key of the application is of Length 0") EmptyNonNativeChainError = errors.New("the non-native chain is of Length 0") EmptyBlockIDError = errors.New("the block addr is of Length 0") InsufficientNodesError = errors.New("there are less than the minimum session nodes found") EmptySessionKeyError = errors.New("the session key passed is of Length 0") MismatchedByteArraysError = errors.New("the byte arrays are not of the same Length") FilterNodesError = errors.New("unable to filter nodes: ") XORError = errors.New("error XORing the keys: ") PubKeyDecodeError = errors.New("error decoding the string into hex bytes") InvalidHashError = errors.New("the hash is invalid: ") HTTPExecutionError = errors.New("error executing the http request: ") TicketsNotFoundError = errors.New("the tickets requested could not be found") DuplicateTicketError = errors.New("the ticket is a duplicate") InvalidSignatureSizeError = errors.New("the signature Length is invalid") MessageDecodeError = errors.New("the message could not be hex decoded") SigDecodeError = errors.New("the signature could not be message decoded") InvalidSignatureError = errors.New("the signature could not be verified with the message and pub key") PubKeySizeError = errors.New("the public key is not the correct cap") KeybaseError = errors.New("the keybase is invalid: ") SelfNotFoundError = errors.New("the self node is not within the world state") AppNotFoundError = errors.New("the app could not be found in the world state") RequestHashError = errors.New("the request hash does not match the payload hash") InvalidHostedChainError = errors.New("invalid hosted chain error") ChainNotHostedError = errors.New("the blockchain requested is not hosted") NodeNotFoundErr = errors.New("the node is not found in world state") InvalidProofsError = errors.New("the proofs provided are invalid or less than the minimum requirement") InconsistentPubKeyError = errors.New("the public keys in the proofs are inconsistent") InvalidChainParamsError = errors.New("the required params for a nonNative blockchain are invalid") HexDecodeError = errors.New("the hex string could not be decoded: ") ChainNotSupportedErr = errors.New("the chain is not pocket supported") PubKeyError = errors.New("could not convert hex string to pub key: ") SignatureError = errors.New("there was a problem signing the message: ") InvalidChainError = errors.New("the non native chain passed was invalid: ") JSONMarshalError = errors.New("unable to marshal object into json: ") InvalidNetworkIDLengthError = errors.New("the netid Length is invalid") InvalidBlockHeightError = errors.New("the block height passed is invalid") InvalidAppPubKeyError = errors.New("the app public key is invalid") InvalidHashLengthError = errors.New("the merkleHash Length is not valid") InvalidLeafCousinProofsCombo = errors.New("the merkle relayProof combo for the cousin and leaf is invalid") EmptyAddressError = errors.New("the address provided is empty") ClaimNotFoundError = errors.New("the claim was not found for the key given") InvalidMerkleVerifyError = errors.New("claim resulted in an invalid merkle Proof") EmptyMerkleTreeError = errors.New("the merkle tree is empty") NodeNotFoundError = errors.New("the node of the merkle tree requested is not found") ExpiredProofsSubmissionError = errors.New("the opportunity of window to submit the Proof has closed because the secret has been revealed") AddressError = errors.New("the address is invalid") OverServiceError = errors.New("the max number of relays serviced for this node is exceeded") UninitializedKeybaseError = errors.New("the keybase is nil") CousinLeafEquivalentError = errors.New("the cousin and leaf cannot be equal") InvalidRootError = errors.New("the merkle root passed is invalid") MerkleNodeNotFoundError = errors.New("the merkle node cannot be found") OutOfSyncRequestError = errors.New("the request block height is out of sync with the current block height") DuplicatePublicKeyError = errors.New("the public key is duplicated in the proof") MismatchedRequestHashError = errors.New("the request hashes included in the proof do not match") MismatchedAppPubKeyError = errors.New("the application public keys included in the proofs do not match") MismatchedSessionHeightError = errors.New("the session block heights included in the proofs do not match") MismatchedBlockchainsError = errors.New("the non-native blockchains provided in the proofs do not match") NoMajorityResponseError = errors.New("no majority can be established between all of the responses") NoEvidenceTypeErr = errors.New("the GOBEvidence type is not supplied in the claim message") InvalidPkFileErr = errors.New("the PK File is not found") InvalidEvidenceErr = errors.New("the GOBEvidence type passed is not valid") ReplayAttackError = errors.New("the merkle proof is flagged as a replay attack") InvalidExpirationHeightErr = errors.New("the expiration height included in the claim message is invalid (should not be set)") InvalidMerkleRangeError = errors.New("the merkle hash range is invalid") SealedEvidenceError = errors.New("the evidence is sealed, either max relays reached or claim already submitted") ChainsOverLimitError = errors.New("the number of staked chains is over the limit") )
var ( ClaimLen = len(ClaimKey) ClaimKey = []byte{0x02} // key for pending claims )
var ( DefaultSupportedBlockchains = []string{"0001"} KeySessionNodeCount = []byte("SessionNodeCount") KeyClaimSubmissionWindow = []byte("ClaimSubmissionWindow") KeySupportedBlockchains = []byte("SupportedBlockchains") KeyClaimExpiration = []byte("ClaimExpiration") KeyReplayAttackBurnMultiplier = []byte("ReplayAttackBurnMultiplier") KeyMinimumNumberOfProofs = []byte("MinimumNumberOfProofs") KeyBlockByteSize = []byte("BlockByteSize") )
var ( ErrInvalidLengthPocket = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPocket = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPocket = fmt.Errorf("proto: unexpected end of group") )
var ( // sync.once to perform initialization ConfigOnce sync.Once )
var GlobalPocketNodes = map[string]*PocketNode{}
var ModuleCdc *codec.Codec
module wide codec
var ( // map of message name to fee value PocketFeeMap = map[string]int64{ MsgClaimName: ClaimFee, MsgProofName: ProofFee, } )
var ( // A list of supported token versions // Requires major (semantic) upgrade to update this list SupportedTokenVersions = []string{"0.0.1"} )
Functions ¶
func AddressVerification ¶
"AddressVerification" - Verifies the address format (hex strign)
func CleanPocketNodes ¶
func CleanPocketNodes()
CleanPocketNodes sets the global pocket nodes and its caches back to original state as if the node is starting up again. Cleaning up pocket nodes is used for unit and integration tests where the cache is initialized in various scenarios (relays, tx, etc).
func ClearEvidence ¶
func ClearEvidence(evidenceStore *CacheStorage)
"ClearEvidence" - Clear stores of all evidence
func ClearSessionCache ¶
func ClearSessionCache(sessionStore *CacheStorage)
"ClearSessionCache" - Clears all items from the session cache db
func ConvertEvidenceToProto ¶
func DeleteEvidence ¶
func DeleteEvidence(header SessionHeader, evidenceType EvidenceType, evidenceStore *CacheStorage) error
"DeleteEvidence" - Remove the GOBEvidence from the store
func DeleteSession ¶
func DeleteSession(header SessionHeader, sessionStore *CacheStorage)
"DeleteSession" - Deletes a session (value) from the stores
func ErrorWarrantsDispatch ¶
func FlushSessionCache ¶
func FlushSessionCache()
func GenerateProofs ¶
func GenerateProofs(height int64, p []Proof, index int) (mProof MerkleProof, leaf Proof)
"GenerateProofs" - Generates the merkle Proof object from the leaf node data and the index
func GenerateRoot ¶
"GenerateRoot" - generates the merkle root from leaf node data
func GetApp ¶
func GetApp(ctx sdk.Ctx, appsKeeper AppsKeeper, address sdk.Address) (a exported.ApplicationI, found bool)
"GetApp" - Retrieves an application from the app store, using the appKeeper (a link to the apps module)
func GetAppFromPublicKey ¶
func GetAppFromPublicKey(ctx sdk.Ctx, appsKeeper AppsKeeper, pubKey string) (app exported.ApplicationI, found bool)
"GetAppFromPublicKey" - Retrieves an application from the app store, using the appKeeper (a link to the apps module) using a hex string public key
func GetRPCTimeout ¶
func HashVerification ¶
"HashVerification" - Verifies the merkleHash format (hex string)
func InitClientBlockAllowance ¶
func InitClientBlockAllowance(allowance int)
func InitConfig ¶
func InitConfig(chains *HostedBlockchains, logger log.Logger, c types.Config)
func InitGlobalServiceMetric ¶
func InitGlobalServiceMetric(hostedBlockchains *HostedBlockchains, logger log.Logger, addr string, maxOpenConn int)
func InitPocketNodeCache ¶
func InitPocketNodeCache(node *PocketNode, c types.Config, logger log.Logger)
InitPocketNodeCache adds a PocketNode with its SessionStore and EvidenceStore initialized
func IsUniqueProof ¶
func KeyForClaim ¶
func KeyForClaim(ctx sdk.Ctx, addr sdk.Address, header SessionHeader, evidenceType EvidenceType) ([]byte, error)
"KeyForClaim" - Generates the key for the claim object for the state store
func KeyForClaims ¶
"KeyForClaims" - Generates the key for the claims object
func KeyForEvidence ¶
func KeyForEvidence(header SessionHeader, evidenceType EvidenceType) ([]byte, error)
"KeyForEvidence" - Generates the key for GOBEvidence
func KeyForServiceMetrics ¶
func KeyForServiceMetrics() []byte
func MaxPossibleRelays ¶
func MaxPossibleRelays(app appexported.ApplicationI, sessionNodeCount int64) sdk.BigInt
"MaxPossibleRelays" - Returns the maximum possible amount of relays for an App on a sessions
func MultiAppend ¶
func NetworkIdentifierVerification ¶
"NetworkIdentifierVerification"- Verify the netID format (hex string)
func NewAddressInvalidLengthError ¶
func NewAddressInvalidLengthError(codespace sdk.CodespaceType) sdk.Error
func NewAppNotFoundError ¶
func NewAppNotFoundError(codespace sdk.CodespaceType) sdk.Error
func NewChainNotSupportedErr ¶
func NewChainNotSupportedErr(codespace sdk.CodespaceType) sdk.Error
func NewChainsOverLimitError ¶
func NewChainsOverLimitError(codespace sdk.CodespaceType, gotChains, maxChains int64) sdk.Error
func NewClaimNotFoundError ¶
func NewClaimNotFoundError(codespace sdk.CodespaceType) sdk.Error
func NewCousinLeafEquivalentError ¶
func NewCousinLeafEquivalentError(codespace sdk.CodespaceType) sdk.Error
func NewDuplicateProofError ¶
func NewDuplicateProofError(codespace sdk.CodespaceType) sdk.Error
func NewDuplicatePublicKeyError ¶
func NewDuplicatePublicKeyError(codespace sdk.CodespaceType) sdk.Error
func NewEmptyAddressError ¶
func NewEmptyAddressError(codespace sdk.CodespaceType) sdk.Error
func NewEmptyBlockIDError ¶
func NewEmptyBlockIDError(codespace sdk.CodespaceType) sdk.Error
func NewEmptyChainError ¶
func NewEmptyChainError(codespace sdk.CodespaceType) sdk.Error
func NewEmptyHashError ¶
func NewEmptyHashError(codespace sdk.CodespaceType) sdk.Error
func NewEmptyMerkleTreeError ¶
func NewEmptyMerkleTreeError(codespace sdk.CodespaceType) sdk.Error
func NewEmptyNonNativeChainError ¶
func NewEmptyNonNativeChainError(codespace sdk.CodespaceType) sdk.Error
func NewEmptyPayloadDataError ¶
func NewEmptyPayloadDataError(codespace sdk.CodespaceType) sdk.Error
func NewEmptyProofsError ¶
func NewEmptyProofsError(codespace sdk.CodespaceType) sdk.Error
func NewEmptyResponseError ¶
func NewEmptyResponseError(codespace sdk.CodespaceType) sdk.Error
func NewErrorChainNotHostedError ¶
func NewErrorChainNotHostedError(codespace sdk.CodespaceType) sdk.Error
func NewExpiredProofsSubmissionError ¶
func NewExpiredProofsSubmissionError(codespace sdk.CodespaceType) sdk.Error
func NewFilterNodesError ¶
func NewFilterNodesError(codespace sdk.CodespaceType, err error) sdk.Error
func NewHTTPExecutionError ¶
func NewHTTPExecutionError(codespace sdk.CodespaceType, err error) sdk.Error
func NewHTTPStatusCodeError ¶
func NewHTTPStatusCodeError(codespace sdk.CodespaceType, statusCode int) sdk.Error
func NewHexDecodeError ¶
func NewHexDecodeError(codespace sdk.CodespaceType, err error) sdk.Error
func NewInsufficientNodesError ¶
func NewInsufficientNodesError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidAppPubKeyError ¶
func NewInvalidAppPubKeyError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidBlockHeightError ¶
func NewInvalidBlockHeightError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidChainParamsError ¶
func NewInvalidChainParamsError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidEntropyError ¶
func NewInvalidEntropyError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidEvidenceErr ¶
func NewInvalidEvidenceErr(codespace sdk.CodespaceType) sdk.Error
func NewInvalidExpirationHeightErr ¶
func NewInvalidExpirationHeightErr(codespace sdk.CodespaceType) sdk.Error
func NewInvalidHashError ¶
func NewInvalidHashLengthError ¶
func NewInvalidHashLengthError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidHostedChainError ¶
func NewInvalidHostedChainError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidLeafCousinProofsComboError ¶
func NewInvalidLeafCousinProofsComboError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidMerkleRangeError ¶
func NewInvalidMerkleRangeError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidMerkleVerifyError ¶
func NewInvalidMerkleVerifyError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidNetIDLengthError ¶
func NewInvalidNetIDLengthError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidNodePubKeyError ¶
func NewInvalidNodePubKeyError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidPKError ¶
func NewInvalidPKError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidProofsError ¶
func NewInvalidProofsError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidRootError ¶
func NewInvalidRootError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidSessionError ¶
func NewInvalidSessionError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidSessionKeyError ¶
func NewInvalidSessionKeyError(codespace sdk.CodespaceType, err error) sdk.Error
func NewInvalidSignatureError ¶
func NewInvalidSignatureError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidSignatureSizeError ¶
func NewInvalidSignatureSizeError(codespace sdk.CodespaceType) sdk.Error
func NewInvalidTokenError ¶
func NewInvalidTokenError(codespace sdk.CodespaceType, err error) sdk.Error
func NewJSONMarshalError ¶
func NewJSONMarshalError(codespace sdk.CodespaceType, err error) sdk.Error
func NewKeybaseError ¶
func NewKeybaseError(codespace sdk.CodespaceType, err error) sdk.Error
func NewMerkleNodeNotFoundError ¶
func NewMerkleNodeNotFoundError(codespace sdk.CodespaceType) sdk.Error
func NewMismatchedAppPubKeyError ¶
func NewMismatchedAppPubKeyError(codespace sdk.CodespaceType) sdk.Error
func NewMismatchedBlockchainsError ¶
func NewMismatchedBlockchainsError(codespace sdk.CodespaceType) sdk.Error
func NewMismatchedRequestHashError ¶
func NewMismatchedRequestHashError(codespace sdk.CodespaceType) sdk.Error
func NewMismatchedSessionHeightError ¶
func NewMismatchedSessionHeightError(codespace sdk.CodespaceType) sdk.Error
func NewMsgDecodeError ¶
func NewMsgDecodeError(codespace sdk.CodespaceType) sdk.Error
func NewNoEvidenceTypeErr ¶
func NewNoEvidenceTypeErr(codespace sdk.CodespaceType) sdk.Error
func NewNoMajorityResponseError ¶
func NewNoMajorityResponseError(codespace sdk.CodespaceType) sdk.Error
func NewNodeNotFoundErr ¶
func NewNodeNotFoundErr(codespace sdk.CodespaceType) sdk.Error
func NewNodeNotInSessionError ¶
func NewNodeNotInSessionError(codespace sdk.CodespaceType) sdk.Error
func NewOutOfSyncRequestError ¶
func NewOutOfSyncRequestError(codespace sdk.CodespaceType) sdk.Error
func NewOverServiceError ¶
func NewOverServiceError(codespace sdk.CodespaceType) sdk.Error
func NewPubKeyDecodeError ¶
func NewPubKeyDecodeError(codespace sdk.CodespaceType) sdk.Error
func NewPubKeyError ¶
func NewPubKeyError(codespace sdk.CodespaceType, err error) sdk.Error
func NewPubKeySizeError ¶
func NewPubKeySizeError(codespace sdk.CodespaceType) sdk.Error
func NewReplayAttackError ¶
func NewReplayAttackError(codespace sdk.CodespaceType) sdk.Error
func NewRequestHashError ¶
func NewRequestHashError(codespace sdk.CodespaceType) sdk.Error
func NewResponseSignatureError ¶
func NewResponseSignatureError(codespace sdk.CodespaceType) sdk.Error
func NewSealedEvidenceError ¶
func NewSealedEvidenceError(codespace sdk.CodespaceType) sdk.Error
func NewSelfNotFoundError ¶
func NewSelfNotFoundError(codespace sdk.CodespaceType) sdk.Error
func NewSigDecodeError ¶
func NewSigDecodeError(codespace sdk.CodespaceType) sdk.Error
func NewSignatureError ¶
func NewSignatureError(codespace sdk.CodespaceType, err error) sdk.Error
func NewUnsupportedBlockchainAppError ¶
func NewUnsupportedBlockchainAppError(codespace sdk.CodespaceType) sdk.Error
func NewUnsupportedBlockchainError ¶
func NewUnsupportedBlockchainError(codespace sdk.CodespaceType) sdk.Error
func NewUnsupportedBlockchainNodeError ¶
func NewUnsupportedBlockchainNodeError(codespace sdk.CodespaceType) sdk.Error
func NewXORError ¶
func NewXORError(codespace sdk.CodespaceType, err error) sdk.Error
func NodeHasChain ¶
func NodeHasChain(chain string, node exported.ValidatorI) bool
"NodeHashChain" - Returns whether or not the node has the relayChain
func PseudorandomSelection ¶
func PubKeyVerification ¶
"PubKeyVerification" - Verifies the public key format (hex string)
func RegisterCodec ¶
RegisterCodec registers concrete types on the codec
func SetEvidence ¶
func SetEvidence(evidence Evidence, evidenceStore *CacheStorage)
"SetEvidence" - Sets an GOBEvidence object in the storage
func SetProof ¶
func SetProof(header SessionHeader, evidenceType EvidenceType, p Proof, max sdk.BigInt, evidenceStore *CacheStorage)
"SetProof" - Sets a proof object in the GOBEvidence, using the header and GOBEvidence type
func SetRPCTimeout ¶
func SetRPCTimeout(timeout int64)
func SetSession ¶
func SetSession(session Session, sessionStore *CacheStorage)
"SetSession" - Sets a session (value) in the stores using the header (key)
func SignatureVerification ¶
SignatureVerification verifies that: - The privKey associated with publicKey generated sigHex - sigHex signed msgHex
func StopServiceMetrics ¶
func StopServiceMetrics()
func ValidateGenesis ¶
func ValidateGenesis(gs GenesisState) error
"ValidateGenesis" - Returns an error on an invalid genesis object
Types ¶
type AAT ¶
type AAT struct { Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version"` ApplicationPublicKey string `protobuf:"bytes,2,opt,name=applicationPublicKey,proto3" json:"app_pub_key"` ClientPublicKey string `protobuf:"bytes,3,opt,name=clientPublicKey,proto3" json:"client_pub_key"` ApplicationSignature string `protobuf:"bytes,4,opt,name=applicationSignature,proto3" json:"signature"` }
func (*AAT) Descriptor ¶
func (AAT) HashString ¶
"HashString" - Returns the string representation of the AAT merkleHash
func (*AAT) ProtoMessage ¶
func (*AAT) ProtoMessage()
func (AAT) ValidateMessage ¶
"ValidateMessage" - Confirms the message field of the AAT
func (AAT) ValidateSignature ¶
ValidateSignature confirms that the ApplicationSignature of the AAT is correct
func (AAT) ValidateVersion ¶
"ValidateVersion" - Confirms the version field of the AAT
func (AAT) VersionIsIncluded ¶
"VersionIsIncluded" - Returns if the version is included
func (AAT) VersionIsSupported ¶
"VersionIsSupported" - Returns if the version of the AAT is supported by the network
func (*AAT) XXX_DiscardUnknown ¶
func (m *AAT) XXX_DiscardUnknown()
func (*AAT) XXX_Unmarshal ¶
type AppsKeeper ¶
type AppsKeeper interface { GetStakedTokens(ctx sdk.Ctx) sdk.BigInt Application(ctx sdk.Ctx, addr sdk.Address) appexported.ApplicationI AllApplications(ctx sdk.Ctx) (applications []appexported.ApplicationI) TotalTokens(ctx sdk.Ctx) sdk.BigInt JailApplication(ctx sdk.Ctx, addr sdk.Address) MaxChains(ctx sdk.Ctx) (maxChains int64) }
type AuthKeeper ¶
type BasicAuth ¶
BasicAuth is an optional http auth mechanism if the URL does not embed the secrets directly. Removed from examples & documentation for clarity.
type CacheObject ¶
type CacheStorage ¶
type CacheStorage struct { Cache *sdk.Cache // lru cache DB db.DB // persisted SealMap *sync.Map // contains filtered or unexported fields }
"CacheStorage" - Contains an LRU cache and a database instance w/ mutex
var GlobalEvidenceCache *CacheStorage
GlobalEvidenceCache & GlobalSessionCache is used for the first pocket node and acts as backwards-compatibility for pre-lean pocket
var GlobalSessionCache *CacheStorage
func (*CacheStorage) Clear ¶
func (cs *CacheStorage) Clear()
"Clear" - Deletes all items from stores
func (*CacheStorage) Delete ¶
func (cs *CacheStorage) Delete(key []byte)
"Remove" - Deletes the item from stores
func (*CacheStorage) FlushToDB ¶
func (cs *CacheStorage) FlushToDB() error
func (*CacheStorage) FlushToDBWithoutLock ¶
func (cs *CacheStorage) FlushToDBWithoutLock() error
func (*CacheStorage) Get ¶
func (cs *CacheStorage) Get(key []byte, object CacheObject) (interface{}, bool)
"Get" - Returns the value from a key
func (*CacheStorage) GetWithoutLock ¶
func (cs *CacheStorage) GetWithoutLock(key []byte, object CacheObject) (interface{}, bool)
func (*CacheStorage) Init ¶
func (cs *CacheStorage) Init(dir, name string, options config.LevelDBOptions, maxEntries int, inMemoryDB bool)
"Init" - Initializes a cache storage object
func (*CacheStorage) IsSealed ¶
func (cs *CacheStorage) IsSealed(object CacheObject) bool
func (*CacheStorage) IsSealedWithoutLock ¶
func (cs *CacheStorage) IsSealedWithoutLock(object CacheObject) bool
func (*CacheStorage) Iterator ¶
func (cs *CacheStorage) Iterator() (db.Iterator, error)
"Iterator" - Returns an iterator for all of the items in the stores
func (*CacheStorage) Seal ¶
func (cs *CacheStorage) Seal(object CacheObject) (cacheObject CacheObject, isOK bool)
"Seal" - Seals the cache object so it is no longer writable in the cache store
func (*CacheStorage) Set ¶
func (cs *CacheStorage) Set(key []byte, val CacheObject)
"Set" - Sets the KV pair in cache and db
func (*CacheStorage) SetWithoutLockAndSealCheck ¶
func (cs *CacheStorage) SetWithoutLockAndSealCheck(key string, val CacheObject)
"SetWithoutLockAndSealCheck" - CONTRACT: used in a function with lock
cache must be flushed to db before any DB iterator
type ChallengeProofInvalidData ¶
type ChallengeProofInvalidData struct { MajorityResponses []RelayResponse `protobuf:"bytes,1,rep,name=majorityResponses,proto3" json:"majority_responses"` MinorityResponse RelayResponse `protobuf:"bytes,2,opt,name=minorityResponse,proto3" json:"minority_response"` ReporterAddress github_com_pokt_network_pocket_core_types.Address `` /* 134-byte string literal not displayed */ }
func (ChallengeProofInvalidData) Bytes ¶
func (c ChallengeProofInvalidData) Bytes() []byte
"Bytes" - Bytes representaiton fo the challenge proof object
func (*ChallengeProofInvalidData) Descriptor ¶
func (*ChallengeProofInvalidData) Descriptor() ([]byte, []int)
func (ChallengeProofInvalidData) GetSigner ¶
func (c ChallengeProofInvalidData) GetSigner() sdk.Address
"GetSigners" - Returns the signer(s) for the message
func (ChallengeProofInvalidData) Hash ¶
func (c ChallengeProofInvalidData) Hash() []byte
"Hash" - The cryptographic merkleHash representation of the challenge bytes
func (ChallengeProofInvalidData) HashString ¶
func (c ChallengeProofInvalidData) HashString() string
"HashString" - The hex encoded string representation fo the challenge merkleHash
func (*ChallengeProofInvalidData) Marshal ¶
func (m *ChallengeProofInvalidData) Marshal() (dAtA []byte, err error)
func (*ChallengeProofInvalidData) MarshalTo ¶
func (m *ChallengeProofInvalidData) MarshalTo(dAtA []byte) (int, error)
func (*ChallengeProofInvalidData) MarshalToSizedBuffer ¶
func (m *ChallengeProofInvalidData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ChallengeProofInvalidData) ProtoMessage ¶
func (*ChallengeProofInvalidData) ProtoMessage()
func (*ChallengeProofInvalidData) Reset ¶
func (m *ChallengeProofInvalidData) Reset()
func (ChallengeProofInvalidData) SessionHeader ¶
func (c ChallengeProofInvalidData) SessionHeader() SessionHeader
"SessionHeader" - Returns the session header for the challenge proof
func (*ChallengeProofInvalidData) Size ¶
func (m *ChallengeProofInvalidData) Size() (n int)
func (ChallengeProofInvalidData) Store ¶
func (c ChallengeProofInvalidData) Store(maxChallenges sdk.BigInt, evidenceStore *CacheStorage)
"Store" - Stores the challenge proof (stores in cache)
func (*ChallengeProofInvalidData) String ¶
func (m *ChallengeProofInvalidData) String() string
func (ChallengeProofInvalidData) ToProto ¶
func (c ChallengeProofInvalidData) ToProto() ProofI
func (*ChallengeProofInvalidData) Unmarshal ¶
func (m *ChallengeProofInvalidData) Unmarshal(dAtA []byte) error
func (ChallengeProofInvalidData) Validate ¶
func (c ChallengeProofInvalidData) Validate(appSupportedBlockchains []string, sessionNodeCount int, sessionBlockHeight int64) sdk.Error
"Validate" - validate is used to validate a challenge request
func (ChallengeProofInvalidData) ValidateBasic ¶
func (c ChallengeProofInvalidData) ValidateBasic() sdk.Error
"ValidateBasic" - Provides a lightweight, storeless validity check
func (ChallengeProofInvalidData) ValidateLocal ¶
func (c ChallengeProofInvalidData) ValidateLocal(h SessionHeader, maxRelays sdk.BigInt, supportedBlockchains []string, sessionNodeCount int, sessionNodes SessionNodes, selfAddr sdk.Address, evidenceStore *CacheStorage) sdk.Error
"ValidateLocal" - Validate local is used to validate a challenge request directly from a client
func (*ChallengeProofInvalidData) XXX_DiscardUnknown ¶
func (m *ChallengeProofInvalidData) XXX_DiscardUnknown()
func (*ChallengeProofInvalidData) XXX_Marshal ¶
func (m *ChallengeProofInvalidData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ChallengeProofInvalidData) XXX_Merge ¶
func (m *ChallengeProofInvalidData) XXX_Merge(src proto.Message)
func (*ChallengeProofInvalidData) XXX_Size ¶
func (m *ChallengeProofInvalidData) XXX_Size() int
func (*ChallengeProofInvalidData) XXX_Unmarshal ¶
func (m *ChallengeProofInvalidData) XXX_Unmarshal(b []byte) error
type ChallengeResponse ¶
type ChallengeResponse struct {
Response string `json:"response"`
}
"ChallengeReponse" - The response object used in challenges
type DispatchResponse ¶
type DispatchResponse struct { Session DispatchSession `json:"session"` BlockHeight int64 `json:"block_height"` }
"DispatchResponse" - The response object used in dispatching
type DispatchSession ¶
type DispatchSession struct { SessionHeader `json:"header"` SessionKey `json:"key"` SessionNodes []exported.ValidatorI `json:"nodes"` }
type Evidence ¶
type Evidence struct { Bloom bloom.BloomFilter `json:"bloom_filter"` // used to check if proof contains SessionHeader `json:"evidence_header"` // the session h serves as an identifier for the evidence NumOfProofs int64 `json:"num_of_proofs"` // the total number of proofs in the evidence Proofs Proofs `json:"proofs"` // a slice of Proof objects (Proof per relay or challenge) EvidenceType EvidenceType `json:"evidence_type"` }
"Evidence" - A proof of work/burn for nodes.
func GetEvidence ¶
func GetEvidence(header SessionHeader, evidenceType EvidenceType, max sdk.BigInt, storage *CacheStorage) (evidence Evidence, err error)
"GetEvidence" - Retrieves the GOBEvidence object from the storage
func GetTotalProofs ¶
func GetTotalProofs(h SessionHeader, et EvidenceType, maxPossibleRelays sdk.BigInt, evidenceStore *CacheStorage) (Evidence, int64)
"GetTotalProofs" - Returns the total number of proofs for a piece of GOBEvidence
func SealEvidence ¶
func SealEvidence(evidence Evidence, storage *CacheStorage) (Evidence, bool)
"SealEvidence" - Locks/sets the evidence from the stores
func (*Evidence) GenerateMerkleProof ¶
func (e *Evidence) GenerateMerkleProof(height int64, index int, maxRelays int64) (proof MerkleProof, leaf Proof)
"GenerateMerkleProof" - Generates the merkle Proof for an GOBEvidence
func (*Evidence) GenerateMerkleRoot ¶
func (e *Evidence) GenerateMerkleRoot(height int64, maxRelays int64, storage *CacheStorage) (root HashRange)
"GenerateMerkleRoot" - Generates the merkle root for an GOBEvidence object
func (Evidence) IsSealable ¶
func (Evidence) LegacyAminoMarshal ¶
func (Evidence) LegacyAminoUnmarshal ¶
func (e Evidence) LegacyAminoUnmarshal(b []byte) (CacheObject, error)
func (Evidence) MarshalObject ¶
func (*Evidence) MarshalToSizedBuffer ¶
func (*Evidence) ProtoMessage ¶
func (e *Evidence) ProtoMessage()
func (*Evidence) ToProto ¶
func (e *Evidence) ToProto() (*ProtoEvidence, error)
func (Evidence) UnmarshalObject ¶
func (e Evidence) UnmarshalObject(b []byte) (CacheObject, error)
type EvidenceIt ¶
"EvidenceIt" - An GOBEvidence iterator instance of the GlobalEvidenceCache
func EvidenceIterator ¶
func EvidenceIterator(evidenceStore *CacheStorage) EvidenceIt
"EvidenceIterator" - Returns a GlobalEvidenceCache iterator instance
func (*EvidenceIt) Value ¶
func (ei *EvidenceIt) Value() (evidence Evidence)
"Value" - Returns the GOBEvidence object value of the iterator
type EvidenceType ¶
type EvidenceType int
"EvidenceType" type to distinguish the types of GOBEvidence (relay/challenge)
const ( RelayEvidence EvidenceType = iota + 1 // essentially an enum for GOBEvidence types ChallengeEvidence )
func EvidenceTypeFromString ¶
func EvidenceTypeFromString(evidenceType string) (et EvidenceType, err types.Error)
func (EvidenceType) Byte ¶
func (et EvidenceType) Byte() (byte, error)
"Convert GOBEvidence type to bytes
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` // governance params Claims []MsgClaim `json:"claims"` // outstanding claims }
"GenesisState" - The state of the module from the beginning
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
"DefaultGenesisState" - Returns the default genesis state for pocketcore module
type HashRange ¶
type HashRange struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"merkleHash"` Range Range `protobuf:"bytes,2,opt,name=range,proto3" json:"range"` }
func (*HashRange) Descriptor ¶
func (*HashRange) MarshalToSizedBuffer ¶
func (*HashRange) ProtoMessage ¶
func (*HashRange) ProtoMessage()
func (*HashRange) XXX_DiscardUnknown ¶
func (m *HashRange) XXX_DiscardUnknown()
func (*HashRange) XXX_Marshal ¶
func (*HashRange) XXX_Unmarshal ¶
type HostedBlockchain ¶
type HostedBlockchain struct { ID string `json:"id"` // network identifier of the hosted blockchain URL string `json:"url"` // url of the hosted blockchain BasicAuth BasicAuth `json:"basic_auth"` // Optional; basic http auth }
HostedBlockchain" - An object that represents a local hosted non-native blockchain
type HostedBlockchains ¶
type HostedBlockchains struct { M map[string]HostedBlockchain // M[addr] -> addr, url L sync.RWMutex }
HostedBlockchains" - An object that represents the local hosted non-native blockchains
func (*HostedBlockchains) Contains ¶
func (c *HostedBlockchains) Contains(id string) bool
"Contains" - Checks to see if the hosted chain is within the HostedBlockchains object
func (*HostedBlockchains) GetChain ¶
func (c *HostedBlockchains) GetChain(id string) (chain HostedBlockchain, err sdk.Error)
"GetChainURL" - Returns the url or error of the hosted blockchain using the hex network identifier
func (*HostedBlockchains) GetChainURL ¶
func (c *HostedBlockchains) GetChainURL(id string) (url string, err sdk.Error)
"GetChainURL" - Returns the url or error of the hosted blockchain using the hex network identifier
func (*HostedBlockchains) Validate ¶
func (c *HostedBlockchains) Validate() error
"Validate" - Validates the hosted blockchain object
type MerkleProof ¶
type MerkleProof struct { TargetIndex int64 `protobuf:"varint,1,opt,name=TargetIndex,proto3" json:"index"` HashRanges []HashRange `protobuf:"bytes,2,rep,name=hashRanges,proto3" json:"hash_ranges"` Target HashRange `protobuf:"bytes,3,opt,name=target,proto3" json:"target_range"` }
func (*MerkleProof) Descriptor ¶
func (*MerkleProof) Descriptor() ([]byte, []int)
func (*MerkleProof) Marshal ¶
func (m *MerkleProof) Marshal() (dAtA []byte, err error)
func (*MerkleProof) MarshalToSizedBuffer ¶
func (m *MerkleProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MerkleProof) ProtoMessage ¶
func (*MerkleProof) ProtoMessage()
func (*MerkleProof) Reset ¶
func (m *MerkleProof) Reset()
func (*MerkleProof) Size ¶
func (m *MerkleProof) Size() (n int)
func (*MerkleProof) String ¶
func (m *MerkleProof) String() string
func (*MerkleProof) Unmarshal ¶
func (m *MerkleProof) Unmarshal(dAtA []byte) error
func (MerkleProof) Validate ¶
func (mp MerkleProof) Validate(height int64, root HashRange, leaf Proof, numOfLevels int) (isValid bool, isReplayAttack bool)
"Validate" - Verifies the Proof from the leaf/cousin node data, the merkle root, and the Proof object
func (*MerkleProof) XXX_DiscardUnknown ¶
func (m *MerkleProof) XXX_DiscardUnknown()
func (*MerkleProof) XXX_Marshal ¶
func (m *MerkleProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MerkleProof) XXX_Merge ¶
func (m *MerkleProof) XXX_Merge(src proto.Message)
func (*MerkleProof) XXX_Size ¶
func (m *MerkleProof) XXX_Size() int
func (*MerkleProof) XXX_Unmarshal ¶
func (m *MerkleProof) XXX_Unmarshal(b []byte) error
type MsgClaim ¶
type MsgClaim struct { SessionHeader SessionHeader `protobuf:"bytes,1,opt,name=sessionHeader,proto3" json:"header"` MerkleRoot HashRange `protobuf:"bytes,2,opt,name=merkleRoot,proto3" json:"merkle_root"` TotalProofs int64 `protobuf:"varint,3,opt,name=totalProofs,proto3" json:"total_proofs"` FromAddress github_com_pokt_network_pocket_core_types.Address `protobuf:"bytes,4,opt,name=fromAddress,proto3,casttype=github.com/pokt-network/pocket-core/types.Address" json:"from_address"` EvidenceType EvidenceType `protobuf:"varint,5,opt,name=evidenceType,proto3,casttype=EvidenceType" json:"evidence_type"` ExpirationHeight int64 `protobuf:"varint,6,opt,name=expirationHeight,proto3" json:"expiration_height"` }
func (*MsgClaim) Descriptor ¶
func (MsgClaim) GetRecipient ¶
"GetSigners" - Defines whose signature is required
func (MsgClaim) GetSignBytes ¶
"GetSignBytes" - Encodes the message for signing
func (MsgClaim) GetSigners ¶
"GetSigners" - Defines whose signature is required
func (MsgClaim) IsEmpty ¶
"IsEmpty" - Returns true if the EvidenceType == 0, this should only happen on initialization and MsgClaim{} calls
func (*MsgClaim) MarshalToSizedBuffer ¶
func (*MsgClaim) ProtoMessage ¶
func (*MsgClaim) ProtoMessage()
func (MsgClaim) ValidateBasic ¶
"ValidateBasic" - Storeless validity check for claim message
func (*MsgClaim) XXX_DiscardUnknown ¶
func (m *MsgClaim) XXX_DiscardUnknown()
func (*MsgClaim) XXX_Marshal ¶
func (*MsgClaim) XXX_MessageName ¶
func (*MsgClaim) XXX_Unmarshal ¶
type MsgProof ¶
type MsgProof struct { MerkleProof MerkleProof `json:"merkle_proofs"` // the merkleProof needed to verify the proofs Leaf Proof `json:"leaf"` // the needed to verify the Proof EvidenceType EvidenceType `json:"evidence_type"` // the type of GOBEvidence }
--------------------------------------------------------------------------------------------------------------------- "MsgProof" - Proves the previous claim by providing the merkle Proof and the leaf node
func (MsgProof) GetRecipient ¶
"GetSigners" - Defines whose signature is required
func (MsgProof) GetSignBytes ¶
"GetSignBytes" - Encodes the message for signing
func (MsgProof) GetSigners ¶
GetSigners defines whose signature is required
func (*MsgProof) MarshalToSizedBuffer ¶
func (*MsgProof) ProtoMessage ¶
func (msg *MsgProof) ProtoMessage()
func (MsgProof) ToProto ¶
func (msg MsgProof) ToProto() MsgProtoProof
func (MsgProof) ValidateBasic ¶
"ValidateBasic" - Storeless validity check for proof message
type MsgProtoProof ¶
type MsgProtoProof struct { MerkleProof MerkleProof `protobuf:"bytes,1,opt,name=merkleProof,proto3" json:"merkle_proofs"` Leaf ProofI `protobuf:"bytes,2,opt,name=leaf,proto3" json:"leaf"` EvidenceType EvidenceType `protobuf:"varint,3,opt,name=evidenceType,proto3,casttype=EvidenceType" json:"evidence_type"` }
func (*MsgProtoProof) Descriptor ¶
func (*MsgProtoProof) Descriptor() ([]byte, []int)
func (*MsgProtoProof) Marshal ¶
func (m *MsgProtoProof) Marshal() (dAtA []byte, err error)
func (*MsgProtoProof) MarshalToSizedBuffer ¶
func (m *MsgProtoProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgProtoProof) ProtoMessage ¶
func (*MsgProtoProof) ProtoMessage()
func (*MsgProtoProof) Reset ¶
func (m *MsgProtoProof) Reset()
func (*MsgProtoProof) Size ¶
func (m *MsgProtoProof) Size() (n int)
func (*MsgProtoProof) String ¶
func (m *MsgProtoProof) String() string
func (*MsgProtoProof) Unmarshal ¶
func (m *MsgProtoProof) Unmarshal(dAtA []byte) error
func (*MsgProtoProof) XXX_DiscardUnknown ¶
func (m *MsgProtoProof) XXX_DiscardUnknown()
func (*MsgProtoProof) XXX_Marshal ¶
func (m *MsgProtoProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgProtoProof) XXX_Merge ¶
func (m *MsgProtoProof) XXX_Merge(src proto.Message)
func (*MsgProtoProof) XXX_MessageName ¶
func (*MsgProtoProof) XXX_MessageName() string
func (*MsgProtoProof) XXX_Size ¶
func (m *MsgProtoProof) XXX_Size() int
func (*MsgProtoProof) XXX_Unmarshal ¶
func (m *MsgProtoProof) XXX_Unmarshal(b []byte) error
type Params ¶
type Params struct { SessionNodeCount int64 `json:"session_node_count"` ClaimSubmissionWindow int64 `json:"proof_waiting_period"` SupportedBlockchains []string `json:"supported_blockchains"` ClaimExpiration int64 `json:"claim_expiration"` // per session ReplayAttackBurnMultiplier int64 `json:"replay_attack_burn_multiplier"` MinimumNumberOfProofs int64 `json:"minimum_number_of_proofs"` BlockByteSize int64 `json:"block_byte_size,omitempty"` }
"Params" - defines the governance set, high level settings for pocketcore module
func DefaultGenesisParams ¶
func DefaultGenesisParams() Params
"DefaultParams" - Returns a default set of parameters at genesis
func DefaultParams ¶
func DefaultParams() Params
"DefaultParams" - Returns a default set of parameters
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() types.ParamSetPairs
"ParamSetPairs" - returns an kv params object Note: Implements params.ParamSet
type Payload ¶
type Payload struct { Data string `json:"data"` // the actual data string for the external chain Method string `json:"method"` // the http CRUD method Path string `json:"path"` // the REST Path Headers map[string]string `json:"headers,omitempty"` // http headers }
"Payload" - A data being sent to the non-native chain
func (Payload) HashString ¶
"HashString" - The hex encoded string representation of the payload object
func (Payload) MarshalJSON ¶
"MarshalJSON" - Overrides json marshalling
type PocketKeeper ¶
type PocketNode ¶
type PocketNode struct { PrivateKey crypto.PrivateKey EvidenceStore *CacheStorage SessionStore *CacheStorage DoCacheInitOnce sync.Once }
PocketNode represents an entity in the network that is able to handle dispatches, servicing, challenges, and submit proofs/claims.
func AddPocketNode ¶
func AddPocketNode(pk crypto.PrivateKey, logger log.Logger) *PocketNode
func GetPocketNode ¶
func GetPocketNode() *PocketNode
GetPocketNode returns a PocketNode from global map GlobalPocketNodes, it does not guarantee order
func GetPocketNodeByAddress ¶
func GetPocketNodeByAddress(address *sdk.Address) (*PocketNode, error)
GetPocketNodeByAddress returns a PocketNode from global map GlobalPocketNodes
func (*PocketNode) GetAddress ¶
func (n *PocketNode) GetAddress() sdk.Address
type PosKeeper ¶
type PosKeeper interface { CalculateRelayReward( ctx sdk.Ctx, chain string, relays sdk.BigInt, stake sdk.BigInt, ) (nodeReward, feesCollected sdk.BigInt) RewardForRelays(ctx sdk.Ctx, relays sdk.BigInt, address sdk.Address) sdk.BigInt RewardForRelaysPerChain( ctx sdk.Ctx, chain string, relays sdk.BigInt, address sdk.Address, ) sdk.BigInt GetStakedTokens(ctx sdk.Ctx) sdk.BigInt Validator(ctx sdk.Ctx, addr sdk.Address) nodesexported.ValidatorI TotalTokens(ctx sdk.Ctx) sdk.BigInt BurnForChallenge(ctx sdk.Ctx, challenges sdk.BigInt, address sdk.Address) JailValidator(ctx sdk.Ctx, addr sdk.Address) AllValidators(ctx sdk.Ctx) (validators []nodesexported.ValidatorI) GetStakedValidators(ctx sdk.Ctx) (validators []nodesexported.ValidatorI) BlocksPerSession(ctx sdk.Ctx) (res int64) StakeDenom(ctx sdk.Ctx) (res string) GetValidatorsByChain(ctx sdk.Ctx, networkID string) (validators []sdk.Address, total int) MaxChains(ctx sdk.Ctx) (maxChains int64) GetRewardCost(ctx sdk.Ctx) sdk.BigInt }
type Proof ¶
type Proof interface { Hash() []byte // returns cryptographic hash of bz Bytes() []byte // returns bytes representation HashString() string // returns the hex string representation of the merkleHash ValidateBasic() sdk.Error // storeless validation check for the object GetSigner() sdk.Address // returns the main signer(s) for the proof (used in messages) SessionHeader() SessionHeader // returns the session header Validate(appSupportedBlockchains []string, sessionNodeCount int, sessionBlockHeight int64) sdk.Error // validate the object Store(max sdk.BigInt, storage *CacheStorage) // handle the proof after validation ToProto() ProofI // convert to protobuf }
"Proof" - An interface representation of an economic proof of work/burn (relay or challenge)
func GetProof ¶
func GetProof(header SessionHeader, evidenceType EvidenceType, index int64, evidenceStore *CacheStorage) Proof
"GetProof" - Returns the Proof object from a specific piece of GOBEvidence at a certain index
type ProofI ¶
type ProofI struct { // Types that are valid to be assigned to Proof: // *ProofI_RelayProof // *ProofI_ChallengeProof Proof isProofI_Proof `protobuf_oneof:"proof"` }
func (*ProofI) Descriptor ¶
func (*ProofI) GetChallengeProof ¶
func (m *ProofI) GetChallengeProof() *ChallengeProofInvalidData
func (*ProofI) GetRelayProof ¶
func (m *ProofI) GetRelayProof() *RelayProof
func (*ProofI) MarshalToSizedBuffer ¶
func (*ProofI) ProtoMessage ¶
func (*ProofI) ProtoMessage()
func (*ProofI) XXX_DiscardUnknown ¶
func (m *ProofI) XXX_DiscardUnknown()
func (*ProofI) XXX_Marshal ¶
func (*ProofI) XXX_OneofWrappers ¶
func (*ProofI) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*ProofI) XXX_Unmarshal ¶
type ProofI_ChallengeProof ¶
type ProofI_ChallengeProof struct {
ChallengeProof *ChallengeProofInvalidData `protobuf:"bytes,2,opt,name=challengeProof,proto3,oneof" json:"challengeProof,omitempty"`
}
func (*ProofI_ChallengeProof) MarshalTo ¶
func (m *ProofI_ChallengeProof) MarshalTo(dAtA []byte) (int, error)
func (*ProofI_ChallengeProof) MarshalToSizedBuffer ¶
func (m *ProofI_ChallengeProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ProofI_ChallengeProof) Size ¶
func (m *ProofI_ChallengeProof) Size() (n int)
type ProofI_RelayProof ¶
type ProofI_RelayProof struct {
RelayProof *RelayProof `protobuf:"bytes,1,opt,name=relayProof,proto3,oneof" json:"relayProof,omitempty"`
}
func (*ProofI_RelayProof) MarshalTo ¶
func (m *ProofI_RelayProof) MarshalTo(dAtA []byte) (int, error)
func (*ProofI_RelayProof) MarshalToSizedBuffer ¶
func (m *ProofI_RelayProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ProofI_RelayProof) Size ¶
func (m *ProofI_RelayProof) Size() (n int)
type ProtoEvidence ¶
type ProtoEvidence struct { BloomBytes []byte `protobuf:"bytes,1,opt,name=bloomBytes,proto3" json:"bloom_bytes"` SessionHeader *SessionHeader `protobuf:"bytes,2,opt,name=sessionHeader,proto3" json:"evidence_header"` NumOfProofs int64 `protobuf:"varint,3,opt,name=numOfProofs,proto3" json:"num_of_proofs"` Proofs ProofIs `protobuf:"bytes,4,rep,name=proofs,proto3,castrepeated=ProofIs" json:"proofs"` EvidenceType EvidenceType `protobuf:"varint,5,opt,name=evidenceType,proto3,casttype=EvidenceType" json:"evidence_type"` }
func (*ProtoEvidence) Descriptor ¶
func (*ProtoEvidence) Descriptor() ([]byte, []int)
func (*ProtoEvidence) FromProto ¶
func (pe *ProtoEvidence) FromProto() (Evidence, error)
func (*ProtoEvidence) Marshal ¶
func (m *ProtoEvidence) Marshal() (dAtA []byte, err error)
func (*ProtoEvidence) MarshalToSizedBuffer ¶
func (m *ProtoEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ProtoEvidence) ProtoMessage ¶
func (*ProtoEvidence) ProtoMessage()
func (*ProtoEvidence) Reset ¶
func (m *ProtoEvidence) Reset()
func (*ProtoEvidence) Size ¶
func (m *ProtoEvidence) Size() (n int)
func (*ProtoEvidence) String ¶
func (m *ProtoEvidence) String() string
func (*ProtoEvidence) Unmarshal ¶
func (m *ProtoEvidence) Unmarshal(dAtA []byte) error
func (*ProtoEvidence) XXX_DiscardUnknown ¶
func (m *ProtoEvidence) XXX_DiscardUnknown()
func (*ProtoEvidence) XXX_Marshal ¶
func (m *ProtoEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProtoEvidence) XXX_Merge ¶
func (m *ProtoEvidence) XXX_Merge(src proto.Message)
func (*ProtoEvidence) XXX_Size ¶
func (m *ProtoEvidence) XXX_Size() int
func (*ProtoEvidence) XXX_Unmarshal ¶
func (m *ProtoEvidence) XXX_Unmarshal(b []byte) error
type QueryChallengeParams ¶
type QueryChallengeParams struct {
Challenge ChallengeProofInvalidData `json:"challengeProof"`
}
"QueryChallengeParams" - The parameters needed to submit a challenge request
type QueryDispatchParams ¶
type QueryDispatchParams struct {
SessionHeader `json:"header"`
}
"QueryDispatchParams" - The parameters needed to submit a dispatch request
type QueryReceiptParams ¶
type QueryReceiptParams struct { Address sdk.Address `json:"address"` Header SessionHeader `json:"header"` Type string `json:"type"` }
"QueryReceiptParams" - The parameters needed to retrieve a receipt obj for a specific instance
type QueryReceiptsParams ¶
"QueryReceiptsParama" - The parameters needed to retreive receipt objs for an address
type QueryRelayParams ¶
type QueryRelayParams struct {
Relay `json:"relay"`
}
"QueryRelayParams" - The parameters needed to submit a relay request
type Range ¶
type Range struct { Lower uint64 `protobuf:"varint,1,opt,name=lower,proto3" json:"lower"` Upper uint64 `protobuf:"varint,2,opt,name=upper,proto3" json:"upper"` }
Range for merkle sum index tree
func (*Range) Descriptor ¶
func (*Range) ProtoMessage ¶
func (*Range) ProtoMessage()
func (*Range) XXX_DiscardUnknown ¶
func (m *Range) XXX_DiscardUnknown()
func (*Range) XXX_Marshal ¶
func (*Range) XXX_Unmarshal ¶
type Relay ¶
type Relay struct { Payload Payload `json:"payload"` // the data payload of the request Meta RelayMeta `json:"meta"` // metadata for the relay request Proof RelayProof `json:"proof"` // the authentication scheme needed for work }
"Relay" - A read / write API request to a hosted (non-native) external blockchain
func (Relay) Execute ¶
func (r Relay) Execute(hostedBlockchains *HostedBlockchains, address *sdk.Address) (string, sdk.Error)
"Execute" - Attempts to do a request on the non-native blockchain specified
func (Relay) RequestHash ¶
"Requesthash" - The cryptographic merkleHash representation of the request
func (Relay) RequestHashString ¶
"RequestHashString" - The hex string representation of the request merkleHash
func (*Relay) Validate ¶
func (r *Relay) Validate( ctx sdk.Ctx, posKeeper PosKeeper, appsKeeper AppsKeeper, pocketKeeper PocketKeeper, hb *HostedBlockchains, sessionBlockHeight int64, servicerNode *PocketNode, ) (maxPossibleRelays sdk.BigInt, err sdk.Error)
"Validate" - Checks the validity of a Relay Request using store data
type RelayMeta ¶
type RelayMeta struct {
BlockHeight int64 `json:"block_height"` // the block height when the request is made
}
"RelayMeta" - Metadata that is included in the relay request
type RelayProof ¶
type RelayProof struct { RequestHash string `protobuf:"bytes,1,opt,name=requestHash,proto3" json:"request_hash"` Entropy int64 `protobuf:"varint,2,opt,name=entropy,proto3" json:"entropy"` SessionBlockHeight int64 `protobuf:"varint,3,opt,name=sessionBlockHeight,proto3" json:"session_block_height"` ServicerPubKey string `protobuf:"bytes,4,opt,name=servicerPubKey,proto3" json:"servicer_pub_key"` Blockchain string `protobuf:"bytes,5,opt,name=blockchain,proto3" json:"blockchain"` Token AAT `protobuf:"bytes,6,opt,name=token,proto3" json:"aat"` Signature string `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature"` }
func (RelayProof) Bytes ¶
func (rp RelayProof) Bytes() []byte
"Bytes" - Converts the RelayProof to bytes
func (RelayProof) BytesWithSignature ¶
func (rp RelayProof) BytesWithSignature() []byte
"BytesWithSignature" - Convert the RelayProof to bytes
func (*RelayProof) Descriptor ¶
func (*RelayProof) Descriptor() ([]byte, []int)
func (RelayProof) GetSigner ¶
func (rp RelayProof) GetSigner() sdk.Address
func (RelayProof) Hash ¶
func (rp RelayProof) Hash() []byte
"Hash" - Returns the cryptographic merkleHash of the rp bytes
func (RelayProof) HashString ¶
func (rp RelayProof) HashString() string
"HashString" - Returns the hex encoded string of the rp merkleHash
func (RelayProof) HashStringWithSignature ¶
func (rp RelayProof) HashStringWithSignature() string
"HashStringWithSignature" - Returns the hex encoded string of the rp merkleHash (with signature field)
func (RelayProof) HashWithSignature ¶
func (rp RelayProof) HashWithSignature() []byte
"HashWithSignature" - Returns the cryptographic merkleHash of the rp bytes (with signature field)
func (*RelayProof) Marshal ¶
func (m *RelayProof) Marshal() (dAtA []byte, err error)
func (*RelayProof) MarshalToSizedBuffer ¶
func (m *RelayProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*RelayProof) ProtoMessage ¶
func (*RelayProof) ProtoMessage()
func (*RelayProof) Reset ¶
func (m *RelayProof) Reset()
func (RelayProof) SessionHeader ¶
func (rp RelayProof) SessionHeader() SessionHeader
"SessionHeader" - Returns the session header corresponding with the proof
func (*RelayProof) Size ¶
func (m *RelayProof) Size() (n int)
func (RelayProof) Store ¶
func (rp RelayProof) Store(maxRelays sdk.BigInt, evidenceStore *CacheStorage)
"Store" - Handles the relay proof object by adding it to the cache
func (*RelayProof) String ¶
func (m *RelayProof) String() string
func (RelayProof) ToProto ¶
func (rp RelayProof) ToProto() ProofI
func (*RelayProof) Unmarshal ¶
func (m *RelayProof) Unmarshal(dAtA []byte) error
func (RelayProof) Validate ¶
func (rp RelayProof) Validate(appSupportedBlockchains []string, _ int, sessionBlockHeight int64) sdk.Error
"Validate" - Validates the relay proof object
func (RelayProof) ValidateBasic ¶
func (rp RelayProof) ValidateBasic() sdk.Error
ValidateBasic provides a light-weight, stateless validation of the relay proof object.
func (RelayProof) ValidateLocal ¶
func (rp RelayProof) ValidateLocal( appSupportedBlockchains []string, sessionNodeCount int, sessionBlockHeight int64, expectedServicerAddr sdk.Address, ) sdk.Error
ValidateLocal validates the Relay Proof object is aligned with `sessionBlockHeight` and `verifyAddr`.
func (*RelayProof) XXX_DiscardUnknown ¶
func (m *RelayProof) XXX_DiscardUnknown()
func (*RelayProof) XXX_Marshal ¶
func (m *RelayProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RelayProof) XXX_Merge ¶
func (m *RelayProof) XXX_Merge(src proto.Message)
func (*RelayProof) XXX_Size ¶
func (m *RelayProof) XXX_Size() int
func (*RelayProof) XXX_Unmarshal ¶
func (m *RelayProof) XXX_Unmarshal(b []byte) error
type RelayResponse ¶
type RelayResponse struct { Signature string `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature"` Response string `protobuf:"bytes,2,opt,name=response,proto3" json:"payload"` Proof RelayProof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof"` }
func (*RelayResponse) Descriptor ¶
func (*RelayResponse) Descriptor() ([]byte, []int)
func (RelayResponse) Hash ¶
func (rr RelayResponse) Hash() []byte
"Hash" - The cryptographic merkleHash representation of the relay response
func (RelayResponse) HashString ¶
func (rr RelayResponse) HashString() string
"HashString" - The hex string representation of the merkleHash
func (*RelayResponse) Marshal ¶
func (m *RelayResponse) Marshal() (dAtA []byte, err error)
func (*RelayResponse) MarshalToSizedBuffer ¶
func (m *RelayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*RelayResponse) ProtoMessage ¶
func (*RelayResponse) ProtoMessage()
func (*RelayResponse) Reset ¶
func (m *RelayResponse) Reset()
func (*RelayResponse) Size ¶
func (m *RelayResponse) Size() (n int)
func (*RelayResponse) String ¶
func (m *RelayResponse) String() string
func (*RelayResponse) Unmarshal ¶
func (m *RelayResponse) Unmarshal(dAtA []byte) error
func (RelayResponse) Validate ¶
func (rr RelayResponse) Validate() sdk.Error
"Validate" - The node validates the response after signing
func (*RelayResponse) XXX_DiscardUnknown ¶
func (m *RelayResponse) XXX_DiscardUnknown()
func (*RelayResponse) XXX_Marshal ¶
func (m *RelayResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RelayResponse) XXX_Merge ¶
func (m *RelayResponse) XXX_Merge(src proto.Message)
func (*RelayResponse) XXX_Size ¶
func (m *RelayResponse) XXX_Size() int
func (*RelayResponse) XXX_Unmarshal ¶
func (m *RelayResponse) XXX_Unmarshal(b []byte) error
type ServiceMetric ¶
type ServiceMetric struct { RelayCount metrics.Counter `json:"relay_count"` ChallengeCount metrics.Counter `json:"challenge_count"` ErrCount metrics.Counter `json:"err_count"` AverageRelayTime metrics.Histogram `json:"avg_relay_time"` AverageClaimTime metrics.Histogram `json:"avg_claim_time"` AverageProofTime metrics.Histogram `json:"avg_proof_time"` TotalSessions metrics.Counter `json:"total_sessions"` UPOKTEarned metrics.Counter `json:"upokt_earned"` }
func NewServiceMetricsFor ¶
func NewServiceMetricsFor(networkID string) ServiceMetric
type ServiceMetrics ¶
type ServiceMetrics struct { ServiceMetric `json:"accumulated_service_metrics"` // total metrics NonNativeChains map[string]ServiceMetric `json:"individual_service_metrics"` // metrics per chain // contains filtered or unexported fields }
func GlobalServiceMetric ¶
func GlobalServiceMetric() *ServiceMetrics
func NewServiceMetrics ¶
func NewServiceMetrics(hostedBlockchains *HostedBlockchains, logger log.Logger) *ServiceMetrics
func (*ServiceMetrics) AddChallengeFor ¶
func (sm *ServiceMetrics) AddChallengeFor(networkID string, nodeAddress *sdk.Address)
func (*ServiceMetrics) AddClaimTiming ¶
func (sm *ServiceMetrics) AddClaimTiming(networkID string, time float64, nodeAddress *sdk.Address)
func (*ServiceMetrics) AddErrorFor ¶
func (sm *ServiceMetrics) AddErrorFor(networkID string, nodeAddress *sdk.Address)
func (*ServiceMetrics) AddProofTiming ¶
func (sm *ServiceMetrics) AddProofTiming(networkID string, time float64, nodeAddress *sdk.Address)
func (*ServiceMetrics) AddRelayFor ¶
func (sm *ServiceMetrics) AddRelayFor(networkID string, nodeAddress *sdk.Address)
func (*ServiceMetrics) AddRelayTimingFor ¶
func (sm *ServiceMetrics) AddRelayTimingFor(networkID string, relayTime float64, nodeAddress *sdk.Address)
func (*ServiceMetrics) AddSessionFor ¶
func (sm *ServiceMetrics) AddSessionFor(networkID string, nodeAddress *sdk.Address)
func (*ServiceMetrics) AddUPOKTEarnedFor ¶
func (sm *ServiceMetrics) AddUPOKTEarnedFor(networkID string, upoktEarned float64, nodeAddress *sdk.Address)
func (*ServiceMetrics) StartPrometheusServer ¶
func (sm *ServiceMetrics) StartPrometheusServer(addr string, maxOpenConn int) *http.Server
startPrometheusServer starts a Prometheus HTTP server, listening for metrics collectors on addr.
type ServiceMetricsEncodable ¶
type ServiceMetricsEncodable struct { ServiceMetric `json:"accumulated_service_metrics"` // total metrics NonNativeChains []ServiceMetric `json:"individual_service_metrics"` // metrics per chain }
type Session ¶
type Session struct { SessionHeader SessionHeader `protobuf:"bytes,1,opt,name=sessionHeader,proto3" json:"header"` SessionKey SessionKey `protobuf:"bytes,2,opt,name=sessionKey,proto3,casttype=SessionKey" json:"key"` SessionNodes SessionNodes `protobuf:"bytes,3,rep,name=sessionNodes,proto3,castrepeated=SessionNodes" json:"nodes"` }
func GetSession ¶
func GetSession(header SessionHeader, sessionStore *CacheStorage) (session Session, found bool)
"GetSession" - Returns a session (value) from the stores using a header (key)
func NewSession ¶
func NewSession( sessionCtx, ctx sdk.Ctx, keeper PosKeeper, sessionHeader SessionHeader, blockHash string, sessionNodesCount int, ) (Session, sdk.Error)
"NewSession" - create a new session from seed data
func (*Session) Descriptor ¶
func (Session) HashString ¶
func (Session) IsSealable ¶
func (Session) MarshalObject ¶
func (*Session) MarshalToSizedBuffer ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (Session) UnmarshalObject ¶
func (s Session) UnmarshalObject(b []byte) (CacheObject, error)
func (Session) Validate ¶
func (s Session) Validate(node sdk.Address, app appexported.ApplicationI, sessionNodeCount int) sdk.Error
"Validate" - Validates a session object
func (*Session) XXX_DiscardUnknown ¶
func (m *Session) XXX_DiscardUnknown()
func (*Session) XXX_Marshal ¶
func (*Session) XXX_Unmarshal ¶
type SessionHeader ¶
type SessionHeader struct { ApplicationPubKey string `protobuf:"bytes,1,opt,name=applicationPubKey,proto3" json:"app_public_key"` Chain string `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain"` SessionBlockHeight int64 `protobuf:"varint,3,opt,name=sessionBlockHeight,proto3" json:"session_height"` }
SessionHeader defines the header for session information
func (SessionHeader) Bytes ¶
func (sh SessionHeader) Bytes() []byte
"Bytes" - The bytes representation of the session header
func (*SessionHeader) Descriptor ¶
func (*SessionHeader) Descriptor() ([]byte, []int)
func (SessionHeader) Hash ¶
func (sh SessionHeader) Hash() []byte
"Hash" - The cryptographic merkleHash representation of the session header
func (SessionHeader) HashString ¶
func (sh SessionHeader) HashString() string
"HashString" - The hex string representation of the merkleHash
func (*SessionHeader) Marshal ¶
func (m *SessionHeader) Marshal() (dAtA []byte, err error)
func (*SessionHeader) MarshalToSizedBuffer ¶
func (m *SessionHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SessionHeader) ProtoMessage ¶
func (*SessionHeader) ProtoMessage()
func (*SessionHeader) Reset ¶
func (m *SessionHeader) Reset()
func (*SessionHeader) Size ¶
func (m *SessionHeader) Size() (n int)
func (*SessionHeader) String ¶
func (m *SessionHeader) String() string
func (*SessionHeader) Unmarshal ¶
func (m *SessionHeader) Unmarshal(dAtA []byte) error
func (SessionHeader) ValidateHeader ¶
func (sh SessionHeader) ValidateHeader() sdk.Error
"ValidateHeader" - Validates the header of the session
func (*SessionHeader) XXX_DiscardUnknown ¶
func (m *SessionHeader) XXX_DiscardUnknown()
func (*SessionHeader) XXX_Marshal ¶
func (m *SessionHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SessionHeader) XXX_Merge ¶
func (m *SessionHeader) XXX_Merge(src proto.Message)
func (*SessionHeader) XXX_Size ¶
func (m *SessionHeader) XXX_Size() int
func (*SessionHeader) XXX_Unmarshal ¶
func (m *SessionHeader) XXX_Unmarshal(b []byte) error
type SessionIt ¶
"SessionIt" - An iterator value for the sessionCache structure
func SessionIterator ¶
func SessionIterator(sessionStore *CacheStorage) SessionIt
"SessionIterator" - Returns an instance iterator of the GlobalSessionCache
type SessionKey ¶
type SessionKey []byte
"SessionKey" - the merkleHash identifier of the session
func NewSessionKey ¶
"NewSessionKey" - generates the session key from metadata
func (SessionKey) Validate ¶
func (sk SessionKey) Validate() sdk.Error
"Validate" - Validates the session key
type SessionNodes ¶
"SessionNodes" - Service nodes in a session
func NewSessionNodes ¶
func NewSessionNodes( sessionCtx, ctx sdk.Ctx, keeper PosKeeper, chain string, sessionKey SessionKey, sessionNodesCount int, ) (sessionNodes SessionNodes, err sdk.Error)
"NewSessionNodes" - Generates nodes for the session
type SortByProof ¶
type SortByProof proofAndRanges
func (SortByProof) Len ¶
func (a SortByProof) Len() int
func (SortByProof) Less ¶
func (a SortByProof) Less(i, j int) bool
func (SortByProof) Swap ¶
func (a SortByProof) Swap(i, j int)