Documentation ¶
Overview ¶
Package http implements the Network interface for the tlock package.
Index ¶
- Variables
- type Network
- func (n *Network) ChainHash() string
- func (n *Network) Current(date time.Time) uint64
- func (n *Network) PublicKey() kyber.Point
- func (n *Network) RoundNumber(t time.Time) uint64
- func (n *Network) Scheme() crypto.Scheme
- func (n *Network) Signature(roundNumber uint64) ([]byte, error)
- func (n *Network) SwitchChainHash(new string) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotUnchained = errors.New("not an unchained network")
ErrNotUnchained represents an error when the informed chain belongs to a chained network.
Functions ¶
This section is empty.
Types ¶
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network represents the network support using the drand http client.
func NewNetwork ¶
NewNetwork constructs a network for use that will use the http client.
func (*Network) Current ¶ added in v1.0.0
Current returns the current round for that network at the given date.
func (*Network) RoundNumber ¶
RoundNumber will return the latest round of randomness that is available for the specified time. To handle a duration construct time like this: time.Now().Add(6*time.Second)
func (*Network) Scheme ¶ added in v1.0.0
Scheme returns the drand crypto Scheme used by the network.
func (*Network) Signature ¶
Signature makes a call to the network to retrieve the signature for the specified round number.
func (*Network) SwitchChainHash ¶ added in v1.1.0
SwitchChainHash allows to start using another chainhash on the same host network