Documentation ¶
Index ¶
- type Demo
- func (self *Demo) APIs() []rpc.API
- func (self *Demo) IsWorker() bool
- func (self *Demo) Protocol() *p2p.Protocol
- func (self *Demo) Protocols() (protos []p2p.Protocol)
- func (self *Demo) Run(p *protocols.Peer) error
- func (self *Demo) Spec() *protocols.Spec
- func (self *Demo) Start(srv *p2p.Server) error
- func (self *Demo) Stop() error
- type DemoAPI
- type DemoParams
- type ResultSinkFunc
- type SaveFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Demo ¶
type Demo struct {
// contains filtered or unexported fields
}
TODO: Change the id to sha1(peerid|data|submits.lastid), so moocher can find it in resource updates later Demo implements the node.Service interface
func NewDemo ¶
func NewDemo(params *DemoParams) (*Demo, error)
type DemoAPI ¶
type DemoAPI struct {
// contains filtered or unexported fields
}
func (*DemoAPI) SetDifficulty ¶
type DemoParams ¶
type DemoParams struct { Id []byte MaxDifficulty uint8 MaxJobs int MaxTimePerJob time.Duration SubmitDelay time.Duration SubmitDataSize int MaxSubmitDifficulty uint8 MinSubmitDifficulty uint8 ResultSink ResultSinkFunc Save SaveFunc }
func NewDemoParams ¶
func NewDemoParams(sinkFunc ResultSinkFunc, saveFunc SaveFunc) *DemoParams
type ResultSinkFunc ¶
type ResultSinkFunc func(data interface{})
Click to show internal directories.
Click to hide internal directories.