iservice

package
v0.0.0-...-887b451 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Prefix       = "iservice"
	ChainID      = "chain_id"
	NodeRPCAddr  = "node_rpc_addr"
	NodeGRPCAddr = "node_grpc_addr"
	KeyPath      = "key_path"
	KeyName      = "key_name"
	Passphrase   = "passphrase"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ChainID      string `yaml:"chain_id"`
	NodeRPCAddr  string `yaml:"node_rpc_addr"`
	NodeGRPCAddr string `yaml:"node_grpc_addr"`
	KeyPath      string `yaml:"key_path"`
	KeyName      string `yaml:"key_name"`
	Passphrase   string `yaml:"passphrase"`
}

Config is a config struct for iservice

func NewConfig

func NewConfig(v *viper.Viper) Config

NewConfig constructs a new Config from viper

type ServiceClientWrapper

type ServiceClientWrapper struct {
	ChainID     string
	NodeRPCAddr string

	KeyPath    string
	KeyName    string
	Passphrase string

	ServiceClient servicesdk.ServiceClient
}

ServiceClientWrapper defines a wrapper for service client

func MakeServiceClientWrapper

func MakeServiceClientWrapper(config Config) ServiceClientWrapper

MakeServiceClientWrapper builds a ServiceClientWrapper from the given config

func NewServiceClientWrapper

func NewServiceClientWrapper(
	chainID string,
	nodeRPCAddr string,
	nodeGRPCAddr string,
	keyPath string,
	keyName string,
	passphrase string,
) ServiceClientWrapper

NewServiceClientWrapper constructs a new ServiceClientWrapper

func (ServiceClientWrapper) AddKey

func (s ServiceClientWrapper) AddKey(name string, passphrase string) (addr string, mnemonic string, err error)

AddKey adds a key with the specified name and passphrase

func (ServiceClientWrapper) BindService

func (s ServiceClientWrapper) BindService(
	serviceName string,
	deposit string,
	pricing string,
	options string,
	qos uint64,
) error

BindService wraps iservice.BindService

func (ServiceClientWrapper) BuildBaseTx

func (s ServiceClientWrapper) BuildBaseTx() types.BaseTx

BuildBaseTx builds a base tx

func (ServiceClientWrapper) DefineService

func (s ServiceClientWrapper) DefineService(
	serviceName string,
	description string,
	authorDescription string,
	tags []string,
	schemas string,
) error

DefineService wraps iservice.DefineService

func (ServiceClientWrapper) DeleteKey

func (s ServiceClientWrapper) DeleteKey(name string, passphrase string) error

DeleteKey deletes the specified key

func (ServiceClientWrapper) ExportKey

func (s ServiceClientWrapper) ExportKey(name string, passphrase string) (keyArmor string, err error)

ExportKey exports the given key

func (ServiceClientWrapper) ImportKey

func (s ServiceClientWrapper) ImportKey(name string, passphrase string, keyArmor string) (addr string, err error)

ImportKey imports the specified key

func (ServiceClientWrapper) RecoverKey

func (s ServiceClientWrapper) RecoverKey(name string, passphrase string, mnemonic string) (addr string, err error)

RecoverKey recover the specified key

func (ServiceClientWrapper) ShowKey

func (s ServiceClientWrapper) ShowKey(name string, passphrase string) (addr string, err error)

ShowKey queries the given key

func (ServiceClientWrapper) SubscribeServiceRequest

func (s ServiceClientWrapper) SubscribeServiceRequest(serviceName string, cb service.RespondCallback) error

SubscribeServiceRequest wraps service.SubscribeServiceRequest

Jump to

Keyboard shortcuts

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