intkey

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package intkey provides an alternative intkey client implementation using sawtooth-client-sdk-go.

Index

Constants

View Source
const (
	// Family info
	FAMILY_NAME    = "intkey"
	FAMILY_VERSION = "1.0"

	// Verbs
	VERB_SET string = "set"
	VERB_INC string = "inc"
	VERB_DEC string = "dec"

	// Integer literals
	FAMILY_NAMESPACE_ADDRESS_LENGTH uint = 6
	FAMILY_VERB_ADDRESS_LENGTH      uint = 64
)

Variables

This section is empty.

Functions

func GetAddress

func GetAddress(name string) string

GetAddress returns the address of a particular intkey key.

func GetAddressPrefix

func GetAddressPrefix() string

GetAddressPrefix returns the intkey address prefix.

Types

type IntkeyClient

type IntkeyClient struct {
	*sawtooth_client_sdk_go.SawtoothClient
}

IntKeyClient is the client library for intkey.

func NewIntkeyClient

func NewIntkeyClient(url string, keyFile string) (*IntkeyClient, error)

NewIntkeyClient returns a new instance of IntkeyClient.

func NewIntkeyClientZmq

func NewIntkeyClientZmq(url string, keyFile string) (*IntkeyClient, error)

NewIntkeyClient returns a new instance of IntkeyClient that uses the ZMQ transport.

func (*IntkeyClient) Dec

func (self *IntkeyClient) Dec(name string, value uint, wait uint) (string, error)

Dec decrements a key's current value by the given parameter.

func (*IntkeyClient) Inc

func (self *IntkeyClient) Inc(name string, value uint, wait uint) (string, error)

Inc increments a key's current value by the given parameter.

func (*IntkeyClient) List

func (self *IntkeyClient) List() (map[string]uint, error)

List returns the current mapping of keys to values.

func (*IntkeyClient) Set

func (self *IntkeyClient) Set(name string, value uint, wait uint) (string, error)

Set creates a new key -> value mapping.

func (*IntkeyClient) Show

func (self *IntkeyClient) Show(name string) (uint, error)

Show returns the current value of a particular key.

func (*IntkeyClient) Status

func (self *IntkeyClient) Status(batchId string) (string, error)

Status returns the status of a given batch.

type IntkeyClientImpl

type IntkeyClientImpl struct{}

IntkeyClientImpl is the type that implements the required SawtoothClientImpl interface.

func (*IntkeyClientImpl) DecodeData

func (self *IntkeyClientImpl) DecodeData(bytes []byte, ptr interface{}) error

EncodePayDecodeDataload unmarshals a data item from bytes (in this case, using CBOR).

func (*IntkeyClientImpl) DecodePayload

func (self *IntkeyClientImpl) DecodePayload(bytes []byte, ptr interface{}) error

EncodePayload unmarshals a payload from bytes (in this case, using CBOR).

func (*IntkeyClientImpl) EncodeData

func (self *IntkeyClientImpl) EncodeData(data interface{}) ([]byte, error)

EncodeData marshals a data item into bytes (in this case, using CBOR).

func (*IntkeyClientImpl) EncodePayload

func (self *IntkeyClientImpl) EncodePayload(payload interface{}) ([]byte, error)

EncodePayload marshals a payload into bytes (in this case, using CBOR).

func (*IntkeyClientImpl) GetFamilyName

func (self *IntkeyClientImpl) GetFamilyName() string

GetFamilyName returns the family name.

func (*IntkeyClientImpl) GetFamilyVersion

func (self *IntkeyClientImpl) GetFamilyVersion() string

GetFamilyVersion returns the family version.

func (*IntkeyClientImpl) GetPayloadInputAddresses

func (self *IntkeyClientImpl) GetPayloadInputAddresses(payload interface{}) []string

GetPayloadInputAddresses returns the addresses of any state that the given payload is expected to access during processing.

func (*IntkeyClientImpl) GetPayloadOutputAddresses

func (self *IntkeyClientImpl) GetPayloadOutputAddresses(payload interface{}) []string

GetPayloadOutputAddresses returns the addresses of any state that the given payload is expected to modify during processing.

type IntkeyPayload

type IntkeyPayload struct {
	Verb  string
	Name  string
	Value uint
}

IntkeyPayload represents a payload meant for the intkey transaction processor.

Directories

Path Synopsis
intkey_cli is an alternative cli implementation for intkey that uses the example client implemented with sawtooth-client-sdk-go.
intkey_cli is an alternative cli implementation for intkey that uses the example client implemented with sawtooth-client-sdk-go.

Jump to

Keyboard shortcuts

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