embedded

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

package embedded exposes a minimal ACP module without consensus

The goal of this package is to provide a minimal implementation of the ACP module which can be used indepedent of a cosmos-sdk consensus engine. This useful for testing purposes only as it wouldn't be part of any deployment or real chain.

Example usage: ```go acp, _ := NewLocalACP() ctx := acp.GetCtx() msgServer := acp.GetMsgServer() resp, err := msgServer.CreatePolicy(ctx, ...) ... / ````

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServer

func NewMsgServer(k keeper.Keeper, cms store.CommitMultiStore) types.MsgServer

NewMsgSrever creates a message server for Embedded ACP

Types

type LocalACP

type LocalACP struct {
	// contains filtered or unexported fields
}

LocalACP wraps the acp module Keeper with a local storage. It allows clients to experiment with the ACP module without, running the consensus engine and a full node directly.

func NewLocalACP

func NewLocalACP(options ...Option) (LocalACP, error)

NewLocalACP creates an instance of LocalACP with the given options.

The default ACP configuration persists data under the user home directory and produces no logs.

func (*LocalACP) GetCtx

func (l *LocalACP) GetCtx() context.Context

GetCtx returns the a go Context which wraps a Cosmos ctx. This context MUST be used to interact with the Embedded ACP.

func (*LocalACP) GetMsgService

func (l *LocalACP) GetMsgService() types.MsgServer

GetMsgService returns an implementation of acp's MsgServer

func (*LocalACP) GetQueryService

func (l *LocalACP) GetQueryService() types.QueryServer

GetQueryService returns an implementation of acp's QueryServer

type Option

type Option func(o *option)

Option specifies the Local ACP parameters during its construction

func WithInMemStore

func WithInMemStore() Option

WithInMemStore configures Embeded ACP to use a volatile in memory store

func WithLogger

func WithLogger(logger log.Logger) Option

WithLogger configures Embedded ACP's Logger

func WithMetrics

func WithMetrics(metrics metrics.StoreMetrics) Option

WithMetrics configures the Metric collector for the Embedded ACP

func WithPersistentStorage

func WithPersistentStorage(path string) Option

WithPersistentStorage configures Embedded ACP's persistent store file system location

Jump to

Keyboard shortcuts

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