node

package
v0.0.0-...-4cd3ddc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommitmentSize = 32
	HeightSize     = 8
	IDSize         = CommitmentSize + ns.NamespaceSize + HeightSize
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID []byte

func NewID

func NewID(height uint64, namespace ns.Namespace, committment blob.Commitment) ID

func Parse

func Parse(id []byte) (ID, error)

func (ID) Committment

func (id ID) Committment() blob.Commitment

func (ID) Height

func (id ID) Height() uint64

func (ID) Namespace

func (id ID) Namespace() ns.Namespace

type Node

type Node struct {
	// contains filtered or unexported fields
}

func NewNode

func NewNode() (*Node, error)

func (*Node) Get

func (n *Node) Get(ctx context.Context, id ID) (SignedDocument, error)

func (*Node) Publish

func (n *Node) Publish(ctx context.Context, data []byte) (ID, error)

func (*Node) Sign

func (n *Node) Sign(ctx context.Context, id ID) error

func (*Node) Start

func (n *Node) Start(ctx context.Context) error

func (*Node) Stop

func (n *Node) Stop(ctx context.Context) error

type Signature

type Signature struct {
	Signature []byte
	PubKey    []byte
}

type SignedDocument

type SignedDocument struct {
	Document   []byte
	Signatures []Signature
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL