client

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Methods and types for client and wallet operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientID

func GetClientID() string

GetClientID returns client id

func GetClientPeerPublicKey added in v1.17.0

func GetClientPeerPublicKey() string

func GetClientPrivateKey added in v1.8.11

func GetClientPrivateKey() string

GetClientPrivateKey returns client private key

func GetClientPublicKey

func GetClientPublicKey() string

GetClientPublicKey returns client public key

func GetClientSysKeys added in v1.7.6

func GetClientSysKeys() []sys.KeyPair

GetClientSysKeys convert client.KeyPair to sys.KeyPair

func PopulateClient

func PopulateClient(clientjson string, signatureScheme string) error

PopulateClient populates single client

  • clientjson: client json string
  • signatureScheme: signature scheme

func PopulateClients added in v1.4.7

func PopulateClients(clientJsons []string, signatureScheme string) error

PopulateClients This is a workaround for blobber tests that requires multiple clients to test authticket functionality

  • clientJsons: array of client json strings
  • signatureScheme: signature scheme

func SetClient added in v1.17.0

func SetClient(w *zcncrypto.Wallet, signatureScheme string, txnFee uint64)

func SetClientNonce added in v1.8.3

func SetClientNonce(nonce int64)

SetClientNonce sets client nonce

func SetTxnFee added in v1.8.16

func SetTxnFee(fee uint64)

SetTxnFee sets general transaction fee

func TxnFee added in v1.8.16

func TxnFee() uint64

TxnFee gets general txn fee

func VerifySignature

func VerifySignature(signature string, msg string) (bool, error)

VerifySignature verifies signature of a message with client public key and signature scheme

  • signature: signature to use for verification
  • msg: message to verify

func VerifySignatureWith added in v1.8.16

func VerifySignatureWith(pubKey, signature, hash string) (bool, error)

VerifySignatureWith verifies signature of a message with a given public key, and the client's signature scheme

  • pubKey: public key to use for verification
  • signature: signature to use for verification
  • hash: message to verify

Types

type Client

type Client struct {
	*zcncrypto.Wallet
	SignatureScheme string
	// contains filtered or unexported fields
}

Client represents client information

func GetClient

func GetClient() *Client

GetClient returns client instance

func GetClients added in v1.4.7

func GetClients() []*Client

GetClients returns all clients

type SignFunc added in v1.3.5

type SignFunc func(hash string) (string, error)
var (

	// Sign is a function to sign a hash
	Sign SignFunc
)

Jump to

Keyboard shortcuts

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