Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blockchain ¶
type Blockchain interface { AddNode(opt *blockchain.AddNodeOptions) error GetNode(id []byte) (blockchain.Node, error) NodeOnline(opt *blockchain.NodeOperateOptions) error Heartbeat(opt *blockchain.NodeHeartBeatOptions) error ListNodesExpireSlice(opt *blockchain.ListNodeSliceOptions) ([][2]string, error) }
type NewNodeMaintainerOptions ¶
type NewNodeMaintainerOptions struct { LocalNode peer.Local Blockchain Blockchain SliceStorage SliceStorage ProveStorage ProveStorage }
type NodeMaintainer ¶
type NodeMaintainer struct {
// contains filtered or unexported fields
}
NodeMaintainer runs if local node is storage-node, and its main work is to clean expired encrypted slices
and to send heartbeats regularly in order to claim it's alive
func New ¶
func New(conf *config.MonitorConf, opt *NewNodeMaintainerOptions) (*NodeMaintainer, error)
func (*NodeMaintainer) HeartBeat ¶
func (m *NodeMaintainer) HeartBeat(ctx context.Context)
HeartBeat sends heart beat onto blockchain
func (*NodeMaintainer) NodeAutoRegister ¶
func (m *NodeMaintainer) NodeAutoRegister() error
NodeAutoRegister storage-node automatically register in blockchain
func (*NodeMaintainer) StartFileClear ¶
func (m *NodeMaintainer) StartFileClear(ctx context.Context)
StartFileClear starts task to clear files
func (*NodeMaintainer) StopFileClear ¶
func (m *NodeMaintainer) StopFileClear()
StopFileClear stops task clearing files
func (*NodeMaintainer) StopHeartBeat ¶
func (m *NodeMaintainer) StopHeartBeat()
StopHeartBeat stops sending heart beats onto blockchain
type ProveStorage ¶
type ProveStorage interface { Save(key string, value io.Reader) error Load(key string) (io.ReadCloser, error) Delete(key string) (bool, error) Exist(key string) (bool, error) LoadStr(key string) (string, error) SaveAndUpdate(key string, value io.Reader) error }
ProveStorage is Storage interface used in `Replication Holding Proof` process
Click to show internal directories.
Click to hide internal directories.