wsapi

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 36 Imported by: 20

Documentation

Index

Constants

View Source
const (
	AckStatusInvalid         = "Invalid"
	AckStatusUnknown         = "Unknown"
	AckStatusNotConfirmed    = "NotConfirmed"
	AckStatusACK             = "TransactionACK"
	AckStatus1Minute         = "1Minute"
	AckStatusDBlockConfirmed = "DBlockConfirmed"
)
View Source
const API_VERSION string = "2.0"

Variables

View Source
var (
	GensisFblockCall = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "factomd_wsapi_v2_gensis_fblock_count",
		Help: "Number of times the gensis Fblock is asked for",
	})

	HandleV2APICallGeneral = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_general_call_ns",
		Help: "Time it takes to compelete a call",
	})

	HandleV2APICallChainHead = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_chainhead_ns",
		Help: "Time it takes to compelete a chainhead",
	})

	HandleV2APICallCommitChain = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_commitchain_ns",
		Help: "Time it takes to compelete a commithcain",
	})

	HandleV2APICallCommitEntry = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_commitentry_ns",
		Help: "Time it takes to compelete a commitentry",
	})

	HandleV2APICallDBlock = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_dblock_ns",
		Help: "Time it takes to compelete a dblock",
	})

	HandleV2APICallDBlockHead = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_dblockhead_ns",
		Help: "Time it takes to compelete a dblockhead",
	})

	HandleV2APICallEblock = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_eblock_ns",
		Help: "Time it takes to compelete a eblock",
	})

	HandleV2APICallAblock = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_ablock_ns",
		Help: "Time it takes to compelete a eblock",
	})

	HandleV2APICallEntry = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_entry_ns",
		Help: "Time it takes to compelete an entry",
	})

	HandleV2APICallECBal = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_ecbal_ns",
		Help: "Time it takes to compelete a ecbal",
	})

	HandleV2APICallECRate = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_ecrate_ns",
		Help: "Time it takes to compelete a ecrate",
	})

	HandleV2APICallFABal = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_fabal_ns",
		Help: "Time it takes to compelete a fabal",
	})

	HandleV2APICallFctTx = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_fcttx_ns",
		Help: "Time it takes to compelete a fcttx",
	})

	HandleV2APICallHeights = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_heights_ns",
		Help: "Time it takes to compelete a heights",
	})

	HandleV2APICallCurrentMinute = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_minute_ns",
		Help: "Time it takes to compelete a minute",
	})

	HandleV2APICallProp = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_prop_ns",
		Help: "Time it takes to compelete a prop",
	})

	HandleV2APICallRawData = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_rawdata_ns",
		Help: "Time it takes to compelete a rawdata",
	})

	HandleV2APICallAnchors = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_anchors_ns",
		Help: "Time it takes to compelete a ",
	})

	HandleV2APICallReceipt = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_receipt_ns",
		Help: "Time it takes to compelete a ",
	})

	HandleV2APICallRevealEntry = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_reventry_ns",
		Help: "Time it takes to compelete a revealentry",
	})

	HandleV2APICallFctAck = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_fctack_ns",
		Help: "Time it takes to compelete a fctack",
	})

	HandleV2APICallEntryAck = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_entryack_ns",
		Help: "Time it takes to compelete a entryack",
	})

	HandleV2APICall = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call__ns",
		Help: "Time it takes to compelete a ",
	})

	HandleV2APICallPendingEntries = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_pendingentries_ns",
		Help: "Time it takes to compelete a pendingentries",
	})

	HandleV2APICallPendingTxs = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_pendingtxs_ns",
		Help: "Time it takes to compelete a pendingtxs",
	})

	HandleV2APICallSendRaw = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_sendraw_ns",
		Help: "Time it takes to compelete a sendraw",
	})

	HandleV2APICallTransaction = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_tx_ns",
		Help: "Time it takes to compelete a tx",
	})

	HandleV2APICallReplayDBFromHeight = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_replay_from_height",
		Help: "Time it takes to replay DBStates from a specific height",
	})

	HandleV2APICallDBlockByHeight = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_dblockbyheight_ns",
		Help: "Time it takes to compelete a dblockbyheight",
	})

	HandleV2APICallECBlockByHeight = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_ecblockbyheight_ns",
		Help: "Time it takes to compelete a ecblockbyheight",
	})

	HandleV2APICallECBlock = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_ecblock_ns",
		Help: "Time it takes to compelete a ecblock",
	})

	HandleV2APICallFblockByHeight = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_fblockbyheight_ns",
		Help: "Time it takes to compelete a fblockbyheight",
	})

	HandleV2APICallFblock = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_fblock_ns",
		Help: "Time it takes to compelete a fblock",
	})

	HandleV2APICallABlockByHeight = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_ablockbyheight_ns",
		Help: "Time it takes to compelete a ablockbyheight",
	})

	HandleV2APICallAuthorities = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_auths_ns",
		Help: "Time it takes to compelete an auths ",
	})

	HandleV2APICallTpsRate = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "factomd_wsapi_v2_api_call_tpsrate_ns",
		Help: "Time it takes to compelete a tpsrate",
	})
)
View Source
var Servers map[string]*Server
View Source
var ServersMutex sync.Mutex

Functions

func DecodeTransactionToHashes

func DecodeTransactionToHashes(fullTransaction string) (eTxID string, ecTxID string)

func ECBlockToResp

func ECBlockToResp(block interfaces.IEntryCreditBlock, includeRaw bool) (interface{}, *primitives.JSONError)

func GetState

func GetState(r *http.Request) (state interfaces.IState, err error)

func HandleABlockByHeight

func HandleABlockByHeight(writer http.ResponseWriter, request *http.Request)

func HandleAuditServers

func HandleAuditServers(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleAuthorities

func HandleAuthorities(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleChainHead

func HandleChainHead(writer http.ResponseWriter, request *http.Request)

func HandleCommitChain

func HandleCommitChain(writer http.ResponseWriter, request *http.Request)

func HandleCommitEntry

func HandleCommitEntry(writer http.ResponseWriter, request *http.Request)

func HandleConfig

func HandleConfig(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleCurrentMinute

func HandleCurrentMinute(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleDBlockByHeight

func HandleDBlockByHeight(writer http.ResponseWriter, request *http.Request)

func HandleDebug

func HandleDebug(writer http.ResponseWriter, request *http.Request)

func HandleDelay

func HandleDelay(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleDirectoryBlock

func HandleDirectoryBlock(writer http.ResponseWriter, request *http.Request)

func HandleDirectoryBlockHead

func HandleDirectoryBlockHead(writer http.ResponseWriter, request *http.Request)

func HandleDirectoryBlockHeight

func HandleDirectoryBlockHeight(writer http.ResponseWriter, request *http.Request)

func HandleDropRate

func HandleDropRate(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleECBlockByHeight

func HandleECBlockByHeight(writer http.ResponseWriter, request *http.Request)

func HandleEntry

func HandleEntry(writer http.ResponseWriter, request *http.Request)

func HandleEntryBlock

func HandleEntryBlock(writer http.ResponseWriter, request *http.Request)

func HandleEntryCreditBalance

func HandleEntryCreditBalance(writer http.ResponseWriter, request *http.Request)

func HandleFBlockByHeight

func HandleFBlockByHeight(writer http.ResponseWriter, request *http.Request)

func HandleFactoidBalance

func HandleFactoidBalance(writer http.ResponseWriter, request *http.Request)

func HandleFactoidSubmit

func HandleFactoidSubmit(writer http.ResponseWriter, request *http.Request)

func HandleFedServers

func HandleFedServers(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleGetFee

func HandleGetFee(writer http.ResponseWriter, request *http.Request)

func HandleGetRaw

func HandleGetRaw(writer http.ResponseWriter, request *http.Request)

func HandleGetReceipt

func HandleGetReceipt(writer http.ResponseWriter, request *http.Request)

func HandleHeights

func HandleHeights(writer http.ResponseWriter, request *http.Request)

func HandleHoldingQueue

func HandleHoldingQueue(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleMessageFilter

func HandleMessageFilter(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleMessages

func HandleMessages(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleNetworkInfo

func HandleNetworkInfo(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandlePredictiveFER

func HandlePredictiveFER(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleProcessList

func HandleProcessList(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleProperties

func HandleProperties(writer http.ResponseWriter, request *http.Request)

func HandleReloadConfig

func HandleReloadConfig(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleRevealChain

func HandleRevealChain(writer http.ResponseWriter, request *http.Request)

func HandleRevealEntry

func HandleRevealEntry(writer http.ResponseWriter, request *http.Request)

func HandleSetDelay

func HandleSetDelay(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleSetDropRate

func HandleSetDropRate(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleSimControl

func HandleSimControl(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleSummary

func HandleSummary(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2

func HandleV2(writer http.ResponseWriter, request *http.Request)

func HandleV2ABlockByHeight

func HandleV2ABlockByHeight(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2ACKWithChain

func HandleV2ACKWithChain(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

HandleV2ACKWithChain is the ack call with a given chainID. The chainID serves as a directive on what type of hash we are given, and we can act appropriately.

func HandleV2AdminBlock

func HandleV2AdminBlock(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2Anchors

func HandleV2Anchors(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2ChainHead

func HandleV2ChainHead(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2CommitChain

func HandleV2CommitChain(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2CommitEntry

func HandleV2CommitEntry(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2CurrentMinute

func HandleV2CurrentMinute(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2DBlockByHeight

func HandleV2DBlockByHeight(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2Diagnostics

func HandleV2Diagnostics(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2DirectoryBlock

func HandleV2DirectoryBlock(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2DirectoryBlockHead

func HandleV2DirectoryBlockHead(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2ECBlockByHeight

func HandleV2ECBlockByHeight(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2Entry

func HandleV2Entry(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2EntryACK

func HandleV2EntryACK(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2EntryBlock

func HandleV2EntryBlock(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2EntryCreditBalance

func HandleV2EntryCreditBalance(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2EntryCreditBlock

func HandleV2EntryCreditBlock(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2EntryCreditRate

func HandleV2EntryCreditRate(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2Error

func HandleV2Error(writer http.ResponseWriter, j *primitives.JSON2Request, jErr *primitives.JSONError)

func HandleV2FBlockByHeight

func HandleV2FBlockByHeight(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2FactoidACK

func HandleV2FactoidACK(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2FactoidBalance

func HandleV2FactoidBalance(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2FactoidBlock

func HandleV2FactoidBlock(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2FactoidSubmit

func HandleV2FactoidSubmit(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2GetPendingEntries

func HandleV2GetPendingEntries(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2GetPendingTransactions

func HandleV2GetPendingTransactions(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2GetTranasction

func HandleV2GetTranasction(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2Heights

func HandleV2Heights(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2MultipleECBalances

func HandleV2MultipleECBalances(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2MultipleFCTBalances

func HandleV2MultipleFCTBalances(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2Properties

func HandleV2Properties(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2RawData

func HandleV2RawData(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2Receipt

func HandleV2Receipt(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2ReplayDBFromHeight

func HandleV2ReplayDBFromHeight(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2RevealChain

func HandleV2RevealChain(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2RevealEntry

func HandleV2RevealEntry(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2SendRawMessage

func HandleV2SendRawMessage(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleV2TransactionRate

func HandleV2TransactionRate(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleWaitBlocks

func HandleWaitBlocks(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleWaitForBlock

func HandleWaitForBlock(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleWaitForMinute

func HandleWaitForMinute(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleWaitMinutes

func HandleWaitMinutes(s interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func HandleWriteConfig

func HandleWriteConfig(state interfaces.IState, params interface{}) (interface{}, *primitives.JSONError)

func InitLogs

func InitLogs(logPath, logLevel string)

func MapToObject

func MapToObject(source interface{}, dst interface{}) error

func NewBlockNotFoundError

func NewBlockNotFoundError() *primitives.JSONError

http://www.jsonrpc.org/specification : -32000 to -32099 error codes are reserved for implementation-defined server-errors.

func NewCustomInternalError

func NewCustomInternalError(data interface{}) *primitives.JSONError

*****************************************************************

func NewCustomInvalidParamsError

func NewCustomInvalidParamsError(data interface{}) *primitives.JSONError

func NewEntryNotFoundError

func NewEntryNotFoundError() *primitives.JSONError

func NewInternalDatabaseError

func NewInternalDatabaseError() *primitives.JSONError

func NewInternalError

func NewInternalError() *primitives.JSONError

func NewInvalidAddressError

func NewInvalidAddressError() *primitives.JSONError

func NewInvalidCommitChainError

func NewInvalidCommitChainError() *primitives.JSONError

func NewInvalidCommitEntryError

func NewInvalidCommitEntryError() *primitives.JSONError

func NewInvalidDataPassedError

func NewInvalidDataPassedError() *primitives.JSONError

func NewInvalidEntryError

func NewInvalidEntryError() *primitives.JSONError

func NewInvalidHashError

func NewInvalidHashError() *primitives.JSONError

func NewInvalidHeightError

func NewInvalidHeightError() *primitives.JSONError

func NewInvalidParamsError

func NewInvalidParamsError() *primitives.JSONError

func NewInvalidRequestError

func NewInvalidRequestError() *primitives.JSONError

func NewInvalidTransactionError

func NewInvalidTransactionError() *primitives.JSONError

func NewInvertedHeightError

func NewInvertedHeightError() *primitives.JSONError

func NewLogFromConfig

func NewLogFromConfig(logPath, logLevel, prefix string) *log.Entry

NewLogFromConfig outputs logs to a file given by logpath

func NewMethodNotFoundError

func NewMethodNotFoundError() *primitives.JSONError

func NewMissingChainHeadError

func NewMissingChainHeadError() *primitives.JSONError

func NewObjectNotFoundError

func NewObjectNotFoundError() *primitives.JSONError

func NewParseError

func NewParseError() *primitives.JSONError

func NewReceiptError

func NewReceiptError() *primitives.JSONError

func NewRepeatCommitError

func NewRepeatCommitError(data interface{}) *primitives.JSONError

func NewUnableToDecodeTransactionError

func NewUnableToDecodeTransactionError() *primitives.JSONError

func RegisterPrometheus

func RegisterPrometheus()

RegisterPrometheus registers the variables to be exposed. This can only be run once, hence the boolean flag to prevent panics if launched more than once. This is called in NetStart

func SetState

func SetState(state interfaces.IState)

func Start

func Start(state interfaces.IState)

func Stop

func Stop(state interfaces.IState)

Types

type AckRequest

type AckRequest struct {
	TxID            string `json:"txid,omitempty"`
	FullTransaction string `json:"fulltransaction,omitempty"`
}

type AddressRequest

type AddressRequest struct {
	Address string `json:"address"`
}

type AnchorsResponse

type AnchorsResponse struct {
	Height   uint32      `json:"directoryblockheight"`
	KeyMR    string      `json:"directoryblockkeymr"`
	Bitcoin  interface{} `json:"bitcoin"`
	Ethereum interface{} `json:"ethereum"`
}

For each chain: false or chain specific anchor response

type AuditStatus

type AuditStatus struct {
	ID     string `json:"id"`
	Online bool   `json:"online"`
}

type AuthSet

type AuthSet struct {
	Leaders []LeaderStatus `json:"leaders"`
	Audits  []AuditStatus  `json:"audits"`
}

type BitcoinAnchorResponse

type BitcoinAnchorResponse struct {
	TransactionHash string `json:"transactionhash"`
	BlockHash       string `json:"blockhash"`
}

type BlockHeightResponse

type BlockHeightResponse struct {
	DBlock  *JStruct `json:"dblock,omitempty"`
	ABlock  *JStruct `json:"ablock,omitempty"`
	FBlock  *JStruct `json:"fblock,omitempty"`
	ECBlock *JStruct `json:"ecblock,omitempty"`
	RawData string   `json:"rawdata,omitempty"`
}

type CHead

type CHead struct {
	ChainHead string `json:"chainhead"`
}

func (*CHead) JSONString

func (e *CHead) JSONString() (string, error)

type ChainHeadResponse

type ChainHeadResponse struct {
	ChainHead          string `json:"chainhead"`
	ChainInProcessList bool   `json:"chaininprocesslist"`
}

type ChainIDRequest

type ChainIDRequest struct {
	ChainID string `json:"chainid"`
}

type CommitChainResponse

type CommitChainResponse struct {
	Message     string `json:"message"`
	TxID        string `json:"txid"`
	EntryHash   string `json:"entryhash,omitempty"`
	ChainIDHash string `json:"chainidhash,omitempty"`
}

type CommitEntryResponse

type CommitEntryResponse struct {
	Message   string `json:"message"`
	TxID      string `json:"txid"`
	EntryHash string `json:"entryhash,omitempty"`
}

type CurrentMinuteResponse

type CurrentMinuteResponse struct {
	LeaderHeight            int64 `json:"leaderheight"`
	DirectoryBlockHeight    int64 `json:"directoryblockheight"`
	Minute                  int64 `json:"minute"`
	CurrentBlockStartTime   int64 `json:"currentblockstarttime"`
	CurrentMinuteStartTime  int64 `json:"currentminutestarttime"`
	CurrentTime             int64 `json:"currenttime"`
	DirectoryBlockInSeconds int64 `json:"directoryblockinseconds"`
	StallDetected           bool  `json:"stalldetected"`
	FaultTimeOut            int64 `json:"faulttimeout"`
	RoundTimeOut            int64 `json:"roundtimeout"`
}

type DBHead

type DBHead struct {
	KeyMR string `json:"keymr"`
}

type DBlock

type DBlock struct {
	Header struct {
		PrevBlockKeyMR string `json:"prevblockkeymr"`
		SequenceNumber int64  `json:"sequencenumber"`
		Timestamp      int64  `json:"timestamp"`
	} `json:"header"`
	EntryBlockList []EBlockAddr `json:"entryblocklist"`
}

func (*DBlock) JSONString

func (e *DBlock) JSONString() (string, error)

type DiagnosticsResponse

type DiagnosticsResponse struct {
	Name      string `json:"name"`
	ID        string `json:"id,omitempty"`
	PublicKey string `json:"publickey,omitempty"`
	Role      string `json:"role"`

	LeaderHeight          uint32 `json:"leaderheight"`
	CurrentMinute         int    `json:"currentminute"`
	CurrentMinuteDuration int64  `json:"currentminuteduration"`
	PrevMinuteDuration    int64  `json:"previousminuteduration"`
	BalanceHash           string `json:"balancehash"`
	TempBalanceHash       string `json:"tempbalancehash"`
	LastBlockFromDBState  bool   `json:"lastblockfromdbstate"`

	SyncInfo     *SyncInfo     `json:"syncing"`
	AuthSet      *AuthSet      `json:"authset"`
	ElectionInfo *ElectionInfo `json:"elections"`
}

type DirectoryBlockHeadResponse

type DirectoryBlockHeadResponse struct {
	KeyMR string `json:"keymr"`
}

type DirectoryBlockResponse

type DirectoryBlockResponse struct {
	Header struct {
		PrevBlockKeyMR string `json:"prevblockkeymr"`
		SequenceNumber int64  `json:"sequencenumber"`
		Timestamp      int64  `json:"timestamp"`
	} `json:"header"`
	EntryBlockList []EBlockAddr `json:"entryblocklist"`
}

type EBlock

type EBlock struct {
	Header struct {
		BlockSequenceNumber int64  `json:"blocksequencenumber"`
		ChainID             string `json:"chainid"`
		PrevKeyMR           string `json:"prevkeymr"`
		Timestamp           int64  `json:"timestamp"`
		DBHeight            int64  `json:"dbheight"`
	} `json:"header"`
	EntryList []EntryAddr `json:"entrylist"`
}

func (*EBlock) JSONString

func (e *EBlock) JSONString() (string, error)

type EBlockAddr

type EBlockAddr struct {
	ChainID string `json:"chainid"`
	KeyMR   string `json:"keymr"`
}

type ElectionInfo

type ElectionInfo struct {
	InProgress bool   `json:"inprogress"`
	VmIndex    *int   `json:"vmindex,omitempty"`
	FedIndex   *int   `json:"fedindex,omitempty"`
	FedID      string `json:"fedid,omitempty"`
	Round      *int   `json:"round,omitempty"`
}

type EntryAckWithChainRequest

type EntryAckWithChainRequest struct {
	Hash            string `json:"hash,omitempty"`
	ChainID         string `json:"chainid,omitempty"`
	FullTransaction string `json:"fulltransaction,omitempty"`
}

type EntryAddr

type EntryAddr struct {
	EntryHash string `json:"entryhash"`
	Timestamp int64  `json:"timestamp"`
}

type EntryBlockResponse

type EntryBlockResponse struct {
	Header struct {
		BlockSequenceNumber int64  `json:"blocksequencenumber"`
		ChainID             string `json:"chainid"`
		PrevKeyMR           string `json:"prevkeymr"`
		Timestamp           int64  `json:"timestamp"`
		DBHeight            int64  `json:"dbheight"`
	} `json:"header"`
	EntryList []EntryAddr `json:"entrylist"`
}

type EntryCreditBalanceResponse

type EntryCreditBalanceResponse struct {
	Balance int64 `json:"balance"`
}

type EntryCreditBlockResponse

type EntryCreditBlockResponse struct {
	ECBlock struct {
		Header     interfaces.IECBlockHeader `json:"header"`
		Body       interfaces.IECBlockBody   `json:"body"`
		HeaderHash interfaces.IHash          `json:"headerhash"`
		FullHash   interfaces.IHash          `json:"fullhash"`
	} `json:"ecblock"`
	RawData string `json:"rawdata"`
}

type EntryCreditRateResponse

type EntryCreditRateResponse struct {
	Rate int64 `json:"rate"`
}

type EntryRequest

type EntryRequest struct {
	Entry string `json:"entry"`
}

type EntryResponse

type EntryResponse struct {
	ChainID string   `json:"chainid"`
	Content string   `json:"content"`
	ExtIDs  []string `json:"extids"`
}

type EntryStatus

type EntryStatus struct {
	CommitTxID string `json:"committxid"`
	EntryHash  string `json:"entryhash"`

	CommitData GeneralTransactionData `json:"commitdata"`
	EntryData  GeneralTransactionData `json:"entrydata"`

	ReserveTransactions          []ReserveInfo `json:"reserveinfo,omitempty"`
	ConflictingRevealEntryHashes []string      `json:"conflictingrevealentryhashes,omitempty"`
}

type EntryStruct

type EntryStruct struct {
	ChainID string   `json:"chainid"`
	Content string   `json:"content"`
	ExtIDs  []string `json:"extids"`
}

func (*EntryStruct) JSONString

func (e *EntryStruct) JSONString() (string, error)

type EthereumAnchorResponse

type EthereumAnchorResponse struct {
	RecordHeight int64                    `json:"recordheight"`
	DBHeightMax  int64                    `json:"dbheightmax"`
	DBHeightMin  int64                    `json:"dbheightmin"`
	WindowMR     string                   `json:"windowmr"`
	MerkleBranch []*primitives.MerkleNode `json:"merklebranch"`

	ContractAddress string `json:"contractaddress"`
	TxID            string `json:"txid"`
	BlockHash       string `json:"blockhash"`
	TxIndex         int64  `json:"txindex"`
}

type FactiodAccounts

type FactiodAccounts struct {
	NumbOfAccounts string   `json:"numberofacc"`
	Height         uint32   `json:"height"`
	Accounts       []string `json:"accounts"`
}

type FactoidBalance

type FactoidBalance struct {
	Response string `json:"response"`
	Success  bool   `json:"success"`
}

type FactoidBalanceResponse

type FactoidBalanceResponse struct {
	Balance int64 `json:"balance"`
}

type FactoidSubmitResponse

type FactoidSubmitResponse struct {
	Message string `json:"message"`
	TxID    string `json:"txid"`
}

type FactoidTxStatus

type FactoidTxStatus struct {
	TxID string `json:"txid"`
	GeneralTransactionData
}

type GeneralTransactionData

type GeneralTransactionData struct {
	TransactionDate       int64  `json:"transactiondate,omitempty"`       //Unix time
	TransactionDateString string `json:"transactiondatestring,omitempty"` //ISO8601 time
	BlockDate             int64  `json:"blockdate,omitempty"`             //Unix time
	BlockDateString       string `json:"blockdatestring,omitempty"`       //ISO8601 time

	Malleated *Malleated `json:"malleated,omitempty"`
	Status    string     `json:"status"`
}

type GetCommands

type GetCommands struct {
	Commands []string `json:"commands"`
}

type HashRequest

type HashRequest struct {
	Hash string `json:"hash"`
}

type HeightOrHashRequest

type HeightOrHashRequest struct {
	Height *int64 `json:"height,omitempty"`
	Hash   string `json:"hash,omitempty"`
}

type HeightRequest

type HeightRequest struct {
	Height int64 `json:"height"`
	NoRaw  bool  `json:"noraw,omitempty"`
}

func (*HeightRequest) IncludeRaw

func (hr *HeightRequest) IncludeRaw() bool

type HeightsResponse

type HeightsResponse struct {
	DirectoryBlockHeight         int64 `json:"directoryblockheight"`
	LeaderHeight                 int64 `json:"leaderheight"`
	EntryBlockHeight             int64 `json:"entryblockheight"`
	EntryHeight                  int64 `json:"entryheight"`
	MissingEntryCount            int64 `json:"-"`
	EntryBlockDBHeightProcessing int64 `json:"-"`
	EntryBlockDBHeightComplete   int64 `json:"-"`
}

type JStruct

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

func ObjectToJStruct

func ObjectToJStruct(source interface{}) (*JStruct, error)

func (*JStruct) MarshalJSON

func (e *JStruct) MarshalJSON() (rval []byte, err error)

func (*JStruct) UnmarshalJSON

func (e *JStruct) UnmarshalJSON(b []byte) error

type KeyMRRequest

type KeyMRRequest struct {
	KeyMR string `json:"keymr"`
	NoRaw bool   `json:"noraw,omitempty"`
}

func (*KeyMRRequest) IncludeRaw

func (kr *KeyMRRequest) IncludeRaw() bool

type KeyRequest

type KeyRequest struct {
	Key string `json:"key"`
}

type LeaderStatus

type LeaderStatus struct {
	ID                string `json:"id"`
	VM                int    `json:"vm"`
	ProcessListHeight int    `json:"listheight"`
	ListLength        int    `json:"listlength"`
	NextNil           int    `json:"nextnil"`
}

type Malleated

type Malleated struct {
	MalleatedTxIDs []string `json:"malleatedtxids"`
}

type MessageFilter

type MessageFilter struct {
	Params string `json:"params"`
}

type MessageRequest

type MessageRequest struct {
	Message string `json:"message"`
}

type Middleware

type Middleware func(http.HandlerFunc) http.HandlerFunc

func APILogger

func APILogger() Middleware

Logging logs all requests with its path and the time it took to process

func CheckHttpPasswordOkV1Middleware

func CheckHttpPasswordOkV1Middleware() Middleware

Check authentication header

func IDInjector

func IDInjector(server *Server) Middleware

IDInjector injects the server's ID into every request as http header

func PanicRecovery

func PanicRecovery() Middleware

type MultipleECBalances

type MultipleECBalances struct {
	CurrentHeight   uint32        `json:"currentheight"`
	LastSavedHeight uint32        `json:"lastsavedheight"`
	Balances        []interface{} `json:"balances"`
}

type MultipleFTBalances

type MultipleFTBalances struct {
	CurrentHeight   uint32        `json:"currentheight"`
	LastSavedHeight uint32        `json:"lastsavedheight"`
	Balances        []interface{} `json:"balances"`
}

type PendingEntry

type PendingEntry struct {
	EntryHash interfaces.IHash `json:"entryhash"`
	ChainID   interfaces.IHash `json:"chainid"`
	Status    string           `json:"status"`
}

type PendingTransaction

type PendingTransaction struct {
	TransactionID interfaces.IHash `json:"transactionid"`
	Status        string           `json:"status"`
}

type PropertiesResponse

type PropertiesResponse struct {
	FactomdVersion string `json:"factomdversion"`
	ApiVersion     string `json:"factomdapiversion"`
}

type RawDataResponse

type RawDataResponse struct {
	Data string `json:"data"`
}

type ReceiptRequest

type ReceiptRequest struct {
	EntryHash       string `json:"hash"`
	IncludeRawEntry bool   `json:"includerawentry"`
}

TODO: kept as "hash" for backwards compatibility (receipt call used to use the HashRequest),

but in API v3 this should specify that its an entry hash

type ReceiptResponse

type ReceiptResponse struct {
	Receipt *receipts.Receipt `json:"receipt"`
}

type RepeatedEntryMessage

type RepeatedEntryMessage struct {
	Information string `json:"info"`
	EntryHash   string `json:"entryhash"`
}

type ReplayRequest

type ReplayRequest struct {
	StartHeight uint32 `json:"startheight"`
	EndHeight   uint32 `json:"endheight,omitempty"`
}

type ReserveInfo

type ReserveInfo struct {
	TxID    string `json:"txid"`
	Timeout int64  `json:"timeout"` //Unix time
}

type RevealChainResponse

type RevealChainResponse struct {
}

type RevealEntryResponse

type RevealEntryResponse struct {
	Message   string `json:"message"`
	EntryHash string `json:"entryhash"`
	ChainID   string `json:"chainid,omitempty"`
}

type SendRawMessageRequest

type SendRawMessageRequest struct {
	Message string `json:"message"`
}

type SendRawMessageResponse

type SendRawMessageResponse struct {
	Message string `json:"message"`
}

type SendReplayMessageResponse

type SendReplayMessageResponse struct {
	Message string `json:"message"`
	Start   uint32 `json:"startheight"`
	End     uint32 `json:"endheight"`
}

type Server

type Server struct {
	State interfaces.IState

	Port string
	// contains filtered or unexported fields
}

func InitServer

func InitServer(state interfaces.IState) *Server

func (*Server) AddRootEndpoints

func (server *Server) AddRootEndpoints()

func (*Server) AddV1Endpoints

func (server *Server) AddV1Endpoints()

func (*Server) AddV2Endpoints

func (server *Server) AddV2Endpoints()

func (*Server) Start

func (server *Server) Start()

func (*Server) Stop

func (server *Server) Stop()

type SetDelayRequest

type SetDelayRequest struct {
	Delay int64 `json:"delay"`
}

type SetDropRateRequest

type SetDropRateRequest struct {
	DropRate int `json:"droprate"`
}

type SyncInfo

type SyncInfo struct {
	Status   string   `json:"status"`
	Received *int     `json:"received,omitempty"`
	Expected *int     `json:"expected,omitempty"`
	Missing  []string `json:"missing,omitempty"`
}

type TransactionRateResponse

type TransactionRateResponse struct {
	TotalTransactionRate   float64 `json:"totaltxrate"`
	InstantTransactionRate float64 `json:"instanttxrate"`
}

type TransactionRequest

type TransactionRequest struct {
	Transaction string `json:"transaction"`
}

type TransactionResponse

type TransactionResponse struct {
	ECTranasction      interfaces.IECBlockEntry `json:"ectransaction,omitempty"`
	FactoidTransaction interfaces.ITransaction  `json:"factoidtransaction,omitempty"`
	Entry              interfaces.IEBEntry      `json:"entry,omitempty"`

	//F/EC/E block the transaction is included in
	IncludedInTransactionBlock string `json:"includedintransactionblock"`
	//DirectoryBlock the tranasction is included in
	IncludedInDirectoryBlock string `json:"includedindirectoryblock"`
	//The DBlock height
	IncludedInDirectoryBlockHeight int64 `json:"includedindirectoryblockheight"`
}

Jump to

Keyboard shortcuts

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