Documentation ¶
Index ¶
- func MemoryDatabase(_ string, _ int, logger log.Logger) database.Beginner
- func SimpleNetwork(name string, bvnCount, nodeCount int) *accumulated.NetworkInit
- type Node
- type OpenDatabaseFunc
- type Partition
- type Router
- func (r *Router) RequestAPIv2(ctx context.Context, partition, method string, params, result interface{}) error
- func (r *Router) Route(envs ...*protocol.Envelope) (string, error)
- func (r *Router) RouteAccount(account *url.URL) (string, error)
- func (r *Router) SetRoute(account *url.URL, partition string)
- func (r *Router) Submit(ctx context.Context, partition string, envelope *protocol.Envelope, ...) (*routing.ResponseSubmit, error)
- type Simulator
- func (s *Simulator) Database(partition string) database.Updater
- func (s *Simulator) DatabaseFor(account *url.URL) database.Updater
- func (s *Simulator) ListenAndServe(hook func(*Simulator, http.Handler) http.Handler) error
- func (s *Simulator) Partitions() []*protocol.PartitionInfo
- func (s *Simulator) SetRoute(account *url.URL, partition string)
- func (s *Simulator) SetSubmitHook(partition string, fn SubmitHookFunc)
- func (s *Simulator) Step() error
- func (s *Simulator) Submit(delivery *chain.Delivery) (*protocol.TransactionStatus, error)
- func (s *Simulator) ViewAll(fn func(batch *database.Batch) error) error
- type SnapshotFunc
- type SubmitHookFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SimpleNetwork ¶
func SimpleNetwork(name string, bvnCount, nodeCount int) *accumulated.NetworkInit
Types ¶
type OpenDatabaseFunc ¶
func BadgerDatabaseFromDirectory ¶
func BadgerDatabaseFromDirectory(dir string, onErr func(error)) OpenDatabaseFunc
type Partition ¶
type Partition struct { protocol.PartitionInfo // contains filtered or unexported fields }
func (*Partition) SetSubmitHook ¶
func (p *Partition) SetSubmitHook(fn SubmitHookFunc)
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) RequestAPIv2 ¶
type Simulator ¶
type Simulator struct {
// contains filtered or unexported fields
}
func New ¶
func New(logger log.Logger, database OpenDatabaseFunc, network *accumulated.NetworkInit, snapshot SnapshotFunc) (*Simulator, error)
func (*Simulator) ListenAndServe ¶
func (*Simulator) Partitions ¶
func (s *Simulator) Partitions() []*protocol.PartitionInfo
func (*Simulator) SetSubmitHook ¶
func (s *Simulator) SetSubmitHook(partition string, fn SubmitHookFunc)
type SnapshotFunc ¶
type SnapshotFunc func(partition string, network *accumulated.NetworkInit, logger log.Logger) (ioutil2.SectionReader, error)
func Genesis ¶
func Genesis(time time.Time) SnapshotFunc
func GenesisWith ¶
func GenesisWith(time time.Time, values *core.GlobalValues) SnapshotFunc
func SnapshotFromDirectory ¶
func SnapshotFromDirectory(dir string) SnapshotFunc
type SubmitHookFunc ¶
Click to show internal directories.
Click to hide internal directories.