Documentation ¶
Index ¶
- func NewKeyPair(private string) (ed25519.PrivateKey, ed25519.PublicKey, error)
- func PEMToPrivateKey(raw []byte, pwd []byte) (interface{}, error)
- type InvokeResponse
- type Key
- type Option
- type User
- func (u *User) AddUser() error
- func (u *User) Addr() string
- func (u *User) AddrFromKey(key ed25519.PublicKey) string
- func (u *User) BalanceShouldBe(expected uint64) error
- func (u *User) Base58Pk() string
- func (u *User) ChangeKeys(secretKey ed25519.PrivateKey, publicKey ed25519.PublicKey)
- func (u *User) Invoke(ch, cc, fn string, args ...string) (*InvokeResponse, error)
- func (u *User) InvokeWithListener(ch, cc, fn string, args ...string) (*InvokeResponse, error)
- func (u *User) Query(ch, cc, fn string, args ...string) ([]byte, error)
- func (u *User) SendBatch(ch, cc string, batch *proto.Batch) (*fab.TxStatusEvent, *proto.BatchResponse, error)
- func (u *User) Sign(msg []byte) []byte
- func (u *User) SignedInvoke(nonce *int64, ch, cc, fn string, args ...string) (*InvokeResponse, error)
- func (u *User) SignedInvokeAsync(ch, cc, fn string, args ...string) (*InvokeResponse, error)
- func (u *User) SwapAnswerAndDone(ch, cc, swapId string, swapKey string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewKeyPair ¶
NewKeyPair is a constructor for key pair
func PEMToPrivateKey ¶
PEMToPrivateKey converts a PEM encoded private key to a PrivateKey
Types ¶
type InvokeResponse ¶
type InvokeResponse struct { Event *fab.TxStatusEvent Response []byte }
InvokeResponse is a response from invoke
type Key ¶
type Key struct { PrivKey ed25519.PrivateKey PubKey ed25519.PublicKey }
Key is a core.Key wrapper for *ecdsa.PublicKey
func (*Key) PublicKey ¶
PublicKey returns the corresponding public key part of an asymmetric public/private key pair.
type User ¶
type User struct { // ID is a user ID for invoke ID string // PublicKey is a public key for invoke PublicKey ed25519.PublicKey // SecretKey is a secret key for invoke SecretKey ed25519.PrivateKey // contains filtered or unexported fields }
User is a user for invoke
func NewUser ¶
func NewUser(msp, backendCert, backendKey, connection, id, privateKey string, opts ...Option) (*User, error)
NewUser is a constructor for user
func (*User) AddrFromKey ¶
AddrFromKey is a method for getting address from key
func (*User) BalanceShouldBe ¶
BalanceShouldBe is a method for balance should be check
func (*User) ChangeKeys ¶
func (u *User) ChangeKeys(secretKey ed25519.PrivateKey, publicKey ed25519.PublicKey)
ChangeKeys is a method for changing keys
func (*User) Invoke ¶
func (u *User) Invoke(ch, cc, fn string, args ...string) (*InvokeResponse, error)
Invoke is a method for invoke
func (*User) InvokeWithListener ¶
func (u *User) InvokeWithListener(ch, cc, fn string, args ...string) (*InvokeResponse, error)
InvokeWithListener is a method for invoke with listener
func (*User) SendBatch ¶
func (u *User) SendBatch(ch, cc string, batch *proto.Batch) (*fab.TxStatusEvent, *proto.BatchResponse, error)
SendBatch is a method for send batch of transactions
func (*User) SignedInvoke ¶
func (u *User) SignedInvoke(nonce *int64, ch, cc, fn string, args ...string) (*InvokeResponse, error)
SignedInvoke is a method for signed invoke
func (*User) SignedInvokeAsync ¶
func (u *User) SignedInvokeAsync(ch, cc, fn string, args ...string) (*InvokeResponse, error)
SignedInvokeAsync is a method for signed invoke async