types

package
v0.0.0-...-4955b9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2021 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRPCTimeout = 3000
	MaxRPCTimeout     = 1000000
	MinRPCTimeout     = 1
)
View Source
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
)
View Source
const (
	EventTypeClaim        = MsgClaimName // an event for emitting a claim message
	EventTypeProof        = MsgProofName // an event for emitting a proof message
	AttributeKeyValidator = "validator"  // a validator attribute
)
View Source
const (
	ClaimFee = 10000 // fee for claim message (in uPOKT)
	ProofFee = 10000 // fee for proof message (in uPOKT)
)
View Source
const (
	ModuleName = "pocketcore"            // name of the module
	StoreKey   = ModuleName              // key for state store
	TStoreKey  = "transient_" + StoreKey // transient key for state store
)
View Source
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 : "
)
View Source
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

View Source
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 exprie claims
	DefaultReplayAttackBurnMultiplier = int64(3)   // default replay attack burn multiplier
	DefaultMinimumNumberOfProofs      = int64(5)   // default minimum number of proofs

)

POS params default values

View Source
const (
	QueryReceipt              = "receipt"
	QueryReceipts             = "receipts"
	QuerySupportedBlockchains = "supportedBlockchains"
	QueryRelay                = "relay"
	QueryDispatch             = "dispatch"
	QueryChallenge            = "challenge"
	QueryParameters           = "parameters"
)

query endpoints supported by the staking Querier

View Source
const DEFAULTHTTPMETHOD = "POST"
View Source
const MerkleHashLength = blake2b.Size256

Variables

View Source
var (
	Hasher                  = sha.SHA3_256
	HashLength              = sha.SHA3_256.Size()
	NetworkIdentifierLength = 4
	AddrLength              = tmhash.TruncatedSize
)
View Source
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 applicaiton public key included in the AAT is not valid")
	MissingClientPublicKeyError      = errors.New("the client public key included in the AAT is not valid")
	InvalidTokenSignatureErorr       = 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")
)
View Source
var (
	ClaimLen = len(ClaimKey)
	ClaimKey = []byte{0x02} // key for pending claims
)
View Source
var (
	DefaultSupportedBlockchains   = []string{"0001"}
	KeySessionNodeCount           = []byte("SessionNodeCount")
	KeyClaimSubmissionWindow      = []byte("ClaimSubmissionWindow")
	KeySupportedBlockchains       = []byte("SupportedBlockchains")
	KeyClaimExpiration            = []byte("ClaimExpiration")
	KeyReplayAttackBurnMultiplier = []byte("ReplayAttackBurnMultiplier")
	KeyMinimumNumberOfProofs      = []byte("MinimumNumberOfProofs")
)
View Source
var (
	ErrInvalidLengthPocket        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPocket          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPocket = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	GlobalPocketConfig types.PocketConfig
)
View Source
var ModuleCdc *codec.Codec

module wide codec

View Source
var (
	// map of message name to fee value
	PocketFeeMap = map[string]int64{
		MsgClaimName: ClaimFee,
		MsgProofName: ProofFee,
	}
)
View Source
var (
	// A list of supported token versions
	// Requires major (semantic) upgrade to update this list
	SupportedTokenVersions = []string{"0.0.1"}
)

Functions

func AddressVerification

func AddressVerification(addr string) sdk.Error

"AddressVerification" - Verifies the address format (hex strign)

func BlockHash

func BlockHash(ctx sdk.Context) string

"BlockHash" - Returns the merkleHash from the ctx block header

func ClearEvidence

func ClearEvidence()

"ClearEvidence" - Clear stores of all evidence

func ClearSessionCache

func ClearSessionCache()

"ClearSessionCache" - Clears all items from the session cache db

func ConvertEvidenceToProto

func ConvertEvidenceToProto(config types.Config) error

func DeleteEvidence

func DeleteEvidence(header SessionHeader, evidenceType EvidenceType) error

"DeleteEvidence" - Delete the GOBEvidence from the stores

func DeleteSession

func DeleteSession(header SessionHeader)

"DeleteSession" - Deletes a session (value) from the stores

func ErrorWarrantsDispatch

func ErrorWarrantsDispatch(err error) bool

func FlushSessionCache

func FlushSessionCache()

NOTE: evidence cache is flushed every time db iterator is created (every claim/proof submission)

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

func GenerateRoot(height int64, data []Proof) (r HashRange, sortedData []Proof)

"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 GetPVKeyFile

func GetPVKeyFile() (privval.FilePVKey, sdk.Error)

"GetPVKeyFile" - Returns the globalPVKeyFile instance

func GetRPCTimeout

func GetRPCTimeout() time.Duration

func Hash

func Hash(b []byte) []byte

"ID"- Converts []byte to hashed []byte

func HashVerification

func HashVerification(hash string) sdk.Error

"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)

"InitConfig" - Initializes the cache for sessions and evidence

func InitGlobalServiceMetric

func InitGlobalServiceMetric(hostedBlockchains *HostedBlockchains, logger log.Logger, addr string, maxOpenConn int)

func InitPVKeyFile

func InitPVKeyFile(filePVKey privval.FilePVKey)

"InitPVKeyFile" - Initializes the global private validator key variable

func IsUniqueProof

func IsUniqueProof(p Proof, evidence Evidence) bool

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

func KeyForClaims(addr sdk.Address) ([]byte, error)

"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 MultiAppend(dest []byte, s ...[]byte) []byte

func NetworkIdentifierVerification

func NetworkIdentifierVerification(hash string) sdk.Error

"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 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 NewInvalidHashError(codespace sdk.CodespaceType, err error, h string) sdk.Error

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 PseudorandomSelection(max sdk.BigInt, hash []byte) (index sdk.BigInt)

func PubKeyVerification

func PubKeyVerification(pk string) sdk.Error

"PubKeyVerification" - Verifies the public key format (hex string)

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the codec

func SetEvidence

func SetEvidence(evidence Evidence)

"SetEvidence" - Sets an GOBEvidence object in the storage

func SetProof

func SetProof(header SessionHeader, evidenceType EvidenceType, p Proof, max sdk.BigInt)

"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)

"SetSession" - Sets a session (value) in the stores using the header (key)

func SignatureVerification

func SignatureVerification(publicKey, msgHex, sigHex string) sdk.Error

"SignatureVerification" - Verify the signature using hex strings

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) Bytes

func (a AAT) Bytes() []byte

"Bytes" - Returns the bytes representation of the AAT

func (*AAT) Descriptor

func (*AAT) Descriptor() ([]byte, []int)

func (AAT) Hash

func (a AAT) Hash() []byte

"ID" - Returns the merkleHash of the AAT bytes

func (AAT) HashString

func (a AAT) HashString() string

"HashString" - Returns the string representation of the AAT merkleHash

func (*AAT) Marshal

func (m *AAT) Marshal() (dAtA []byte, err error)

func (*AAT) MarshalTo

func (m *AAT) MarshalTo(dAtA []byte) (int, error)

func (*AAT) MarshalToSizedBuffer

func (m *AAT) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AAT) ProtoMessage

func (*AAT) ProtoMessage()

func (*AAT) Reset

func (m *AAT) Reset()

func (*AAT) Size

func (m *AAT) Size() (n int)

func (*AAT) String

func (m *AAT) String() string

func (*AAT) Unmarshal

func (m *AAT) Unmarshal(dAtA []byte) error

func (AAT) Validate

func (a AAT) Validate() error

"Validate" - Returns an error for an invalid AAT

func (AAT) ValidateMessage

func (a AAT) ValidateMessage() error

"ValidateMessage" - Confirms the message field of the AAT

func (AAT) ValidateSignature

func (a AAT) ValidateSignature() error

"ValidateSignature" - Confirms the signature field of the AAT

func (AAT) ValidateVersion

func (a AAT) ValidateVersion() error

"ValidateVersion" - Confirms the version field of the AAT

func (AAT) VersionIsIncluded

func (a AAT) VersionIsIncluded() bool

"VersionIsIncluded" - Returns if the version is included

func (AAT) VersionIsSupported

func (a AAT) VersionIsSupported() bool

"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_Marshal

func (m *AAT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AAT) XXX_Merge

func (m *AAT) XXX_Merge(src proto.Message)

func (*AAT) XXX_Size

func (m *AAT) XXX_Size() int

func (*AAT) XXX_Unmarshal

func (m *AAT) XXX_Unmarshal(b []byte) error

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)
}

type AuthKeeper

type AuthKeeper interface {
	GetFee(ctx sdk.Ctx, msg sdk.Msg) sdk.BigInt
	GetAccount(ctx sdk.Ctx, addr sdk.Address) authexported.Account
}

type BasicAuth

type BasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type CacheObject

type CacheObject interface {
	MarshalObject() ([]byte, error)
	UnmarshalObject(b []byte) (CacheObject, error)
	Key() ([]byte, error)
	Seal() CacheObject
	IsSealed() bool
}

type CacheStorage

type CacheStorage struct {
	Cache *sdk.Cache // lru cache
	DB    db.DB      // persisted
	// contains filtered or unexported fields
}

"CacheStorage" - Contains an LRU cache and a database instance w/ mutex

func (*CacheStorage) Clear

func (cs *CacheStorage) Clear()

"Clear" - Deletes all items from stores

func (*CacheStorage) Delete

func (cs *CacheStorage) Delete(key []byte)

"Delete" - 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)

"Init" - Initializes a cache storage object

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)

"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) 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) (evidence Evidence, err error)

"GetEvidence" - Retrieves the GOBEvidence object from the storage

func GetTotalProofs

func GetTotalProofs(h SessionHeader, et EvidenceType, maxPossibleRelays sdk.BigInt) (Evidence, int64)

"GetTotalProofs" - Returns the total number of proofs for a piece of GOBEvidence

func SealEvidence

func SealEvidence(evidence Evidence) (Evidence, bool)

"SealEvidence" - Locks/sets the evidence from the stores

func (*Evidence) AddProof

func (e *Evidence) AddProof(p Proof)

"AddProof" - Adds a proof obj to the GOBEvidence field

func (*Evidence) GenerateMerkleProof

func (e *Evidence) GenerateMerkleProof(height int64, index int) (proof MerkleProof, leaf Proof)

"GenerateMerkleProof" - Generates the merkle Proof for an GOBEvidence

func (*Evidence) GenerateMerkleRoot

func (e *Evidence) GenerateMerkleRoot(height int64) (root HashRange)

"GenerateMerkleRoot" - Generates the merkle root for an GOBEvidence object

func (Evidence) IsSealed

func (e Evidence) IsSealed() bool

func (Evidence) Key

func (e Evidence) Key() ([]byte, error)

func (Evidence) LegacyAminoMarshal

func (e Evidence) LegacyAminoMarshal() ([]byte, error)

func (Evidence) LegacyAminoUnmarshal

func (e Evidence) LegacyAminoUnmarshal(b []byte) (CacheObject, error)

func (*Evidence) Marshal

func (e *Evidence) Marshal() ([]byte, error)

func (Evidence) MarshalObject

func (e Evidence) MarshalObject() ([]byte, error)

func (*Evidence) MarshalTo

func (e *Evidence) MarshalTo(data []byte) (n int, err error)

func (*Evidence) MarshalToSizedBuffer

func (e *Evidence) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Evidence) ProtoMessage

func (e *Evidence) ProtoMessage()

func (*Evidence) Reset

func (e *Evidence) Reset()

func (Evidence) Seal

func (e Evidence) Seal() CacheObject

func (*Evidence) Size

func (e *Evidence) Size() int

func (*Evidence) String

func (e *Evidence) String() string

func (*Evidence) ToProto

func (e *Evidence) ToProto() (*ProtoEvidence, error)

func (*Evidence) Unmarshal

func (e *Evidence) Unmarshal(data []byte) error

func (Evidence) UnmarshalObject

func (e Evidence) UnmarshalObject(b []byte) (CacheObject, error)

type EvidenceIt

type EvidenceIt struct {
	db.Iterator
}

"EvidenceIt" - An GOBEvidence iterator instance of the globalEvidenceCache

func EvidenceIterator

func EvidenceIterator() 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) Descriptor() ([]byte, []int)

func (HashRange) Equal

func (hr HashRange) Equal(hr2 HashRange) bool

func (*HashRange) GetHash

func (m *HashRange) GetHash() []byte

func (*HashRange) GetRange

func (m *HashRange) GetRange() Range

func (*HashRange) Marshal

func (m *HashRange) Marshal() (dAtA []byte, err error)

func (*HashRange) MarshalTo

func (m *HashRange) MarshalTo(dAtA []byte) (int, error)

func (*HashRange) MarshalToSizedBuffer

func (m *HashRange) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HashRange) ProtoMessage

func (*HashRange) ProtoMessage()

func (*HashRange) Reset

func (m *HashRange) Reset()

func (*HashRange) Size

func (m *HashRange) Size() (n int)

func (*HashRange) String

func (m *HashRange) String() string

func (*HashRange) Unmarshal

func (m *HashRange) Unmarshal(dAtA []byte) error

func (*HashRange) XXX_DiscardUnknown

func (m *HashRange) XXX_DiscardUnknown()

func (*HashRange) XXX_Marshal

func (m *HashRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HashRange) XXX_Merge

func (m *HashRange) XXX_Merge(src proto.Message)

func (*HashRange) XXX_Size

func (m *HashRange) XXX_Size() int

func (*HashRange) XXX_Unmarshal

func (m *HashRange) XXX_Unmarshal(b []byte) error

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"` // basic http auth optinal
}

HostedBlockchain" - An object that represents a local hosted non-native blockchain

type HostedBlockchains

type HostedBlockchains struct {
	M map[string]HostedBlockchain // M[addr] -> addr, url
}

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) MarshalTo

func (m *MerkleProof) MarshalTo(dAtA []byte) (int, 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)

"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) Descriptor() ([]byte, []int)

func (MsgClaim) GetFee

func (msg MsgClaim) GetFee() sdk.BigInt

"GetFee" - Returns the fee (sdk.BigInt) of the messgae type

func (MsgClaim) GetRecipient

func (msg MsgClaim) GetRecipient() sdk.Address

"GetSigners" - Defines whose signature is required

func (MsgClaim) GetSignBytes

func (msg MsgClaim) GetSignBytes() []byte

"GetSignBytes" - Encodes the message for signing

func (MsgClaim) GetSigner

func (msg MsgClaim) GetSigner() sdk.Address

"GetSigners" - Defines whose signature is required

func (MsgClaim) IsEmpty

func (msg MsgClaim) IsEmpty() bool

"IsEmpty" - Returns true if the EvidenceType == 0, this should only happen on initialization and MsgClaim{} calls

func (*MsgClaim) Marshal

func (m *MsgClaim) Marshal() (dAtA []byte, err error)

func (*MsgClaim) MarshalTo

func (m *MsgClaim) MarshalTo(dAtA []byte) (int, error)

func (*MsgClaim) MarshalToSizedBuffer

func (m *MsgClaim) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgClaim) ProtoMessage

func (*MsgClaim) ProtoMessage()

func (*MsgClaim) Reset

func (m *MsgClaim) Reset()

func (MsgClaim) Route

func (msg MsgClaim) Route() string

"Route" - Returns module router key

func (*MsgClaim) Size

func (m *MsgClaim) Size() (n int)

func (*MsgClaim) String

func (m *MsgClaim) String() string

func (MsgClaim) Type

func (msg MsgClaim) Type() string

"Type" - Returns message name

func (*MsgClaim) Unmarshal

func (m *MsgClaim) Unmarshal(dAtA []byte) error

func (MsgClaim) ValidateBasic

func (msg MsgClaim) ValidateBasic() sdk.Error

"ValidateBasic" - Storeless validity check for claim message

func (*MsgClaim) XXX_DiscardUnknown

func (m *MsgClaim) XXX_DiscardUnknown()

func (*MsgClaim) XXX_Marshal

func (m *MsgClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgClaim) XXX_Merge

func (m *MsgClaim) XXX_Merge(src proto.Message)

func (*MsgClaim) XXX_MessageName

func (*MsgClaim) XXX_MessageName() string

func (*MsgClaim) XXX_Size

func (m *MsgClaim) XXX_Size() int

func (*MsgClaim) XXX_Unmarshal

func (m *MsgClaim) XXX_Unmarshal(b []byte) error

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) GetFee

func (msg MsgProof) GetFee() sdk.BigInt

"GetFee" - Returns the fee (sdk.BigInt) of the messgae type

func (MsgProof) GetLeaf

func (msg MsgProof) GetLeaf() Proof

func (MsgProof) GetRecipient

func (msg MsgProof) GetRecipient() sdk.Address

"GetSigners" - Defines whose signature is required

func (MsgProof) GetSignBytes

func (msg MsgProof) GetSignBytes() []byte

"GetSignBytes" - Encodes the message for signing

func (MsgProof) GetSigner

func (msg MsgProof) GetSigner() sdk.Address

GetSigners defines whose signature is required

func (*MsgProof) Marshal

func (msg *MsgProof) Marshal() ([]byte, error)

func (*MsgProof) MarshalTo

func (msg *MsgProof) MarshalTo(data []byte) (n int, err error)

func (*MsgProof) MarshalToSizedBuffer

func (msg *MsgProof) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgProof) ProtoMessage

func (msg *MsgProof) ProtoMessage()

func (*MsgProof) Reset

func (msg *MsgProof) Reset()

func (MsgProof) Route

func (msg MsgProof) Route() string

"Route" - Returns module router key

func (*MsgProof) Size

func (msg *MsgProof) Size() int

func (MsgProof) String

func (msg MsgProof) String() string

func (MsgProof) ToProto

func (msg MsgProof) ToProto() MsgProtoProof

func (MsgProof) Type

func (msg MsgProof) Type() string

"Type" - Returns message name

func (*MsgProof) Unmarshal

func (msg *MsgProof) Unmarshal(data []byte) error

func (MsgProof) ValidateBasic

func (msg MsgProof) ValidateBasic() sdk.Error

"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) MarshalTo

func (m *MsgProtoProof) MarshalTo(dAtA []byte) (int, 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"`
}

"Params" - defines the governance set, high level settings for pocketcore module

func DefaultParams

func DefaultParams() Params

"DefaultParams" - Returns a default set of parameters

func (Params) Equal

func (p Params) Equal(p2 Params) bool

"Equal" - Checks the equality of two param objects

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() types.ParamSetPairs

"ParamSetPairs" - returns an kv params object Note: Implements params.ParamSet

func (Params) String

func (p Params) String() string

"String" - returns a human readable string representation of the parameters

func (Params) Validate

func (p Params) Validate() error

"Validate" - Validate a set of params

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) Bytes

func (p Payload) Bytes() []byte

"Bytes" - The bytes reprentation of a payload object

func (Payload) Hash

func (p Payload) Hash() []byte

"Hash" - The cryptographic merkleHash representation of the payload object

func (Payload) HashString

func (p Payload) HashString() string

"HashString" - The hex encoded string representation of the payload object

func (Payload) MarshalJSON

func (p Payload) MarshalJSON() ([]byte, error)

"MarshalJSON" - Overrides json marshalling

func (Payload) Validate

func (p Payload) Validate() sdk.Error

"Validate" - Validity check for the payload object

type PocketKeeper

type PocketKeeper interface {
	SessionNodeCount(ctx sdk.Ctx) (res int64)
}

type PosKeeper

type PosKeeper interface {
	RewardForRelays(ctx sdk.Ctx, 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)
}

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)                                                                                // 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) 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) Descriptor() ([]byte, []int)

func (ProofI) FromProto

func (pi ProofI) FromProto() Proof

func (*ProofI) GetChallengeProof

func (m *ProofI) GetChallengeProof() *ChallengeProofInvalidData

func (*ProofI) GetProof

func (m *ProofI) GetProof() isProofI_Proof

func (*ProofI) GetRelayProof

func (m *ProofI) GetRelayProof() *RelayProof

func (*ProofI) Marshal

func (m *ProofI) Marshal() (dAtA []byte, err error)

func (*ProofI) MarshalTo

func (m *ProofI) MarshalTo(dAtA []byte) (int, error)

func (*ProofI) MarshalToSizedBuffer

func (m *ProofI) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ProofI) ProtoMessage

func (*ProofI) ProtoMessage()

func (*ProofI) Reset

func (m *ProofI) Reset()

func (*ProofI) Size

func (m *ProofI) Size() (n int)

func (*ProofI) String

func (m *ProofI) String() string

func (*ProofI) Unmarshal

func (m *ProofI) Unmarshal(dAtA []byte) error

func (*ProofI) XXX_DiscardUnknown

func (m *ProofI) XXX_DiscardUnknown()

func (*ProofI) XXX_Marshal

func (m *ProofI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProofI) XXX_Merge

func (m *ProofI) XXX_Merge(src proto.Message)

func (*ProofI) XXX_OneofWrappers

func (*ProofI) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*ProofI) XXX_Size

func (m *ProofI) XXX_Size() int

func (*ProofI) XXX_Unmarshal

func (m *ProofI) XXX_Unmarshal(b []byte) error

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 ProofIs

type ProofIs []ProofI

func (ProofIs) FromProofI

func (ps ProofIs) FromProofI() (res Proofs)

type Proofs

type Proofs []Proof

func (Proofs) ToProofI

func (ps Proofs) ToProofI() (res []ProofI)

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) MarshalTo

func (m *ProtoEvidence) MarshalTo(dAtA []byte) (int, 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

type QueryReceiptsParams struct {
	Address sdk.Address `json:"address"`
}

"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) Bytes

func (r Range) Bytes() []byte

func (*Range) Descriptor

func (*Range) Descriptor() ([]byte, []int)

func (Range) Equal

func (r Range) Equal(r2 Range) bool

func (*Range) Marshal

func (m *Range) Marshal() (dAtA []byte, err error)

func (*Range) MarshalTo

func (m *Range) MarshalTo(dAtA []byte) (int, error)

func (*Range) MarshalToSizedBuffer

func (m *Range) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Range) ProtoMessage

func (*Range) ProtoMessage()

func (*Range) Reset

func (m *Range) Reset()

func (*Range) Size

func (m *Range) Size() (n int)

func (*Range) String

func (m *Range) String() string

func (*Range) Unmarshal

func (m *Range) Unmarshal(dAtA []byte) error

func (*Range) XXX_DiscardUnknown

func (m *Range) XXX_DiscardUnknown()

func (*Range) XXX_Marshal

func (m *Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Range) XXX_Merge

func (m *Range) XXX_Merge(src proto.Message)

func (*Range) XXX_Size

func (m *Range) XXX_Size() int

func (*Range) XXX_Unmarshal

func (m *Range) XXX_Unmarshal(b []byte) error

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 from a hosted (non native) external blockchain

func (Relay) Bytes

func (r Relay) Bytes() []byte

"Bytes" - Returns the bytes representation of the Relay

func (Relay) Execute

func (r Relay) Execute(hostedBlockchains *HostedBlockchains) (string, sdk.Error)

"Execute" - Attempts to do a request on the non-native blockchain specified

func (Relay) RequestHash

func (r Relay) RequestHash() []byte

"Requesthash" - The cryptographic merkleHash representation of the request

func (Relay) RequestHashString

func (r Relay) RequestHashString() string

"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, node sdk.Address, hb *HostedBlockchains, sessionBlockHeight int64) (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

func (RelayMeta) Validate

func (m RelayMeta) Validate(ctx sdk.Ctx) sdk.Error

"Validate" - Validates the relay meta object

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) MarshalTo

func (m *RelayProof) MarshalTo(dAtA []byte) (int, 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)

"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, sessionNodeCount int, sessionBlockHeight int64) sdk.Error

"Validate" - Validates the relay proof object

func (RelayProof) ValidateBasic

func (rp RelayProof) ValidateBasic() sdk.Error

"ValidateBasic" - Provides a lighter weight, storeless validation of the relay proof object

func (RelayProof) ValidateLocal

func (rp RelayProof) ValidateLocal(appSupportedBlockchains []string, sessionNodeCount int, sessionBlockHeight int64, verifyAddr sdk.Address) sdk.Error

"ValidateLocal" - Validates the proof object, where the owner of the proof is the local node

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) MarshalTo

func (m *RelayResponse) MarshalTo(dAtA []byte) (int, 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"`
	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)

func (*ServiceMetrics) AddErrorFor

func (sm *ServiceMetrics) AddErrorFor(networkID string)

func (*ServiceMetrics) AddRelayFor

func (sm *ServiceMetrics) AddRelayFor(networkID string)

func (*ServiceMetrics) AddRelayTimingFor

func (sm *ServiceMetrics) AddRelayTimingFor(networkID string, relayTime float64)

func (*ServiceMetrics) AddSessionFor

func (sm *ServiceMetrics) AddSessionFor(networkID string)

func (*ServiceMetrics) AddUPOKTEarnedFor

func (sm *ServiceMetrics) AddUPOKTEarnedFor(networkID string, upoktEarned float64)

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) (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) Descriptor() ([]byte, []int)

func (Session) IsSealed

func (s Session) IsSealed() bool

func (Session) Key

func (s Session) Key() ([]byte, error)

func (*Session) Marshal

func (m *Session) Marshal() (dAtA []byte, err error)

func (Session) MarshalObject

func (s Session) MarshalObject() ([]byte, error)

func (*Session) MarshalTo

func (m *Session) MarshalTo(dAtA []byte) (int, error)

func (*Session) MarshalToSizedBuffer

func (m *Session) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) Reset

func (m *Session) Reset()

func (Session) Seal

func (s Session) Seal() CacheObject

func (*Session) Size

func (m *Session) Size() (n int)

func (*Session) String

func (m *Session) String() string

func (*Session) Unmarshal

func (m *Session) Unmarshal(dAtA []byte) error

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 (m *Session) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Session) XXX_Merge

func (m *Session) XXX_Merge(src proto.Message)

func (*Session) XXX_Size

func (m *Session) XXX_Size() int

func (*Session) XXX_Unmarshal

func (m *Session) XXX_Unmarshal(b []byte) error

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) MarshalTo

func (m *SessionHeader) MarshalTo(dAtA []byte) (int, 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

type SessionIt struct {
	db.Iterator
}

"SessionIt" - An iterator value for the sessionCache structure

func SessionIterator

func SessionIterator() SessionIt

"SessionIterator" - Returns an instance iterator of the globalSessionCache

func (*SessionIt) Value

func (si *SessionIt) Value() (session Session)

"Value" - returns the value of the iterator (session)

type SessionKey

type SessionKey []byte

"SessionKey" - the merkleHash identifier of the session

func NewSessionKey

func NewSessionKey(appPubKey string, chain string, blockHash string) (SessionKey, sdk.Error)

"NewSessionKey" - generates the session key from metadata

func (SessionKey) Validate

func (sk SessionKey) Validate() sdk.Error

"Validate" - Validates the session key

type SessionNodes

type SessionNodes []sdk.Address

"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

func (SessionNodes) Contains

func (sn SessionNodes) Contains(addr sdk.Address) bool

"Contains" - Verifies if the session nodes contains the node using the address

func (SessionNodes) Validate

func (sn SessionNodes) Validate(sessionNodesCount int) sdk.Error

"Validate" - Validates the session node object

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL