func NewInstance
NewInstance creates a new instance of an oracle.
NewInstance creates a new instance of an oracle.
Feed is an abstraction used by a gnorkle `Instance` to ingest data from agents and provide data feeds to consumers.
FeedWithWhitelist associates a `Whitelist` with a `Feed`.
Ingester is the abstraction that allows a `Feed` to ingest data from agents and commit it to storage using zero or more intermediate aggregation steps.
Instance is a single instance of an oracle.
AddFeeds adds feeds to the instance with empty whitelists.
AddFeedsWithWhitelists adds feeds to the instance with the given whitelists.
AddToWhitelist adds the given addresses to the whitelist of the instance or feed depending on the feed ID.
ClearWhitelist clears the whitelist of the instance or feed depending on the feed ID.
GetFeedDefinitions returns a JSON string representing the feed definitions for which the given agent address is whitelisted to provide values for ingestion.
GetFeedValue returns the most recently published value of a feed along with a string representation of the value's type and boolean indicating whether the value is okay for consumption.
1func (i *Instance) HandleMessage(msg string, postHandler PostMessageHandler) (string, error)HandleMessage handles a message from an agent and routes to either the logic that returns feed definitions or the logic that allows a feed to ingest a message.
TODO: Consider further message types that could allow administrative action such as modifying a feed's whitelist without the owner of this oracle having to maintain a reference to it.
RemoveFeed removes a feed from the instance.
RemoveFromWhitelist removes the given address from the whitelist of the instance or feed depending on the feed ID.
PostMessageHandler is a type that allows for post-processing of feed state after a feed ingests a message from an agent.
Storage defines how published feed values should be read and written.
Whitelist is used to manage which agents are allowed to interact.