kldcontracts

package
v0.0.0-...-adeec86 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CobraInitContractGateway

func CobraInitContractGateway(cmd *cobra.Command, conf *SmartContractGatewayConf)

CobraInitContractGateway standard naming for contract gateway command params

Types

type REST2EthAsyncDispatcher

type REST2EthAsyncDispatcher interface {
	DispatchMsgAsync(ctx context.Context, msg map[string]interface{}, ack bool) (*kldmessages.AsyncSentMsg, error)
}

REST2EthAsyncDispatcher is passed in to process messages over a streaming system with a receipt store. Only used for POST methods, when kld-sync is not set to true

type RemoteRegistry

type RemoteRegistry interface {
	// contains filtered or unexported methods
}

RemoteRegistry lookup of ABI, ByteCode and DevDocs against a conformant REST API

func NewRemoteRegistry

func NewRemoteRegistry(conf *RemoteRegistryConf) RemoteRegistry

NewRemoteRegistry construtor

type RemoteRegistryConf

type RemoteRegistryConf struct {
	kldutils.HTTPRequesterConf
	CacheDB           string                      `json:"cacheDB"`
	GatewayURLPrefix  string                      `json:"gatewayURLPrefix"`
	InstanceURLPrefix string                      `json:"instanceURLPrefix"`
	PropNames         RemoteRegistryPropNamesConf `json:"propNames"`
}

RemoteRegistryConf configuration

type RemoteRegistryPropNamesConf

type RemoteRegistryPropNamesConf struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	ABI        string `json:"abi"`
	Bytecode   string `json:"bytecode"`
	Devdoc     string `json:"devdoc"`
	Deployable string `json:"deployable"`
	Address    string `json:"address"`
}

RemoteRegistryPropNamesConf configures the JSON property names to extract from the GET response on the API

type SmartContractGateway

type SmartContractGateway interface {
	PreDeploy(msg *kldmessages.DeployContract) error
	PostDeploy(msg *kldmessages.TransactionReceipt) error
	AddRoutes(router *httprouter.Router)
	SendReply(message interface{})
	Shutdown()
}

SmartContractGateway provides gateway functions for OpenAPI 2.0 processing of Solidity contracts

func NewSmartContractGateway

func NewSmartContractGateway(conf *SmartContractGatewayConf, txnConf *kldtx.TxnProcessorConf, rpc kldeth.RPCClient, processor kldtx.TxnProcessor, asyncDispatcher REST2EthAsyncDispatcher, ws kldws.WebSocketChannels) (SmartContractGateway, error)

NewSmartContractGateway constructor

type SmartContractGatewayConf

type SmartContractGatewayConf struct {
	kldevents.SubscriptionManagerConf
	StoragePath    string             `json:"storagePath"`
	BaseURL        string             `json:"baseURL"`
	RemoteRegistry RemoteRegistryConf `json:"registry,omitempty"` // JSON only config - no commandline
}

SmartContractGatewayConf configuration

Jump to

Keyboard shortcuts

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