Documentation ¶
Index ¶
- func BanInboundPeer(db *leveldb.DB, ip string, duration time.Duration) error
- func BanInboundPeerTx(tx *leveldb.Transaction, ip string, duration time.Duration) error
- func BanName(tx *leveldb.Transaction, name string) error
- func BanOutboundPeer(db *leveldb.DB, ip string, duration time.Duration) error
- func BanOutboundPeerTx(tx *leveldb.Transaction, ip string, duration time.Duration) error
- func GetHeaderCount(db *leveldb.DB) (int, error)
- func GetInitialImportComplete(db *leveldb.DB) (bool, error)
- func GetLastBanListImportAt(db *leveldb.DB) (time.Time, error)
- func GetLastNameImportHeight(db *leveldb.DB) (int, error)
- func GetMerkleBase(db *leveldb.DB, name string) (blob.MerkleBase, error)
- func IncrementHeaderCount(tx *leveldb.Transaction) error
- func IsBanned(db *leveldb.DB, ip string) (bool, bool, error)
- func NameIsBanned(db *leveldb.DB, name string) (bool, error)
- func Open(path string) (*leveldb.DB, error)
- func Prefixer(prefix string) func(k ...string) []byte
- func SetHeaderTx(tx *leveldb.Transaction, header *Header, merkleBase blob.MerkleBase) error
- func SetInitialImportCompleteTx(tx *leveldb.Transaction) error
- func SetLastBanListImportAt(tx *leveldb.Transaction, t time.Time) error
- func SetLastNameImportHeightTx(tx *leveldb.Transaction, height int) error
- func SetNameInfoTx(tx *leveldb.Transaction, name string, key *btcec.PublicKey, height int) error
- func SetPeer(db *leveldb.DB, id crypto.Hash, ip string, verify bool) error
- func SetPeerTx(batch *leveldb.Transaction, id crypto.Hash, ip string, verify bool) error
- func TruncateBannedNames(tx *leveldb.Transaction) error
- func TruncateHeaderStore(db *leveldb.DB) error
- func TruncateNameStore(db *leveldb.DB) error
- func TruncatePeerStore(db *leveldb.DB) error
- func UnbanInboundPeerTx(tx *leveldb.Transaction, ip string) error
- func UnbanOutboundPeerTx(tx *leveldb.Transaction, ip string) error
- func UnwhitelistPeerTx(tx *leveldb.Transaction, ip string) error
- func WhitelistPeerTx(tx *leveldb.Transaction, ip string) error
- func WithTx(db *leveldb.DB, cb TxCb) error
- type BlobInfo
- type BlobInfoStream
- type Header
- type NameInfo
- type NameInfoStream
- type Peer
- type PeerStream
- type TxCb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BanInboundPeerTx ¶
func BanOutboundPeer ¶
func BanOutboundPeerTx ¶
func GetMerkleBase ¶
func IncrementHeaderCount ¶
func IncrementHeaderCount(tx *leveldb.Transaction) error
func SetHeaderTx ¶
func SetHeaderTx(tx *leveldb.Transaction, header *Header, merkleBase blob.MerkleBase) error
func SetInitialImportCompleteTx ¶
func SetInitialImportCompleteTx(tx *leveldb.Transaction) error
func SetLastBanListImportAt ¶
func SetLastBanListImportAt(tx *leveldb.Transaction, t time.Time) error
func SetLastNameImportHeightTx ¶
func SetLastNameImportHeightTx(tx *leveldb.Transaction, height int) error
func SetNameInfoTx ¶
func TruncateBannedNames ¶
func TruncateBannedNames(tx *leveldb.Transaction) error
func TruncateHeaderStore ¶
func TruncateNameStore ¶
func TruncatePeerStore ¶
func UnbanInboundPeerTx ¶
func UnbanInboundPeerTx(tx *leveldb.Transaction, ip string) error
func UnbanOutboundPeerTx ¶
func UnbanOutboundPeerTx(tx *leveldb.Transaction, ip string) error
func UnwhitelistPeerTx ¶ added in v0.2.1
func UnwhitelistPeerTx(tx *leveldb.Transaction, ip string) error
func WhitelistPeerTx ¶ added in v0.2.1
func WhitelistPeerTx(tx *leveldb.Transaction, ip string) error
Types ¶
type BlobInfo ¶
type BlobInfo struct { Name string `json:"name"` PublicKey *btcec.PublicKey `json:"public_key"` ImportHeight int `json:"import_height"` Timestamp time.Time `json:"timestamp"` MerkleRoot crypto.Hash `json:"merkle_root"` Signature crypto.Signature `json:"signature"` ReservedRoot crypto.Hash `json:"reserved_root"` ReceivedAt time.Time `json:"received_at"` Timebank int `json:"timebank"` }
func (*BlobInfo) MarshalJSON ¶
type BlobInfoStream ¶
type BlobInfoStream struct {
// contains filtered or unexported fields
}
func StreamBlobInfo ¶
func StreamBlobInfo(db *leveldb.DB, start string) (*BlobInfoStream, error)
func (*BlobInfoStream) Close ¶
func (bis *BlobInfoStream) Close() error
func (*BlobInfoStream) Next ¶
func (bis *BlobInfoStream) Next() (*BlobInfo, error)
type Header ¶
type Header struct { Name string Timestamp time.Time MerkleRoot crypto.Hash Signature crypto.Signature ReservedRoot crypto.Hash ReceivedAt time.Time Timebank int }
func (*Header) MarshalJSON ¶
func (*Header) UnmarshalJSON ¶
type NameInfoStream ¶
type NameInfoStream struct {
// contains filtered or unexported fields
}
func StreamNameInfo ¶
func StreamNameInfo(db *leveldb.DB, start string) (*NameInfoStream, error)
func (*NameInfoStream) Close ¶
func (nis *NameInfoStream) Close() error
func (*NameInfoStream) Next ¶
func (nis *NameInfoStream) Next() (*NameInfo, error)
type Peer ¶
type Peer struct { ID crypto.Hash IP string LastSeen time.Time Verify bool InboundBannedUntil time.Time OutboundBannedUntil time.Time Whitelisted bool }
func (*Peer) MarshalJSON ¶
func (*Peer) UnmarshalJSON ¶
type PeerStream ¶
type PeerStream struct {
// contains filtered or unexported fields
}
func StreamPeers ¶
func StreamPeers(db *leveldb.DB, includeBanned bool) (*PeerStream, error)
func (*PeerStream) Close ¶
func (ps *PeerStream) Close() error
func (*PeerStream) Next ¶
func (ps *PeerStream) Next() (*Peer, error)
type TxCb ¶
type TxCb func(tx *leveldb.Transaction) error
Click to show internal directories.
Click to hide internal directories.