dump

package
v0.34.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: Apache-2.0 Imports: 27 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthDump        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDump          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDump = fmt.Errorf("proto: unexpected end of group")
)

Functions

func Load added in v0.26.1

func Load(source Source, st *state.State) error

Load a dump into state. We store all the events from the source chain in a single zeroth block with all the events at each height in their own pseudo transaction.

func Write added in v0.26.1

func Write(out io.Writer, source Source, useBinaryEncoding bool, options Option) error

Write a dump to the Writer out by pulling rows from stream

Types

type AccountStorage

type AccountStorage struct {
	Address              github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,1,opt,name=Address,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Address"`
	Storage              []*Storage                                   `protobuf:"bytes,2,rep,name=Storage,proto3" json:"Storage,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                     `json:"-"`
	XXX_unrecognized     []byte                                       `json:"-"`
	XXX_sizecache        int32                                        `json:"-"`
}

func (*AccountStorage) Descriptor

func (*AccountStorage) Descriptor() ([]byte, []int)

func (*AccountStorage) GetStorage

func (m *AccountStorage) GetStorage() []*Storage

func (*AccountStorage) Marshal

func (m *AccountStorage) Marshal() (dAtA []byte, err error)

func (*AccountStorage) MarshalTo

func (m *AccountStorage) MarshalTo(dAtA []byte) (int, error)

func (*AccountStorage) MarshalToSizedBuffer added in v0.30.0

func (m *AccountStorage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AccountStorage) ProtoMessage

func (*AccountStorage) ProtoMessage()

func (*AccountStorage) Reset

func (m *AccountStorage) Reset()

func (*AccountStorage) Size

func (m *AccountStorage) Size() (n int)

func (*AccountStorage) String

func (m *AccountStorage) String() string

func (*AccountStorage) Unmarshal

func (m *AccountStorage) Unmarshal(dAtA []byte) error

func (*AccountStorage) XXX_DiscardUnknown

func (m *AccountStorage) XXX_DiscardUnknown()

func (*AccountStorage) XXX_Marshal

func (m *AccountStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AccountStorage) XXX_Merge

func (m *AccountStorage) XXX_Merge(src proto.Message)

func (*AccountStorage) XXX_MessageName

func (*AccountStorage) XXX_MessageName() string

func (*AccountStorage) XXX_Size

func (m *AccountStorage) XXX_Size() int

func (*AccountStorage) XXX_Unmarshal

func (m *AccountStorage) XXX_Unmarshal(b []byte) error

type Blockchain added in v0.28.0

type Blockchain interface {
	ChainID() string
	LastBlockHeight() uint64
}

type CollectSink added in v0.28.0

type CollectSink struct {
	Rows    []string
	Current int
}

func (*CollectSink) Recv added in v0.28.0

func (c *CollectSink) Recv() (d *Dump, err error)

func (*CollectSink) Send added in v0.28.0

func (c *CollectSink) Send(d *Dump) error

type Dump

type Dump struct {
	Height               uint64          `protobuf:"varint,1,opt,name=Height,proto3" json:"Height,omitempty"`
	Account              *acm.Account    `protobuf:"bytes,2,opt,name=Account,proto3" json:"Account,omitempty"`
	AccountStorage       *AccountStorage `protobuf:"bytes,3,opt,name=AccountStorage,proto3" json:"AccountStorage,omitempty"`
	EVMEvent             *EVMEvent       `protobuf:"bytes,4,opt,name=EVMEvent,proto3" json:"EVMEvent,omitempty"`
	Name                 *names.Entry    `protobuf:"bytes,5,opt,name=Name,proto3" json:"Name,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*Dump) Descriptor

func (*Dump) Descriptor() ([]byte, []int)

func (*Dump) GetAccount

func (m *Dump) GetAccount() *acm.Account

func (*Dump) GetAccountStorage

func (m *Dump) GetAccountStorage() *AccountStorage

func (*Dump) GetEVMEvent

func (m *Dump) GetEVMEvent() *EVMEvent

func (*Dump) GetHeight

func (m *Dump) GetHeight() uint64

func (*Dump) GetName

func (m *Dump) GetName() *names.Entry

func (*Dump) Marshal

func (m *Dump) Marshal() (dAtA []byte, err error)

func (*Dump) MarshalTo

func (m *Dump) MarshalTo(dAtA []byte) (int, error)

func (*Dump) MarshalToSizedBuffer added in v0.30.0

func (m *Dump) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Dump) ProtoMessage

func (*Dump) ProtoMessage()

func (*Dump) Reset

func (m *Dump) Reset()

func (*Dump) Size

func (m *Dump) Size() (n int)

func (*Dump) String

func (m *Dump) String() string

func (*Dump) Unmarshal

func (m *Dump) Unmarshal(dAtA []byte) error

func (*Dump) XXX_DiscardUnknown

func (m *Dump) XXX_DiscardUnknown()

func (*Dump) XXX_Marshal

func (m *Dump) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Dump) XXX_Merge

func (m *Dump) XXX_Merge(src proto.Message)

func (*Dump) XXX_MessageName

func (*Dump) XXX_MessageName() string

func (*Dump) XXX_Size

func (m *Dump) XXX_Size() int

func (*Dump) XXX_Unmarshal

func (m *Dump) XXX_Unmarshal(b []byte) error

type Dumper added in v0.26.1

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

func NewDumper added in v0.26.1

func NewDumper(state *state.State, blockchain Blockchain) *Dumper

Return a Dumper that can Transmit Dump rows to a Sink by pulling them out of the the provided State

func (*Dumper) Source added in v0.28.0

func (ds *Dumper) Source(startHeight, endHeight uint64, options Option) Source

Return a Source that is a Pipe fed from this Dumper's Transmit function

func (*Dumper) Transmit added in v0.26.1

func (ds *Dumper) Transmit(sink Sink, startHeight, endHeight uint64, options Option) error

func (*Dumper) WithLogger added in v0.28.0

func (ds *Dumper) WithLogger(logger *logging.Logger) *Dumper

type EVMEvent

type EVMEvent struct {
	// The original ChainID from for this event
	ChainID string `protobuf:"bytes,1,opt,name=ChainID,proto3" json:"ChainID,omitempty"`
	// The original index for this event
	Index uint64 `protobuf:"varint,4,opt,name=Index,proto3" json:"Index,omitempty"`
	// The original block time for this transaction
	Time time.Time `protobuf:"bytes,2,opt,name=Time,proto3,stdtime" json:"Time"`
	// The event itself
	Event                *exec.LogEvent `protobuf:"bytes,3,opt,name=Event,proto3" json:"Event,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*EVMEvent) Descriptor

func (*EVMEvent) Descriptor() ([]byte, []int)

func (*EVMEvent) GetChainID

func (m *EVMEvent) GetChainID() string

func (*EVMEvent) GetEvent

func (m *EVMEvent) GetEvent() *exec.LogEvent

func (*EVMEvent) GetIndex added in v0.28.0

func (m *EVMEvent) GetIndex() uint64

func (*EVMEvent) GetTime

func (m *EVMEvent) GetTime() time.Time

func (*EVMEvent) Marshal

func (m *EVMEvent) Marshal() (dAtA []byte, err error)

func (*EVMEvent) MarshalTo

func (m *EVMEvent) MarshalTo(dAtA []byte) (int, error)

func (*EVMEvent) MarshalToSizedBuffer added in v0.30.0

func (m *EVMEvent) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EVMEvent) ProtoMessage

func (*EVMEvent) ProtoMessage()

func (*EVMEvent) Reset

func (m *EVMEvent) Reset()

func (*EVMEvent) Size

func (m *EVMEvent) Size() (n int)

func (*EVMEvent) String

func (m *EVMEvent) String() string

func (*EVMEvent) Unmarshal

func (m *EVMEvent) Unmarshal(dAtA []byte) error

func (*EVMEvent) XXX_DiscardUnknown

func (m *EVMEvent) XXX_DiscardUnknown()

func (*EVMEvent) XXX_Marshal

func (m *EVMEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EVMEvent) XXX_Merge

func (m *EVMEvent) XXX_Merge(src proto.Message)

func (*EVMEvent) XXX_MessageName

func (*EVMEvent) XXX_MessageName() string

func (*EVMEvent) XXX_Size

func (m *EVMEvent) XXX_Size() int

func (*EVMEvent) XXX_Unmarshal

func (m *EVMEvent) XXX_Unmarshal(b []byte) error

type MockSource added in v0.28.0

type MockSource struct {
	Accounts   int
	MaxStorage int
	Names      int
	Events     int
	*Mockchain
	// contains filtered or unexported fields
}

func NewMockSource added in v0.28.0

func NewMockSource(accounts, maxStorage, names, events int) *MockSource

func (*MockSource) Recv added in v0.28.0

func (m *MockSource) Recv() (*Dump, error)

type Mockchain added in v0.28.0

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

func NewMockchain added in v0.28.0

func NewMockchain(chainID string, lastBlockHeight uint64) *Mockchain

func (*Mockchain) ChainID added in v0.28.0

func (mc *Mockchain) ChainID() string

func (*Mockchain) LastBlockHeight added in v0.28.0

func (mc *Mockchain) LastBlockHeight() uint64

type NullSink added in v0.28.0

type NullSink struct{}

func (NullSink) Send added in v0.28.0

func (NullSink) Send(*Dump) error

type Option added in v0.26.1

type Option uint64
const (
	// Whether to send/receive these classes of data
	Accounts Option = 1 << iota
	Names
	Events
)
const (
	None Option = 0
	All         = Accounts | Names | Events
)

func (Option) Enabled added in v0.26.1

func (options Option) Enabled(option Option) bool

type Pipe added in v0.26.1

type Pipe chan msg

Implements both Sink and Source

func (Pipe) Recv added in v0.26.1

func (p Pipe) Recv() (*Dump, error)

func (Pipe) Send added in v0.26.1

func (p Pipe) Send(dump *Dump) error

type Sink added in v0.28.0

type Sink interface {
	Send(*Dump) error
}

type Source added in v0.28.0

type Source interface {
	Recv() (*Dump, error)
}

func NewFileReader added in v0.26.1

func NewFileReader(filename string) (Source, error)

type Storage

type Storage struct {
	Key                  github_com_hyperledger_burrow_binary.Word256  `protobuf:"bytes,1,opt,name=Key,proto3,customtype=github.com/hyperledger/burrow/binary.Word256" json:"Key"`
	Value                github_com_hyperledger_burrow_binary.HexBytes `protobuf:"bytes,2,opt,name=Value,proto3,customtype=github.com/hyperledger/burrow/binary.HexBytes" json:"Value"`
	XXX_NoUnkeyedLiteral struct{}                                      `json:"-"`
	XXX_unrecognized     []byte                                        `json:"-"`
	XXX_sizecache        int32                                         `json:"-"`
}

func (*Storage) Descriptor

func (*Storage) Descriptor() ([]byte, []int)

func (*Storage) Marshal

func (m *Storage) Marshal() (dAtA []byte, err error)

func (*Storage) MarshalTo

func (m *Storage) MarshalTo(dAtA []byte) (int, error)

func (*Storage) MarshalToSizedBuffer added in v0.30.0

func (m *Storage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Storage) ProtoMessage

func (*Storage) ProtoMessage()

func (*Storage) Reset

func (m *Storage) Reset()

func (*Storage) Size

func (m *Storage) Size() (n int)

func (*Storage) String

func (m *Storage) String() string

func (*Storage) Unmarshal

func (m *Storage) Unmarshal(dAtA []byte) error

func (*Storage) XXX_DiscardUnknown

func (m *Storage) XXX_DiscardUnknown()

func (*Storage) XXX_Marshal

func (m *Storage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Storage) XXX_Merge

func (m *Storage) XXX_Merge(src proto.Message)

func (*Storage) XXX_MessageName

func (*Storage) XXX_MessageName() string

func (*Storage) XXX_Size

func (m *Storage) XXX_Size() int

func (*Storage) XXX_Unmarshal

func (m *Storage) XXX_Unmarshal(b []byte) error

type StreamReader added in v0.28.0

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

func NewJSONReader added in v0.28.0

func NewJSONReader(reader io.Reader) (*StreamReader, error)

func NewProtobufReader added in v0.28.0

func NewProtobufReader(reader io.Reader) (*StreamReader, error)

func NewStreamReader added in v0.28.0

func NewStreamReader(reader io.Reader, decode func(*Dump) error) (*StreamReader, error)

func (*StreamReader) Recv added in v0.28.0

func (sr *StreamReader) Recv() (*Dump, error)

Jump to

Keyboard shortcuts

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