Documentation ¶
Index ¶
Constants ¶
View Source
const BoltDBFile = "pow.db"
BoltDBFile is the filename to store the boltdb database
View Source
const BucketName = "pow"
BucketName is the bucket name to store the invitations on the bolt db
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProofOfWork ¶
type ProofOfWork struct { Challenge string `json:"challenge"` Bits int `json:"bits"` Proof uint64 `json:"proof"` Expires time.Time `json:"expires"` MsgID string `json:"msg_id"` Valid bool `json:"valid"` }
ProofOfWork is the structure that keeps information about proof-of-work done for incoming messages. It connects the proof-of-work with a message ID which can be used for uploading.
type Storable ¶
type Storable interface { // Retrieve retrieves the given challenge from the storage and returns its proof-of-work info Retrieve(challenge string) (*ProofOfWork, error) // Store stores the given proof of work in the storage Store(pow *ProofOfWork) error // Remove removes the given challenge from the storage Remove(challenge string) error }
Storable interface is the main interface to store and retrieve proof-of-work
Click to show internal directories.
Click to hide internal directories.