Documentation ¶
Overview ¶
Package threeid provides tools for resolving the did:3 method format for the ceramic network: https://github.com/ceramicnetwork/CIP/blob/main/CIPs/CIP-79/CIP-79.md Copyright 2021 Textile Copyright 2021 Ceramic Network
Package threeid provides tools for resolving the did:3 method format for the ceramic network: https://github.com/ceramicnetwork/CIP/blob/main/CIPs/CIP-79/CIP-79.md Copyright 2021 Textile Copyright 2021 Ceramic Network
Package threeid provides tools for resolving the did:3 method format for the ceramic network: https://github.com/ceramicnetwork/CIP/blob/main/CIPs/CIP-79/CIP-79.md Copyright 2021 Textile Copyright 2021 Ceramic Network
Index ¶
Constants ¶
const ( // DefaultAPIPath is the default version path for the Ceramic api DefaultAPIPath = "/api/v0" // DefaultHost is the default host path/url for the Ceramic api DefaultHost = "http://localhost:7007" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnchorProof ¶
type AnchorProof struct { ChainID string `json:"chainId,omitempty"` BlockNumber uint64 `json:"blockNumber,omitempty"` BlockTimestamp uint64 `json:"blockTimestamp,omitempty"` TxHash string `json:"txHash,omitempty"` Root string `json:"root,omitempty"` }
AnchorProof represents metadata about the on-chain anchor proof.
type Client ¶
type Client interface {
LoadDocument(docID DocIdentifier) (*DocState, error)
}
Client is a basic client interface for interacting with the Ceramic network.
type CommitID ¶
type CommitID struct { DocID // contains filtered or unexported fields }
CommitID is a commit identifier, includes doctype, genesis cid, commit cid.
type DocID ¶
type DocID struct {
// contains filtered or unexported fields
}
DocID is a document identifier, no commit information included. Encoded as '<multibase-prefix><multicodec-docid><doctype><genesis-cid-bytes>'
type DocIdentifier ¶
DocIdentifier defines any cid-based document with a type and bytes representation.
type DocMetadata ¶
type DocMetadata struct { Controllers []string `json:"controllers,omitempty"` Schema string `json:"schema,omitempty"` Tags []string `json:"tags,omitempty"` }
DocMetadata represents metadata about the primary ceramic document.
type DocNext ¶
type DocNext struct { Content *json.RawMessage `json:"content,omitempty"` Controllers []string `json:"contollers,omitempty"` Metadata DocMetadata `json:"metadata,omitempty"` }
DocNext represents information about the next iteration.
type DocResponse ¶
DocResponse represents the primary document query response.
type DocState ¶
type DocState struct { Doctype string `json:"doctype"` Content *json.RawMessage `json:"content,omitempty"` Next DocNext `json:"next,omitempty"` Metadata DocMetadata `json:"metadata,omitempty"` Signature uint64 `json:"signature,omitempty"` // 0=GENESIS, 1=PARTIAL, 2=SIGNED AnchorStatus string `json:"anchorStatus,omitempty"` // NOT_REQUESTED, PENDING, PROCESSING, ANCHORED, FAILED AnchorScheduledFor uint64 `json:"anchorScheduledFor,omitempty"` // only present when anchor status is pending AnchorProof AnchorProof `json:"anchorProof,omitempty"` // The anchor proof of the latest anchor, only present when anchor status is anchored Log []LogEntry `json:"log,omitempty"` }
DocState represents the primary ceramic document.
type HTTPClient ¶
type HTTPClient struct {
APIURL string
}
HTTPClient interfaces with the ceramic network via local or remote ceramic daemon.
func (*HTTPClient) Load ¶
func (client *HTTPClient) Load(docID DocIdentifier) (*DocResponse, error)
Load fetches the remote Ceramic document and returns it.
func (*HTTPClient) LoadDocument ¶
func (client *HTTPClient) LoadDocument(docID DocIdentifier) (*DocState, error)
LoadDocument loads a ceramic document using a local or remote ceramic daemon.
type LogEntry ¶
type LogEntry struct { // TODO: We actually want this as a cid.CID at some point // CID cid.Cid CID string `json:"cid"` Type uint `json:"type"` }
LogEntry represents an entry in a document's update history.