database

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2017 License: MIT Imports: 7 Imported by: 19 modules, 19 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Database API

This package adds support for database_api.

State

The following subsections document the API completion. The method names are taken from database_api.hpp in steemit/steem.

Subscriptions

TODO: Is this actually callable over the RPC endpoint? It is a bit confusing to see set_ prefix. Needs research.

   (set_subscribe_callback)
   (set_pending_transaction_callback)
   (set_block_applied_callback)
   (cancel_all_subscriptions)
Tags
Method Name Raw Version Full Version
get_trending_tags DONE
get_discussions_by_trending DONE
get_discussions_by_created DONE
get_discussions_by_active DONE
get_discussions_by_cashout DONE
get_discussions_by_payout DONE
get_discussions_by_votes DONE
get_discussions_by_children DONE
get_discussions_by_hot DONE
get_recommended_for DONE
Blocks and Transactions
Method Name Raw Version Full Version
get_block_header DONE
get_block DONE PARTIALLY DONE
get_ops_in_block DONE DONE
get_state DONE
get_trending_categories DONE
get_best_categories DONE
get_active_categories DONE
get_recent_categories DONE
get_ops_in_block DONE
Globals
Method Name Raw Version Full Version
get_config DONE PARTIALLY DONE
get_dynamic_global_properties DONE DONE
get_chain_properties DONE
get_feed_history DONE
get_current_median_history_price DONE
get_witness_schedule DONE
get_hardfork_version DONE DONE
get_next_scheduled_hardfork DONE
Keys
Method Name Raw Version Full Version
get_key_reference
Accounts
Method Name Raw Version Full Version
get_accounts DONE
get_account_references
lookup_account_names DONE
lookup_accounts DONE
get_account_count DONE
get_conversation_requests DONE
get_account_history DONE
Market
Method Name Raw Version Full Version
get_order_book
get_open_orders
Authority / Validation
Method Name Raw Version Full Version
get_transaction_hex
get_transaction
get_required_signatures
get_potential_signatures
verify_authority
verity_account_authority
Votes
Method Name Raw Version Full Version
get_active_votes DONE DONE
get_account_votes DONE
Cotent
Method Name Raw Version Full Version
get_content DONE PARTIALLY DONE
get_content_replies DONE PARTIALLY DONE
get_discussions_by_author_before_date
get_replies_by_last_update DONE
Witnesses
Method Name Raw Version Full Version
get_witnesses
get_witness_by_account
get_witnesses_by_vote
lookup_witness_accounts
get_witness_count
get_active_witnesses
get_miner_queue

License

MIT, see the LICENSE file.

Documentation

Index

Constants

View Source
const (
	APIID         = "database_api"
	NumbericAPIID = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(caller interfaces.Caller) *API

func (*API) GetAccountCountRaw

func (api *API) GetAccountCountRaw() (*json.RawMessage, error)

func (*API) GetAccountHistoryRaw

func (api *API) GetAccountHistoryRaw(account string, from uint64, limit uint32) (*json.RawMessage, error)

func (*API) GetAccountVotesRaw

func (api *API) GetAccountVotesRaw(voter string) (*json.RawMessage, error)

func (*API) GetAccountsRaw

func (api *API) GetAccountsRaw(accountNames []string) (*json.RawMessage, error)

func (*API) GetActiveCategoriesRaw

func (api *API) GetActiveCategoriesRaw(after string, limit uint32) (*json.RawMessage, error)

func (*API) GetActiveVotes added in v0.3.0

func (api *API) GetActiveVotes(author, permlink string) ([]*VoteState, error)

func (*API) GetActiveVotesRaw

func (api *API) GetActiveVotesRaw(author, permlink string) (*json.RawMessage, error)

func (*API) GetBestCategoriesRaw

func (api *API) GetBestCategoriesRaw(after string, limit uint32) (*json.RawMessage, error)

func (*API) GetBlock

func (api *API) GetBlock(blockNum uint32) (*Block, error)

func (*API) GetBlockHeaderRaw

func (api *API) GetBlockHeaderRaw(blockNum uint32) (*json.RawMessage, error)

func (*API) GetBlockRaw

func (api *API) GetBlockRaw(blockNum uint32) (*json.RawMessage, error)

func (*API) GetChainPropertiesRaw

func (api *API) GetChainPropertiesRaw() (*json.RawMessage, error)

func (*API) GetConfig

func (api *API) GetConfig() (*Config, error)

func (*API) GetConfigRaw

func (api *API) GetConfigRaw() (*json.RawMessage, error)

func (*API) GetContent

func (api *API) GetContent(author, permlink string) (*Content, error)

func (*API) GetContentRaw

func (api *API) GetContentRaw(author, permlink string) (*json.RawMessage, error)

func (*API) GetContentReplies

func (api *API) GetContentReplies(parentAuthor, parentPermlink string) ([]*Content, error)

func (*API) GetContentRepliesRaw

func (api *API) GetContentRepliesRaw(parentAuthor, parentPermlink string) (*json.RawMessage, error)

func (*API) GetConversionRequestsRaw

func (api *API) GetConversionRequestsRaw(accountName string) (*json.RawMessage, error)

func (*API) GetCurrentMedianHistoryPriceRaw

func (api *API) GetCurrentMedianHistoryPriceRaw() (*json.RawMessage, error)

func (*API) GetDiscussionsByActiveRaw

func (api *API) GetDiscussionsByActiveRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByCashoutRaw

func (api *API) GetDiscussionsByCashoutRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByChildrenRaw

func (api *API) GetDiscussionsByChildrenRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByCreatedRaw

func (api *API) GetDiscussionsByCreatedRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByHotRaw

func (api *API) GetDiscussionsByHotRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByPayoutRaw

func (api *API) GetDiscussionsByPayoutRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByTrendingRaw

func (api *API) GetDiscussionsByTrendingRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByVotesRaw

func (api *API) GetDiscussionsByVotesRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDynamicGlobalProperties

func (api *API) GetDynamicGlobalProperties() (*DynamicGlobalProperties, error)

func (*API) GetDynamicGlobalPropertiesRaw

func (api *API) GetDynamicGlobalPropertiesRaw() (*json.RawMessage, error)

func (*API) GetFeedHistoryRaw

func (api *API) GetFeedHistoryRaw() (*json.RawMessage, error)

func (*API) GetHardforkVersion

func (api *API) GetHardforkVersion() (string, error)

func (*API) GetHardforkVersionRaw

func (api *API) GetHardforkVersionRaw() (*json.RawMessage, error)

func (*API) GetNextScheduledHardforkRaw

func (api *API) GetNextScheduledHardforkRaw() (*json.RawMessage, error)

func (*API) GetOpsInBlock added in v0.5.0

func (api *API) GetOpsInBlock(blockNum uint32, onlyVirtual bool) ([]*types.OperationObject, error)

func (*API) GetOpsInBlockRaw added in v0.5.0

func (api *API) GetOpsInBlockRaw(blockNum uint32, onlyVirtual bool) (*json.RawMessage, error)

func (*API) GetOrderBookRaw

func (api *API) GetOrderBookRaw(limit uint32) (*json.RawMessage, error)

func (*API) GetRecentCategoriesRaw

func (api *API) GetRecentCategoriesRaw(after string, limit uint32) (*json.RawMessage, error)

func (*API) GetRecommendedForRaw

func (api *API) GetRecommendedForRaw(user string, limit uint32) (*json.RawMessage, error)

func (*API) GetRepliesByLastUpdateRaw

func (api *API) GetRepliesByLastUpdateRaw(
	startAuthor string,
	startPermlink string,
	limit uint32,
) (*json.RawMessage, error)

func (*API) GetStateRaw

func (api *API) GetStateRaw(path string) (*json.RawMessage, error)

func (*API) GetTrendingCategoriesRaw

func (api *API) GetTrendingCategoriesRaw(after string, limit uint32) (*json.RawMessage, error)

func (*API) GetTrendingTagsRaw

func (api *API) GetTrendingTagsRaw(afterTag string, limit uint32) (*json.RawMessage, error)

func (*API) GetWitnessScheduleRaw

func (api *API) GetWitnessScheduleRaw() (*json.RawMessage, error)

func (*API) LookupAccountNamesRaw

func (api *API) LookupAccountNamesRaw(accountNames []string) (*json.RawMessage, error)

func (*API) LookupAccountsRaw

func (api *API) LookupAccountsRaw(lowerBoundName string, limit uint32) (*json.RawMessage, error)

type Block

type Block struct {
	Number                uint32               `json:"-"`
	Timestamp             *types.Time          `json:"timestamp"`
	Witness               string               `json:"witness"`
	WitnessSignature      string               `json:"witness_signature"`
	TransactionMerkleRoot string               `json:"transaction_merkle_root"`
	Previous              string               `json:"previous"`
	Extensions            [][]interface{}      `json:"extensions"`
	Transactions          []*types.Transaction `json:"transactions"`
}

type Config

type Config struct {
	SteemitBlockchainHardforkVersion string `json:"STEEMIT_BLOCKCHAIN_HARDFORK_VERSION"`
	SteemitBlockchainVersion         string `json:"STEEMIT_BLOCKCHAIN_VERSION"`
	SteemitBlockInterval             uint   `json:"STEEMIT_BLOCK_INTERVAL"`
}

type Content

type Content struct {
	Id                      *types.ID        `json:"id"`
	RootTitle               string           `json:"root_title"`
	Active                  *types.Time      `json:"active"`
	AbsRshares              *types.Int       `json:"abs_rshares"`
	PendingPayoutValue      string           `json:"pending_payout_value"`
	TotalPendingPayoutValue string           `json:"total_pending_payout_value"`
	Category                string           `json:"category"`
	Title                   string           `json:"title"`
	LastUpdate              *types.Time      `json:"last_update"`
	Stats                   string           `json:"stats"`
	Body                    string           `json:"body"`
	Created                 *types.Time      `json:"created"`
	Replies                 []*Content       `json:"replies"`
	Permlink                string           `json:"permlink"`
	JsonMetadata            *ContentMetadata `json:"json_metadata"`
	Children                *types.Int       `json:"children"`
	NetRshares              *types.Int       `json:"net_rshares"`
	URL                     string           `json:"url"`
	ActiveVotes             []*VoteState     `json:"active_votes"`
	ParentPermlink          string           `json:"parent_permlink"`
	CashoutTime             *types.Time      `json:"cashout_time"`
	TotalPayoutValue        string           `json:"total_payout_value"`
	ParentAuthor            string           `json:"parent_author"`
	ChildrenRshares2        *types.Int       `json:"children_rshares2"`
	Author                  string           `json:"author"`
	Depth                   *types.Int       `json:"depth"`
	TotalVoteWeight         *types.Int       `json:"total_vote_weight"`
}

func (*Content) IsStory

func (content *Content) IsStory() bool

type ContentMetadata

type ContentMetadata struct {
	Flag  bool
	Value string
	Users []string
	Tags  []string
	Image []string
}

func (*ContentMetadata) UnmarshalJSON

func (metadata *ContentMetadata) UnmarshalJSON(data []byte) error

type ContentMetadataRaw

type ContentMetadataRaw struct {
	Users types.StringSlice `json:"users"`
	Tags  types.StringSlice `json:"tags"`
	Image types.StringSlice `json:"image"`
}

type DiscussionQuery

type DiscussionQuery struct {
	Tag   string `json:"tag"`
	Limit uint32 `json:"limit"`
	// XXX: Not sure about the type here.
	FilterTags     []string `json:"filter_tags"`
	StartAuthor    string   `json:"start_author,omitempty"`
	StartPermlink  string   `json:"start_permlink,omitempty"`
	ParentAuthor   string   `json:"parent_author,omitempty"`
	ParentPermlink string   `json:"parent_permlink"`
}

type DynamicGlobalProperties

type DynamicGlobalProperties struct {
	Time                     *types.Time  `json:"time"`
	TotalPow                 *types.Int   `json:"total_pow"`
	NumPowWitnesses          *types.Int   `json:"num_pow_witnesses"`
	CurrentReserveRatio      *types.Int   `json:"current_reserve_ratio"`
	ID                       *types.ID    `json:"id"`
	CurrentSupply            string       `json:"current_supply"`
	CurrentSBDSupply         string       `json:"current_sbd_supply"`
	MaximumBlockSize         *types.Int   `json:"maximum_block_size"`
	RecentSlotsFilled        *types.Int   `json:"recent_slots_filled"`
	CurrentWitness           string       `json:"current_witness"`
	TotalRewardShares2       *types.Int   `json:"total_reward_shares2"`
	AverageBlockSize         *types.Int   `json:"average_block_size"`
	CurrentAslot             *types.Int   `json:"current_aslot"`
	LastIrreversibleBlockNum uint32       `json:"last_irreversible_block_num"`
	TotalVestingShares       string       `json:"total_vesting_shares"`
	TotalVersingFundSteem    string       `json:"total_vesting_fund_steem"`
	HeadBlockID              string       `json:"head_block_id"`
	HeadBlockNumber          types.UInt32 `json:"head_block_number"`
	VirtualSupply            string       `json:"virtual_supply"`
	ConfidentialSupply       string       `json:"confidential_supply"`
	ConfidentialSBDSupply    string       `json:"confidential_sbd_supply"`
	TotalRewardFundSteem     string       `json:"total_reward_fund_steem"`
	TotalActivityFundSteem   string       `json:"total_activity_fund_steem"`
	TotalActivityFundShares  *types.Int   `json:"total_activity_fund_shares"`
	SBDInterestRate          *types.Int   `json:"sbd_interest_rate"`
	MaxVirtualBandwidth      *types.Int   `json:"max_virtual_bandwidth"`
}

type VoteState added in v0.3.0

type VoteState struct {
	Voter   string      `json:"voter"`
	Weight  *types.Int  `json:"weight"`
	Rshares *types.Int  `json:"rshares"`
	Percent *types.Int  `json:"percent"`
	Time    *types.Time `json:"time"`
}

Jump to

Keyboard shortcuts

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