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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
WithPersistentStorage configures Embedded ACP's persistent store file system location