ledger

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseChannel

func CloseChannel(ctx context.Context, ledgerClient ledgerPb.ChannelsClient, signedChannelState *ledgerPb.SignedChannelState) error

func CloseConnection

func CloseConnection(conn *grpc.ClientConn)

func CreateChannel

func CreateChannel(ctx context.Context, ledgerClient ledgerPb.ChannelsClient, channelCommit *ledgerPb.ChannelCommit, sig []byte) (*ledgerPb.ChannelID, error)

func ImportAccount

func ImportAccount(ctx context.Context, pubKey ic.PubKey, ledgerClient ledgerPb.ChannelsClient) (*ledgerPb.Account, error)

func ImportSignedAccount

func ImportSignedAccount(ctx context.Context, privKey ic.PrivKey, pubKey ic.PubKey, ledgerClient ledgerPb.ChannelsClient) (*ledgerPb.SignedCreateAccountResult, error)

func LedgerConnection

func LedgerConnection(ledgerAddr, certFile string) (*grpc.ClientConn, error)

func NewAccount

func NewAccount(pubKey ic.PubKey, amount int64) (*ledgerPb.Account, error)

func NewChannelCommit

func NewChannelCommit(fromKey ic.PubKey, toKey ic.PubKey, amount int64) (*ledgerPb.ChannelCommit, error)

func NewChannelState

func NewChannelState(id *ledgerPb.ChannelID, sequence int64, fromAccount *ledgerPb.Account, toAccount *ledgerPb.Account) *ledgerPb.ChannelState

func NewClient

func NewClient(conn *grpc.ClientConn) ledgerPb.ChannelsClient

func NewSignedChannelState

func NewSignedChannelState(channelState *ledgerPb.ChannelState, fromSig []byte, toSig []byte) *ledgerPb.SignedChannelState

func Sign

func Sign(key ic.PrivKey, channelMessage proto.Message) ([]byte, error)

func Verify

func Verify(key ic.PubKey, channelMessage proto.Message, sig []byte) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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