go: github.com/stellar/go/protocols/stellarcore Index | Files

package stellarcore

import "github.com/stellar/go/protocols/stellarcore"

Index

Package Files

info_response.go tx_response.go

Constants

const (
    // TXStatusError represents the status value returned by stellar-core when an error occurred from
    // submitting a transaction
    TXStatusError = "ERROR"

    // TXStatusPending represents the status value returned by stellar-core when a transaction has
    // been accepted for processing
    TXStatusPending = "PENDING"

    // TXStatusDuplicate represents the status value returned by stellar-core when a submitted
    // transaction is a duplicate
    TXStatusDuplicate = "DUPLICATE"

    // TXStatusTryAgainLater represents the status value returned by stellar-core when a submitted
    // transaction was not included in the previous 4 ledgers and get banned for being added in the
    // next few ledgers.
    TXStatusTryAgainLater = "TRY_AGAIN_LATER"
)

type InfoResponse Uses

type InfoResponse struct {
    Info struct {
        Build           string     `json:"build"`
        Network         string     `json:"network"`
        ProtocolVersion int        `json:"protocol_version"`
        State           string     `json:"state"`
        Ledger          LedgerInfo `json:"ledger"`
    }
}

InfoResponse is the json response returned from stellar-core's /info endpoint.

func (*InfoResponse) IsSynced Uses

func (resp *InfoResponse) IsSynced() bool

IsSynced returns a boolean indicating whether stellarcore is synced with the network.

type LedgerInfo Uses

type LedgerInfo struct {
    Age          int    `json:"age"`
    BaseFee      int    `json:"baseFee"`
    BaseReserve  int    `json:"baseReserve"`
    CloseTime    int    `json:"closeTime"`
    Hash         string `json:"hash"`
    MaxTxSetSize int    `json:"maxTxSetSize"`
    Num          int    `json:"num"`
    Version      int    `json:"version"`
}

LedgerInfo is the part of the stellar-core's info json response. It's returned under `ledger` key

type TXResponse Uses

type TXResponse struct {
    Exception string `json:"exception"`
    Error     string `json:"error"`
    Status    string `json:"status"`
}

TXResponse represents the response returned from a submission request sent to stellar-core's /tx endpoint

func (*TXResponse) IsException Uses

func (resp *TXResponse) IsException() bool

IsException returns true if the response represents an exception response from stellar-core

Package stellarcore is imported by 18 packages. Updated 2019-05-01. Refresh now. Tools for package owners.