Documentation ¶
Overview ¶
Package pkiclient implements a caching wrapper
katzenmint pkiclient interface
Index ¶
- type BroadcastTxError
- type Cache
- func (c *Cache) Deserialize(raw []byte) (*pki.Document, error)
- func (c *Cache) GetDoc(ctx context.Context, epoch uint64) (*pki.Document, []byte, error)
- func (c *Cache) GetEpoch(ctx context.Context) (epoch uint64, ellapsedHeight uint64, err error)
- func (c *Cache) Halt()
- func (c *Cache) Post(ctx context.Context, epoch uint64, signingKey *eddsa.PrivateKey, ...) error
- func (c *Cache) Shutdown()
- type Client
- type PKIClient
- func (p *PKIClient) Deserialize(raw []byte) (*cpki.Document, error)
- func (p *PKIClient) DeserializeWithEpoch(raw []byte, epoch uint64) (*cpki.Document, error)
- func (p *PKIClient) GetDoc(ctx context.Context, epoch uint64) (*cpki.Document, []byte, error)
- func (p *PKIClient) GetEpoch(ctx context.Context) (epoch uint64, ellapsedHeight uint64, err error)
- func (p *PKIClient) Post(ctx context.Context, epoch uint64, signingKey *eddsa.PrivateKey, ...) error
- func (p *PKIClient) PostTx(ctx context.Context, tx []byte) (*ctypes.ResultBroadcastTxCommit, error)
- func (p *PKIClient) Shutdown()
- type PKIClientConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastTxError ¶
type BroadcastTxError struct {
Resp *ctypes.ResultBroadcastTxCommit
}
func (BroadcastTxError) Error ¶
func (e BroadcastTxError) Error() string
type Cache ¶
Cache is a caching PKI client.
func NewCacheClient ¶
New constructs a new Client backed by an existing pki.Client instance.
func (*Cache) Deserialize ¶
Deserialize returns PKI document given the raw bytes.
type Client ¶
type Client interface { // GetEpoch returns the epoch information of PKI. GetEpoch(ctx context.Context) (epoch uint64, ellapsedHeight uint64, err error) // GetDoc returns the PKI document along with the raw serialized form for the provided epoch. GetDoc(ctx context.Context, epoch uint64) (*cpki.Document, []byte, error) // Post posts the node's descriptor to the PKI for the provided epoch. Post(ctx context.Context, epoch uint64, signingKey *eddsa.PrivateKey, d *cpki.MixDescriptor) error // Deserialize returns PKI document given the raw bytes. Deserialize(raw []byte) (*cpki.Document, error) // Shutdown the client Shutdown() }
Client is the abstract interface used for PKI interaction.
type PKIClient ¶
type PKIClient struct {
// contains filtered or unexported fields
}
func NewPKIClient ¶
func NewPKIClient(cfg *PKIClientConfig) (*PKIClient, error)
NewPKIClient create PKI Client from PKI config
func NewPKIClientFromLightClient ¶
func NewPKIClientFromLightClient(light *lightrpc.Client, logBackend *log.Backend) (*PKIClient, error)
NewPKIClientFromLightClient create PKI Client from tendermint rpc light client
func (*PKIClient) Deserialize ¶
Deserialize returns PKI document given the raw bytes.
func (*PKIClient) DeserializeWithEpoch ¶
DeserializeWithEpoch returns PKI document given the raw bytes.
func (*PKIClient) GetDoc ¶
GetDoc returns the PKI document along with the raw serialized form for the provided epoch.
func (*PKIClient) Post ¶
func (p *PKIClient) Post(ctx context.Context, epoch uint64, signingKey *eddsa.PrivateKey, d *cpki.MixDescriptor) error
Post posts the node's descriptor to the PKI for the provided epoch.