Documentation
¶
Overview ¶
anything related to accounts like signing, wallets, and serialization used by config, server, and sdk
Index ¶
- Constants
- func BytesToHex(bytes []byte) string
- func CORS() echo.MiddlewareFunc
- func CreateAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, ...) string
- func CreateDealAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, ...) string
- func CreateDeterministicCreateRewardData(createReward *corev1.CreateReward) string
- func CreateDeterministicDeleteRewardData(deleteReward *corev1.DeleteReward) string
- func CreateDirIfNotExist(dir string) error
- func CreateERNAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, ...) string
- func CreatePartyAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, ...) string
- func CreateReleaseAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, ...) string
- func CreateResourceAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, ...) string
- func Deobfuscate(s string) (string, error)
- func EthRecover(signatureStr string, data []byte) (*ecdsa.PublicKey, string, error)
- func EthSign(pkey *ecdsa.PrivateKey, data []byte) (string, error)
- func EthToCometKey(privateKey *ecdsa.PrivateKey) (*ed25519.PrivKey, error)
- func EthToEthKey(privKey string) (*ecdsa.PrivateKey, error)
- func FileExists(filePath string) bool
- func GeneratePlaySignature(privKey *ecdsa.PrivateKey, data *storagev1.StreamTrackSignatureData) (signatureHex string, dataHash []byte, err error)
- func GetAttestorRendezvous(validatorAddresses []string, key []byte, size int) map[string]bool
- func GetClientIP(ctx context.Context) string
- func HexToBytes(addr string) ([]byte, error)
- func HexToUtf8(hex [32]byte) string
- func InjectRealIP() echo.MiddlewareFunc
- func IsProgrammableDistributionEnabled(env string) bool
- func LoadPrivateKey(path string) (*ecdsa.PrivateKey, error)
- func Obfuscate(s string) string
- func PrivKeyToAddress(privateKey *ecdsa.PrivateKey) string
- func ProtoRecover(msg proto.Message, signature string) (string, error)
- func ProtoSign(pkey *ecdsa.PrivateKey, msg proto.Message) (string, error)
- func RecoverPlaySignature(signatureHex string, data *storagev1.StreamTrackSignatureData) (pubKey *ecdsa.PublicKey, ethAddress string, err error)
- func SerializePublicKeyHex(pubKey *ecdsa.PublicKey) string
- func SignCreateReward(privateKey *ecdsa.PrivateKey, createReward *corev1.CreateReward) (string, error)
- func SignDeleteReward(privateKey *ecdsa.PrivateKey, deleteReward *corev1.DeleteReward) (string, error)
- func TxHashRecover(txHash, signature string) (*ecdsa.PublicKey, string, error)
- func TxHashSign(pkey *ecdsa.PrivateKey, txHash string) (string, error)
- func Utf8ToHex(s string) [32]byte
- type Logger
- func (l *Logger) Child(serviceName string) *Logger
- func (l *Logger) Debug(msg string, keyvals ...interface{})
- func (l *Logger) Debugf(msg string, keyvals ...interface{})
- func (l *Logger) Error(msg string, keyvals ...interface{})
- func (l *Logger) Errorf(msg string, keyvals ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Info(msg string, keyvals ...interface{})
- func (l *Logger) Infof(msg string, keyvals ...interface{})
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Warn(msg string, keyvals ...interface{})
- func (l *Logger) Warningf(msg string, keyvals ...interface{})
- func (l *Logger) With(keyvals ...interface{}) log.Logger
- type NodeTuple
- type NodeTuples
- type TxHash
Constants ¶
const ClientIPKey contextKey = "client-ip"
const OAPNamespace = "OAP"
Variables ¶
This section is empty.
Functions ¶
func BytesToHex ¶
func CreateAddress ¶
func CreateAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, discriminator string) string
CreateAddress deterministically generates a content address from a txhash and txindex. The returned address is the last 20 bytes of keccak256 hash, Ethereum-style. Using txhash instead of protobuf marshaling ensures stability across schema evolution. The txindex ensures uniqueness even if identical messages are submitted in the same block. The discriminator parameter can be used to create different addresses for sub-objects within the same transaction (e.g., "party:0", "resource:1", etc.)
func CreateDealAddress ¶
func CreateDealAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, dealReference string) string
CreateDealAddress creates a deterministic address for a Deal entity
func CreateDeterministicCreateRewardData ¶
func CreateDeterministicCreateRewardData(createReward *corev1.CreateReward) string
CreateDeterministicCreateRewardData creates deterministic hex data for signing CreateReward
func CreateDeterministicDeleteRewardData ¶
func CreateDeterministicDeleteRewardData(deleteReward *corev1.DeleteReward) string
CreateDeterministicDeleteRewardData creates deterministic hex data for signing DeleteReward
func CreateDirIfNotExist ¶
func CreateERNAddress ¶
func CreateERNAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, messageID string) string
CreateERNAddress creates a deterministic address for an ERN entity
func CreatePartyAddress ¶
func CreatePartyAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, partyReference string) string
CreatePartyAddress creates a deterministic address for a Party entity
func CreateReleaseAddress ¶
func CreateReleaseAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, releaseReference string) string
CreateReleaseAddress creates a deterministic address for a Release entity
func CreateResourceAddress ¶
func CreateResourceAddress(txhash []byte, chainId string, blockHeight int64, txindex int64, resourceReference string) string
CreateResourceAddress creates a deterministic address for a Resource entity
func Deobfuscate ¶
func EthRecover ¶
func EthToCometKey ¶
func EthToCometKey(privateKey *ecdsa.PrivateKey) (*ed25519.PrivKey, error)
func EthToEthKey ¶
func EthToEthKey(privKey string) (*ecdsa.PrivateKey, error)
func FileExists ¶
func GeneratePlaySignature ¶
func GeneratePlaySignature(privKey *ecdsa.PrivateKey, data *storagev1.StreamTrackSignatureData) (signatureHex string, dataHash []byte, err error)
func GetAttestorRendezvous ¶
Returns the first `size` number of addresses from a list of all validators sorted by a hashing function. The hashing is seeded according to the given key.
func GetClientIP ¶
func HexToBytes ¶
func InjectRealIP ¶
func InjectRealIP() echo.MiddlewareFunc
func LoadPrivateKey ¶
func LoadPrivateKey(path string) (*ecdsa.PrivateKey, error)
func PrivKeyToAddress ¶
func PrivKeyToAddress(privateKey *ecdsa.PrivateKey) string
func ProtoRecover ¶
ProtoTxRecover recovers the signer address from a protobuf message and signature WARNING: This should only be used when verifying transactions and not replaying them as it's not safe from protobuf evolution. The message structure could change between versions, making signatures invalid.
func ProtoSign ¶
ProtoTxSign signs a protobuf message for transaction purposes WARNING: This should only be used when sending transactions and not replaying them as it's not safe from protobuf evolution. The message structure could change between versions, making signatures invalid.
func RecoverPlaySignature ¶
func SerializePublicKeyHex ¶
func SignCreateReward ¶
func SignCreateReward(privateKey *ecdsa.PrivateKey, createReward *corev1.CreateReward) (string, error)
SignCreateReward signs a CreateReward message using deterministic data
func SignDeleteReward ¶
func SignDeleteReward(privateKey *ecdsa.PrivateKey, deleteReward *corev1.DeleteReward) (string, error)
SignDeleteReward signs a DeleteReward message using deterministic data
func TxHashRecover ¶
TxHashRecover recovers the signer address from a transaction hash and signature
func TxHashSign ¶
func TxHashSign(pkey *ecdsa.PrivateKey, txHash string) (string, error)
TxHashSign signs a transaction hash with the given private key Validates that txHash is a proper hex-encoded hash
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
func NewLogger(opts *slog.HandlerOptions) *Logger
type NodeTuples ¶
type NodeTuples []NodeTuple
func (NodeTuples) Len ¶
func (s NodeTuples) Len() int
func (NodeTuples) Less ¶
func (s NodeTuples) Less(i, j int) bool
func (NodeTuples) Swap ¶
func (s NodeTuples) Swap(i, j int)