Documentation ¶
Overview ¶
Package core implements Chain Core and its API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupSubmittedTxs ¶
CleanupSubmittedTxs will periodically delete records of submitted txs older than a day. This function blocks and only exits when its context is cancelled.
TODO(jackson): unexport this and start it in a goroutine in a core.New() function?
func WriteHTTPError ¶
func WriteHTTPError(ctx context.Context, w http.ResponseWriter, err error)
WriteHTTPError writes a json encoded detailedError to the ResponseWriter. It uses the status code associated with the error.
Types ¶
type Handler ¶
type Handler struct { Chain *protocol.Chain Store *txdb.Store PinStore *pin.Store Assets *asset.Registry Accounts *account.Manager HSM *mockhsm.HSM Indexer *query.Indexer TxFeeds *txfeed.Tracker AccessTokens *accesstoken.CredentialStore Config *config.Config Submitter txbuilder.Submitter DB pg.DB Addr string AltAuth func(*http.Request) bool Signer func(context.Context, *bc.Block) ([]byte, error) RequestLimits []RequestLimit // contains filtered or unexported fields }
Handler serves the Chain HTTP API
func (*Handler) HealthSetter ¶
HealthSetter returns a function that, when called, sets the named health status in the map returned by "/health". The returned function is safe to call concurrently with ServeHTTP.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package accesstoken provides storage and validation of Chain Core credentials.
|
Package accesstoken provides storage and validation of Chain Core credentials. |
Package account stores and tracks accounts within a Chain Core.
|
Package account stores and tracks accounts within a Chain Core. |
Package asset maintains a registry of all assets on a blockchain.
|
Package asset maintains a registry of all assets on a blockchain. |
Package blocksigner implements remote block signing.
|
Package blocksigner implements remote block signing. |
Package config manages persistent configuration data for Chain Core.
|
Package config manages persistent configuration data for Chain Core. |
Package coretest provides utilities for testing Chain Core.
|
Package coretest provides utilities for testing Chain Core. |
Package coreunsafe contains Core logic that is unsafe for production.
|
Package coreunsafe contains Core logic that is unsafe for production. |
Package fetch implements block replication for participant Chain Cores.
|
Package fetch implements block replication for participant Chain Cores. |
Package generator implements the Chain Core generator.
|
Package generator implements the Chain Core generator. |
Package leader implements leader election between cored processes of a Chain Core.
|
Package leader implements leader election between cored processes of a Chain Core. |
Package migrate implements database migration for Chain Core.
|
Package migrate implements database migration for Chain Core. |
Package mockhsm provides a mock HSM for development environments.
|
Package mockhsm provides a mock HSM for development environments. |
Package query implements indexing and querying of annotated blockchain data.
|
Package query implements indexing and querying of annotated blockchain data. |
filter
Package filter parses and evaluates Chain filter expressions.
|
Package filter parses and evaluates Chain filter expressions. |
Package rpc implements Chain Core's RPC client.
|
Package rpc implements Chain Core's RPC client. |
Package signers associates signers and their corresponding keys.
|
Package signers associates signers and their corresponding keys. |
Package txbuilder builds a Chain Protocol transaction from a list of actions.
|
Package txbuilder builds a Chain Protocol transaction from a list of actions. |
Package txdb provides storage for Chain Protocol blockchain data structures.
|
Package txdb provides storage for Chain Protocol blockchain data structures. |
internal/storage
Package storage is a generated protocol buffer package.
|
Package storage is a generated protocol buffer package. |
Package txfeed implements Chain Core's transaction feeds.
|
Package txfeed implements Chain Core's transaction feeds. |
Click to show internal directories.
Click to hide internal directories.