controller

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alloc

type Alloc struct {
	Balance string `json:"balance"`
}

Alloc ...

type Cacher

type Cacher interface {
	Load(hash string, data core.Unmarshaler) error
	Store(hash string, data core.Marshaler) error
	Update(hash string, fn func(bytes []byte) (core.Marshaler, error)) error
	Close() error
	Range(f func(hash string, value string) bool)
}

Cacher ...

func HashCacher

func HashCacher(cfg *config.Config) Cacher

HashCacher ...

func NodeCacher

func NodeCacher(cfg *config.Config) Cacher

NodeCacher ...

type Clique

type Clique struct {
	Period int64 `json:"period"`
	Epoch  int64 `json:"epoch"`
}

Clique ...

type Config

type Config struct {
	ChainID             int64  `json:"chainId"`
	HomesteadBlock      int64  `json:"homesteadBlock"`
	Eip150Block         int64  `json:"eip150Block"`
	Eip150Hash          string `json:"eip150Hash"`
	Eip155Block         int64  `json:"eip155Block"`
	Eip158Block         int64  `json:"eip158Block"`
	ByzantiumBlock      int64  `json:"byzantiumBlock"`
	ConstantinopleBlock int64  `json:"constantinopleBlock"`
	Clique              Clique `json:"clique"`
}

Config ...

type Controller

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

Controller ...

func New

func New(cfg *config.Config) *Controller

New ...

func (*Controller) DataStoreAPI

func (c *Controller) DataStoreAPI() core.DataStoreAPI

DataStoreAPI ...

func (*Controller) GetUnixfs

func (c *Controller) GetUnixfs(ctx context.Context, urlPath string, endpoint string) (node files.Node, err error)

GetUnixfs ...

func (*Controller) HandleSwarm

func (c *Controller) HandleSwarm(info peer.AddrInfo) error

HandleSwarm ...

func (*Controller) ID

ID ...

func (*Controller) Initialize

func (c *Controller) Initialize() (e error)

Initialize ...

func (*Controller) PinAdd

PinAdd ...

func (*Controller) PinLs

PinLs ...

func (*Controller) Run

func (c *Controller) Run()

Run ...

func (*Controller) Stop

func (c *Controller) Stop() (e error)

Stop ...

func (*Controller) UploadFile

func (c *Controller) UploadFile(ctx context.Context, req *core.UploadReq) (*core.UploadResp, error)

UploadFile ...

func (Controller) WaitAllReady

func (c Controller) WaitAllReady()

WaitAllReady ...

type DataHashInfo

type DataHashInfo struct {
	DataHash string            `json:"data_hash"`
	DataInfo core.Serializable `json:"data_info"`
	AddrInfo core.AddrInfo     `json:"addr_info"`
}

DataHashInfo ...

func (DataHashInfo) Hash

func (v DataHashInfo) Hash() string

Hash ...

func (DataHashInfo) Marshal

func (v DataHashInfo) Marshal() ([]byte, error)

Marshal ...

func (*DataHashInfo) Unmarshal

func (v *DataHashInfo) Unmarshal(b []byte) error

Unmarshal ...

type ETHPeer

type ETHPeer struct {
	Caps      []string
	ID        string
	Name      string
	Enode     string
	Network   Network
	Protocols interface{}
}

ETHPeer ...

type ETHProtocol

type ETHProtocol struct {
	Eth ETHProtocolInfo `json:"eth"`
}

ETHProtocol ...

type ETHProtocolInfo

type ETHProtocolInfo struct {
	Difficulty int    `json:"difficulty"`
	Head       string `json:"head"`
	Version    int    `json:"version"`
}

ETHProtocolInfo ...

type Genesis

type Genesis struct {
	Config     Config           `json:"config"`
	Nonce      string           `json:"nonce"`
	Timestamp  string           `json:"timestamp"`
	ExtraData  string           `json:"extraData"`
	GasLimit   string           `json:"gasLimit"`
	Difficulty string           `json:"difficulty"`
	MixHash    string           `json:"mixHash"`
	Coinbase   string           `json:"coinbase"`
	Alloc      map[string]Alloc `json:"alloc"`
	Number     string           `json:"number"`
	GasUsed    string           `json:"gasUsed"`
	ParentHash string           `json:"parentHash"`
}

Genesis ...

func LoadGenesis

func LoadGenesis(closer io.ReadCloser) (*Genesis, error)

LoadGenesis ...

type JSONRPCAdapter

type JSONRPCAdapter interface {
	ID(r *http.Request, req *core.IDReq, resp *core.IDResp) error
	Add(r *http.Request, req *core.AddReq, resp *core.AddResp) error
	Get(r *http.Request, req *core.GetReq, resp *core.GetResp) error
	Pay(r *http.Request, req *core.PayReq, resp *core.PayResp) error
}

JSONRPCAdapter //todo

type Network

type Network struct {
	Inbound       bool
	LocalAddress  string
	RemoteAddress string
	Static        bool
	Trusted       bool
}

Network ...

type Result

type Result struct {
	ID      string
	Jsonrpc string
	Result  []ETHPeer
}

Result ...

type ServiceIndex

type ServiceIndex int

ServiceIndex ...

const (
	// IndexETH ...
	IndexETH ServiceIndex = iota
	// IndexIPFS ...
	IndexIPFS

	// IndexMax ...
	IndexMax
)

Jump to

Keyboard shortcuts

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