Documentation ¶
Overview ¶
Package tmstore implements a store that saves all the segments in a tendermint app
Index ¶
- Constants
- type Batch
- type Config
- type Info
- type TMStore
- func (t *TMStore) AddDidSaveChannel(saveChan chan *cs.Segment)
- func (t *TMStore) DeleteSegment(linkHash *types.Bytes32) (segment *cs.Segment, err error)
- func (t *TMStore) DeleteValue(key []byte) (value []byte, err error)
- func (t *TMStore) FindSegments(filter *store.SegmentFilter) (segmentSlice cs.SegmentSlice, err error)
- func (t *TMStore) GetInfo() (interface{}, error)
- func (t *TMStore) GetMapIDs(filter *store.MapFilter) (ids []string, err error)
- func (t *TMStore) GetSegment(linkHash *types.Bytes32) (segment *cs.Segment, err error)
- func (t *TMStore) GetValue(key []byte) (value []byte, err error)
- func (t *TMStore) NewBatch() (store.Batch, error)
- func (t *TMStore) RetryStartWebsocket(interval time.Duration) error
- func (t *TMStore) SaveSegment(segment *cs.Segment) error
- func (t *TMStore) SaveValue(key, value []byte) error
- func (t *TMStore) StartWebsocket() error
- func (t *TMStore) StopWebsocket()
Constants ¶
const ( // Name is the name set in the store's information. Name = "tm" // Description is the description set in the store's information. Description = "Stratumn TM Store" // DefaultEndpoint is the default Tendermint endpoint. DefaultEndpoint = "tcp://127.0.0.1:46657" // DefaultWsRetryInterval is the default interval between Tendermint Wbesocket connection tries. DefaultWsRetryInterval = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct { *store.BufferedBatch // contains filtered or unexported fields }
Batch is the type that implements github.com/stratumn/sdk/store.Batch.
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 // Endoint used to communicate with Tendermint core Endpoint 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 NewFromClient ¶
NewFromClient creates a new instance of a TMStore with the given client.
func (*TMStore) AddDidSaveChannel ¶
AddDidSaveChannel implements github.com/stratumn/sdk/fossilizer.Store.AddDidSaveChannel.
func (*TMStore) DeleteSegment ¶
DeleteSegment implements github.com/stratumn/sdk/store.Adapter.DeleteSegment.
func (*TMStore) DeleteValue ¶
DeleteValue implements github.com/stratumn/sdk/store.Adapter.DeleteValue.
func (*TMStore) FindSegments ¶
func (t *TMStore) FindSegments(filter *store.SegmentFilter) (segmentSlice cs.SegmentSlice, err error)
FindSegments implements github.com/stratumn/sdk/store.Adapter.FindSegments.
func (*TMStore) GetSegment ¶
GetSegment implements github.com/stratumn/sdk/store.Adapter.GetSegment.
func (*TMStore) RetryStartWebsocket ¶
RetryStartWebsocket starts the websocket client and wait for New Block events, it retries on errors.
func (*TMStore) SaveSegment ¶
SaveSegment implements github.com/stratumn/sdk/store.Adapter.SaveSegment.
func (*TMStore) StartWebsocket ¶
StartWebsocket starts the websocket client and wait for New Block events.
func (*TMStore) StopWebsocket ¶
func (t *TMStore) StopWebsocket()
StopWebsocket stops the websocket client.