package
3.1.8+incompatible
Repository: https://github.com/semyon-dev/snet-daemon.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
GetBigInt gets big.Int value from gRPC metadata.
GetBytes gets bytes array value from gRPC metadata for key with '-bin' suffix, internally this data is encoded as base64.
GetBytesFromHex gets bytes array value from gRPC metadata, bytes array is encoded as hex string.
GetSingleValue gets string value from gRPC metadata.
No description provided by the author
GrpcStreamInterceptor returns gRPC interceptor to validate payment.
No description provided by the author
NewGrpcError returns new error which contains gRPC status with provided code and message.
NewGrpcErrorf returns new error which contains gRPC status with provided code and message formed from format string and args.
No description provided by the author
NoOpInterceptor is a gRPC interceptor which doesn't do payment checking.
# Constants
This metadata will be used ONLY when block chain is disabled and allowed user flag is enabled.
Client that calls the Daemon ( example can be "snet-cli","snet-dapp","snet-sdk").
Will be used to check if the Signature is still valid.
Block number on when the Token was issued , to track the expiry of the token , which is ~ 1 Month.
Place holder to set the free call Auth Token issued.
The user Id of the person making the call.
IncorrectNonce is returned to client when payment recieved contains incorrect nonce value.
PaymentChannelAmountHeader is an amount of payment channel value which server is authorized to withdraw after handling the RPC call.
PaymentChannelIDHeader is a MultiPartyEscrow contract payment channel id.
PaymentChannelNonceHeader is a payment channel nonce value.
PaymentChannelSignatureHeader is a signature of the client to confirm amount withdrawing authorization.
This is useful information in the header sent in by the client All clients will have this information and they need this to Sign anyways When Daemon is running in the block chain disabled mode , it would use this header to get the MPE address.
PaymentTypeHeader is a type of payment used to pay for a RPC call.
User Agent details set in on the server stream info.
Value is a user address , example "0x94d04332C4f5273feF69c4a52D24f42a3aF1F207".
# Structs
GrpcError is an error which will be returned by interceptor via gRPC protocol.
GrpcStreamContext contains information about gRPC call which is used to validate payment and pricing.
# Interfaces
Payment represents payment handler specific data which is validated and used to complete payment.
PaymentHandler interface which is used by gRPC interceptor to get, validate and complete payment.