tmstore

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package tmstore implements a store that saves all the segments in a tendermint app

Index

Constants

View Source
const (
	// Name is the name set in the store's information.
	Name = "tm"

	// Description is the description set in the store's information.
	Description = "Indigo's Tendermint Store"

	// DefaultEndpoint is the default Tendermint endpoint.
	DefaultEndpoint = "tcp://127.0.0.1:46657"

	// DefaultWsRetryInterval is the default interval between Tendermint Websocket connection attempts.
	DefaultWsRetryInterval = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// A version string that will be set in the store's information.
	Version string

	// A git commit hash that will be set in the store's information.
	Commit string
}

Config contains configuration options for the store.

type Info

type Info struct {
	Name        string      `json:"name"`
	Description string      `json:"description"`
	TMAppInfo   interface{} `json:"tmAppDescription"`
	Version     string      `json:"version"`
	Commit      string      `json:"commit"`
}

Info is the info returned by GetInfo.

type TMStore

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

TMStore is the type that implements github.com/stratumn/sdk/store.Adapter.

func New

func New(config *Config, tmClient client.Client) *TMStore

New creates a new instance of a TMStore.

func (*TMStore) AddEvidence added in v0.2.0

func (t *TMStore) AddEvidence(linkHash *types.Bytes32, evidence *cs.Evidence) error

AddEvidence implements github.com/stratumn/sdk/store.EvidenceWriter.AddEvidence.

func (*TMStore) AddStoreEventChannel added in v0.2.0

func (t *TMStore) AddStoreEventChannel(storeChan chan *store.Event)

AddStoreEventChannel implements github.com/stratumn/sdk/store.Adapter.AddStoreEventChannel.

func (t *TMStore) CreateLink(link *cs.Link) (*types.Bytes32, error)

CreateLink implements github.com/stratumn/sdk/store.LinkWriter.CreateLink.

func (*TMStore) FindSegments

func (t *TMStore) FindSegments(filter *store.SegmentFilter) (segmentSlice cs.SegmentSlice, err error)

FindSegments implements github.com/stratumn/sdk/store.SegmentReader.FindSegments.

func (*TMStore) GetEvidences added in v0.2.0

func (t *TMStore) GetEvidences(linkHash *types.Bytes32) (evidences *cs.Evidences, err error)

GetEvidences implements github.com/stratumn/sdk/store.EvidenceReader.GetEvidences.

func (*TMStore) GetInfo

func (t *TMStore) GetInfo() (interface{}, error)

GetInfo implements github.com/stratumn/sdk/store.Adapter.GetInfo.

func (*TMStore) GetMapIDs

func (t *TMStore) GetMapIDs(filter *store.MapFilter) (ids []string, err error)

GetMapIDs implements github.com/stratumn/sdk/store.SegmentReader.GetMapIDs.

func (*TMStore) GetSegment

func (t *TMStore) GetSegment(linkHash *types.Bytes32) (segment *cs.Segment, err error)

GetSegment implements github.com/stratumn/sdk/store.SegmentReader.GetSegment.

func (*TMStore) NewBatch

func (t *TMStore) NewBatch() (store.Batch, error)

NewBatch implements github.com/stratumn/sdk/store.Adapter.NewBatch.

func (*TMStore) RetryStartWebsocket

func (t *TMStore) RetryStartWebsocket(interval time.Duration) error

RetryStartWebsocket starts the websocket client and retries on errors.

func (*TMStore) StartWebsocket

func (t *TMStore) StartWebsocket() error

StartWebsocket starts the websocket client and wait for New Block events.

func (*TMStore) StopWebsocket

func (t *TMStore) StopWebsocket() error

StopWebsocket stops the websocket client.

Jump to

Keyboard shortcuts

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