blockexplorer

package
v0.0.0-...-9742f5a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

README

Web API/UI for exploring the network

The block explorer is an HTTP daemon serving an API for exploring the CacheCash network.

Quickstart

Browse to block explorer.

API

The explorer performs media detection; use postman or similar browser tools to perform API queries directly.

Supported media types:

  • application/json
  • application/protobuf
  • text/html

API: (planned)

  • /blocks
  • /blocks/ids/<id>
  • /caches
  • /caches/ids/<id>
  • /escrows - filter tickets redeemed by cache?
  • /publishers
  • /publishers/ids/<id>

API traversal patterns - start with blocks blocks lead to escrows escrows lead to caches and publishers show selected metrics? show tickets for escrows?

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthBlockexplorer = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBlockexplorer   = fmt.Errorf("proto: integer overflow")
)

Functions

This section is empty.

Types

type APIRoot

type APIRoot struct {
	XLinks               *Links   `protobuf:"bytes,1,opt,name=_links,json=Links,proto3" json:"_links,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

APIRoot is the root of the API

func (*APIRoot) Descriptor

func (*APIRoot) Descriptor() ([]byte, []int)
func (m *APIRoot) GetXLinks() *Links

func (*APIRoot) Marshal

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

func (*APIRoot) MarshalTo

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

func (*APIRoot) ProtoMessage

func (*APIRoot) ProtoMessage()

func (*APIRoot) Reset

func (m *APIRoot) Reset()

func (*APIRoot) Size

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

func (*APIRoot) String

func (m *APIRoot) String() string

func (*APIRoot) Unmarshal

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

func (*APIRoot) XXX_DiscardUnknown

func (m *APIRoot) XXX_DiscardUnknown()

func (*APIRoot) XXX_Marshal

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

func (*APIRoot) XXX_Merge

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

func (*APIRoot) XXX_Size

func (m *APIRoot) XXX_Size() int

func (*APIRoot) XXX_Unmarshal

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

type Block

type Block struct {
	XLinks               *Links        `protobuf:"bytes,1,opt,name=_links,json=Links,proto3" json:"_links,omitempty"`
	Data                 *ledger.Block `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

Block is a blockchain block

func (*Block) Descriptor

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

func (*Block) GetData

func (m *Block) GetData() *ledger.Block
func (m *Block) GetXLinks() *Links

func (*Block) Marshal

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

func (*Block) MarshalTo

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

func (*Block) ProtoMessage

func (*Block) ProtoMessage()

func (*Block) Reset

func (m *Block) Reset()

func (*Block) Size

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

func (*Block) String

func (m *Block) String() string

func (*Block) Unmarshal

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

func (*Block) XXX_DiscardUnknown

func (m *Block) XXX_DiscardUnknown()

func (*Block) XXX_Marshal

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

func (*Block) XXX_Merge

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

func (*Block) XXX_Size

func (m *Block) XXX_Size() int

func (*Block) XXX_Unmarshal

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

type Blocks

type Blocks struct {
	XLinks               *Links           `protobuf:"bytes,1,opt,name=_links,json=Links,proto3" json:"_links,omitempty"`
	XEmbedded            *Blocks_Embedded `protobuf:"bytes,2,opt,name=_embedded,json=Embedded,proto3" json:"_embedded,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

Blocks is a collection of blocks

func (*Blocks) Descriptor

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

func (*Blocks) GetXEmbedded

func (m *Blocks) GetXEmbedded() *Blocks_Embedded
func (m *Blocks) GetXLinks() *Links

func (*Blocks) Marshal

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

func (*Blocks) MarshalTo

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

func (*Blocks) ProtoMessage

func (*Blocks) ProtoMessage()

func (*Blocks) Reset

func (m *Blocks) Reset()

func (*Blocks) Size

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

func (*Blocks) String

func (m *Blocks) String() string

func (*Blocks) Unmarshal

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

func (*Blocks) XXX_DiscardUnknown

func (m *Blocks) XXX_DiscardUnknown()

func (*Blocks) XXX_Marshal

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

func (*Blocks) XXX_Merge

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

func (*Blocks) XXX_Size

func (m *Blocks) XXX_Size() int

func (*Blocks) XXX_Unmarshal

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

type Blocks_Embedded

type Blocks_Embedded struct {
	Blocks               []*Block `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Blocks_Embedded) Descriptor

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

func (*Blocks_Embedded) GetBlocks

func (m *Blocks_Embedded) GetBlocks() []*Block

func (*Blocks_Embedded) Marshal

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

func (*Blocks_Embedded) MarshalTo

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

func (*Blocks_Embedded) ProtoMessage

func (*Blocks_Embedded) ProtoMessage()

func (*Blocks_Embedded) Reset

func (m *Blocks_Embedded) Reset()

func (*Blocks_Embedded) Size

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

func (*Blocks_Embedded) String

func (m *Blocks_Embedded) String() string

func (*Blocks_Embedded) Unmarshal

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

func (*Blocks_Embedded) XXX_DiscardUnknown

func (m *Blocks_Embedded) XXX_DiscardUnknown()

func (*Blocks_Embedded) XXX_Marshal

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

func (*Blocks_Embedded) XXX_Merge

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

func (*Blocks_Embedded) XXX_Size

func (m *Blocks_Embedded) XXX_Size() int

func (*Blocks_Embedded) XXX_Unmarshal

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

type ConfigFile

type ConfigFile struct {
	Root       string `json:"root"`
	HTTPAddr   string `json:"grpc_addr"`
	LedgerAddr string `json:"ledger_addr"`
	StatusAddr string `json:"status_addr"`
	Insecure   bool   `json:"insecure"`
}

ConfigFile is the blockexplorer configuration

type Daemon

type Daemon interface {
	common.StarterShutdowner
}

Daemon defines the interface the CLI uses to start and stop the daemon.

func NewDaemon

func NewDaemon(l *logrus.Logger, conf *ConfigFile) (Daemon, error)

NewDaemon creates a block explorer daemon

type Link struct {
	// The URL - possibly a template such as "/escrows{?id}"
	Href string `protobuf:"bytes,1,opt,name=href,proto3" json:"href,omitempty"`
	// optional; true if the url is a template
	Templated bool `protobuf:"varint,2,opt,name=templated,proto3" json:"templated,omitempty"`
	// optional human readable name
	Name                 string   `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Link is a single link to another object

func (*Link) Descriptor

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

func (*Link) GetHref

func (m *Link) GetHref() string

func (*Link) GetName

func (m *Link) GetName() string

func (*Link) GetTemplated

func (m *Link) GetTemplated() bool

func (*Link) Marshal

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

func (*Link) MarshalTo

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

func (*Link) ProtoMessage

func (*Link) ProtoMessage()

func (*Link) Reset

func (m *Link) Reset()

func (*Link) Size

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

func (*Link) String

func (m *Link) String() string

func (*Link) Unmarshal

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

func (*Link) XXX_DiscardUnknown

func (m *Link) XXX_DiscardUnknown()

func (*Link) XXX_Marshal

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

func (*Link) XXX_Merge

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

func (*Link) XXX_Size

func (m *Link) XXX_Size() int

func (*Link) XXX_Unmarshal

func (m *Link) XXX_Unmarshal(b []byte) error
type Links struct {
	// Maps the rel to the Link object.
	// For instance the link with rel="self" is found with key="self".
	Links                map[string]*Link `` /* 151-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

Links is a collection of links in an API response

func (*Links) Descriptor

func (*Links) Descriptor() ([]byte, []int)
func (m *Links) GetLinks() map[string]*Link

func (*Links) Marshal

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

func (*Links) MarshalTo

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

func (*Links) ProtoMessage

func (*Links) ProtoMessage()

func (*Links) Reset

func (m *Links) Reset()

func (*Links) Size

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

func (*Links) String

func (m *Links) String() string

func (*Links) Unmarshal

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

func (*Links) XXX_DiscardUnknown

func (m *Links) XXX_DiscardUnknown()

func (*Links) XXX_Marshal

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

func (*Links) XXX_Merge

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

func (*Links) XXX_Size

func (m *Links) XXX_Size() int

func (*Links) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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