debug

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2018 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package debug is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDebugDumperHandler

func RegisterDebugDumperHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterDebugDumperHandler registers the http handlers for service DebugDumper to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterDebugDumperHandlerClient

func RegisterDebugDumperHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DebugDumperClient) error

RegisterDebugDumperHandlerClient registers the http handlers for service DebugDumper to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DebugDumperClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DebugDumperClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "DebugDumperClient" to call the correct interceptors.

func RegisterDebugDumperHandlerFromEndpoint

func RegisterDebugDumperHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterDebugDumperHandlerFromEndpoint is same as RegisterDebugDumperHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterDebugDumperServer

func RegisterDebugDumperServer(s *grpc.Server, srv DebugDumperServer)

func RegisterDebugManagerHandler

func RegisterDebugManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterDebugManagerHandler registers the http handlers for service DebugManager to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterDebugManagerHandlerClient

func RegisterDebugManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DebugManagerClient) error

RegisterDebugManagerHandlerClient registers the http handlers for service DebugManager to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DebugManagerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DebugManagerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "DebugManagerClient" to call the correct interceptors.

func RegisterDebugManagerHandlerFromEndpoint

func RegisterDebugManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterDebugManagerHandlerFromEndpoint is same as RegisterDebugManagerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterDebugManagerServer

func RegisterDebugManagerServer(s *grpc.Server, srv DebugManagerServer)

Types

type DebugDumperClient

type DebugDumperClient interface {
	// DumpBlock retrieves the entire state of the database at a given block.
	DumpBlock(ctx context.Context, in *common.BlockNumber, opts ...grpc.CallOption) (*common.Dump, error)
}

DebugDumperClient is the client API for DebugDumper service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDebugDumperClient

func NewDebugDumperClient(cc *grpc.ClientConn) DebugDumperClient

type DebugDumperServer

type DebugDumperServer interface {
	// DumpBlock retrieves the entire state of the database at a given block.
	DumpBlock(context.Context, *common.BlockNumber) (*common.Dump, error)
}

DebugDumperServer is the server API for DebugDumper service.

type DebugManagerClient

type DebugManagerClient interface {
	// Preimage is a debug API function that returns the preimage for a sha3 hash, if known.
	Preimage(ctx context.Context, in *common.Hash, opts ...grpc.CallOption) (*PreimageValue, error)
	// GetBadBlocks returns a list of the last 'bad blocks' that the client has seen on the network
	// and returns them as a JSON list of block-hashes
	GetBadBlocks(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*common.BadBlockArgs, error)
	// StorageRangeAt returns the storage at the giyyven block height and transaction index.
	StorageRangeAt(ctx context.Context, in *DebugManagerRequest, opts ...grpc.CallOption) (*StorageRangeResult, error)
	// GetModifiedAccountsByNumber returns all accounts that have changed between the
	// two blocks specified. A change is defined as a difference in nonce, balance,
	// code hash, or storage hash.
	//
	// With one parameter, returns the list of accounts modified in the specified block.
	GetModifiedAccountsByNumber(ctx context.Context, in *DebugManagerRequest, opts ...grpc.CallOption) (*common.Addresses, error)
	// GetModifiedAccountsByHash returns all accounts that have changed between the
	// two blocks specified. A change is defined as a difference in nonce, balance,
	// code hash, or storage hash.
	//
	// With one parameter, returns the list of accounts modified in the specified block.
	GetModifiedAccountsByHash(ctx context.Context, in *DebugManagerRequest, opts ...grpc.CallOption) (*common.Addresses, error)
}

DebugManagerClient is the client API for DebugManager service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDebugManagerClient

func NewDebugManagerClient(cc *grpc.ClientConn) DebugManagerClient

type DebugManagerRequest

type DebugManagerRequest struct {
	BlockHash            string                `protobuf:"bytes,1,opt,name=blockHash,proto3" json:"blockHash,omitempty"`
	TxIndex              int32                 `protobuf:"varint,2,opt,name=txIndex,proto3" json:"txIndex,omitempty"`
	ContractAddress      string                `protobuf:"bytes,3,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"`
	KeyStart             []byte                `protobuf:"bytes,4,opt,name=keyStart,proto3" json:"keyStart,omitempty"`
	MaxResult            int32                 `protobuf:"varint,5,opt,name=maxResult,proto3" json:"maxResult,omitempty"`
	StartNumber          uint64                `protobuf:"varint,6,opt,name=startNumber,proto3" json:"startNumber,omitempty"`
	EndNumber            *wrappers.UInt64Value `protobuf:"bytes,7,opt,name=endNumber,proto3" json:"endNumber,omitempty"`
	StartHash            string                `protobuf:"bytes,8,opt,name=startHash,proto3" json:"startHash,omitempty"`
	EndHash              *wrappers.StringValue `protobuf:"bytes,9,opt,name=endHash,proto3" json:"endHash,omitempty"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

DebugManagerRequest DebugManager request arguments

func (*DebugManagerRequest) Descriptor

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

func (*DebugManagerRequest) GetBlockHash

func (m *DebugManagerRequest) GetBlockHash() string

func (*DebugManagerRequest) GetContractAddress

func (m *DebugManagerRequest) GetContractAddress() string

func (*DebugManagerRequest) GetEndHash

func (m *DebugManagerRequest) GetEndHash() *wrappers.StringValue

func (*DebugManagerRequest) GetEndNumber

func (m *DebugManagerRequest) GetEndNumber() *wrappers.UInt64Value

func (*DebugManagerRequest) GetKeyStart

func (m *DebugManagerRequest) GetKeyStart() []byte

func (*DebugManagerRequest) GetMaxResult

func (m *DebugManagerRequest) GetMaxResult() int32

func (*DebugManagerRequest) GetStartHash

func (m *DebugManagerRequest) GetStartHash() string

func (*DebugManagerRequest) GetStartNumber

func (m *DebugManagerRequest) GetStartNumber() uint64

func (*DebugManagerRequest) GetTxIndex

func (m *DebugManagerRequest) GetTxIndex() int32

func (*DebugManagerRequest) ProtoMessage

func (*DebugManagerRequest) ProtoMessage()

func (*DebugManagerRequest) Reset

func (m *DebugManagerRequest) Reset()

func (*DebugManagerRequest) String

func (m *DebugManagerRequest) String() string

func (*DebugManagerRequest) XXX_DiscardUnknown

func (m *DebugManagerRequest) XXX_DiscardUnknown()

func (*DebugManagerRequest) XXX_Marshal

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

func (*DebugManagerRequest) XXX_Merge

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

func (*DebugManagerRequest) XXX_Size

func (m *DebugManagerRequest) XXX_Size() int

func (*DebugManagerRequest) XXX_Unmarshal

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

type DebugManagerServer

type DebugManagerServer interface {
	// Preimage is a debug API function that returns the preimage for a sha3 hash, if known.
	Preimage(context.Context, *common.Hash) (*PreimageValue, error)
	// GetBadBlocks returns a list of the last 'bad blocks' that the client has seen on the network
	// and returns them as a JSON list of block-hashes
	GetBadBlocks(context.Context, *empty.Empty) (*common.BadBlockArgs, error)
	// StorageRangeAt returns the storage at the giyyven block height and transaction index.
	StorageRangeAt(context.Context, *DebugManagerRequest) (*StorageRangeResult, error)
	// GetModifiedAccountsByNumber returns all accounts that have changed between the
	// two blocks specified. A change is defined as a difference in nonce, balance,
	// code hash, or storage hash.
	//
	// With one parameter, returns the list of accounts modified in the specified block.
	GetModifiedAccountsByNumber(context.Context, *DebugManagerRequest) (*common.Addresses, error)
	// GetModifiedAccountsByHash returns all accounts that have changed between the
	// two blocks specified. A change is defined as a difference in nonce, balance,
	// code hash, or storage hash.
	//
	// With one parameter, returns the list of accounts modified in the specified block.
	GetModifiedAccountsByHash(context.Context, *DebugManagerRequest) (*common.Addresses, error)
}

DebugManagerServer is the server API for DebugManager service.

type PreimageValue

type PreimageValue struct {
	Preimage             []byte   `protobuf:"bytes,1,opt,name=preimage,proto3" json:"preimage,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

PreimageValue the preimage for a sha3 hash

func (*PreimageValue) Descriptor

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

func (*PreimageValue) GetPreimage

func (m *PreimageValue) GetPreimage() []byte

func (*PreimageValue) ProtoMessage

func (*PreimageValue) ProtoMessage()

func (*PreimageValue) Reset

func (m *PreimageValue) Reset()

func (*PreimageValue) String

func (m *PreimageValue) String() string

func (*PreimageValue) XXX_DiscardUnknown

func (m *PreimageValue) XXX_DiscardUnknown()

func (*PreimageValue) XXX_Marshal

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

func (*PreimageValue) XXX_Merge

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

func (*PreimageValue) XXX_Size

func (m *PreimageValue) XXX_Size() int

func (*PreimageValue) XXX_Unmarshal

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

type StorageEntry

type StorageEntry struct {
	Key                  string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

StorageEntry storage's entry

func (*StorageEntry) Descriptor

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

func (*StorageEntry) GetKey

func (m *StorageEntry) GetKey() string

func (*StorageEntry) GetValue

func (m *StorageEntry) GetValue() string

func (*StorageEntry) ProtoMessage

func (*StorageEntry) ProtoMessage()

func (*StorageEntry) Reset

func (m *StorageEntry) Reset()

func (*StorageEntry) String

func (m *StorageEntry) String() string

func (*StorageEntry) XXX_DiscardUnknown

func (m *StorageEntry) XXX_DiscardUnknown()

func (*StorageEntry) XXX_Marshal

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

func (*StorageEntry) XXX_Merge

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

func (*StorageEntry) XXX_Size

func (m *StorageEntry) XXX_Size() int

func (*StorageEntry) XXX_Unmarshal

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

type StorageRangeResult

type StorageRangeResult struct {
	StorageMap           map[string]*StorageEntry `` /* 161-byte string literal not displayed */
	NextKey              string                   `protobuf:"bytes,2,opt,name=nextKey,proto3" json:"nextKey,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

StorageRangeResult is the result of a debug_storageRangeAt API call.

func (*StorageRangeResult) Descriptor

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

func (*StorageRangeResult) GetNextKey

func (m *StorageRangeResult) GetNextKey() string

func (*StorageRangeResult) GetStorageMap

func (m *StorageRangeResult) GetStorageMap() map[string]*StorageEntry

func (*StorageRangeResult) ProtoMessage

func (*StorageRangeResult) ProtoMessage()

func (*StorageRangeResult) Reset

func (m *StorageRangeResult) Reset()

func (*StorageRangeResult) String

func (m *StorageRangeResult) String() string

func (*StorageRangeResult) XXX_DiscardUnknown

func (m *StorageRangeResult) XXX_DiscardUnknown()

func (*StorageRangeResult) XXX_Marshal

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

func (*StorageRangeResult) XXX_Merge

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

func (*StorageRangeResult) XXX_Size

func (m *StorageRangeResult) XXX_Size() int

func (*StorageRangeResult) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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