Documentation ¶
Index ¶
- func NewServer(g Syncer, chain ChainManager, tp TPool, bench Benchmark, wallet Wallet, ...) http.Handler
- type Benchmark
- type BenchmarkRequest
- type ChainManager
- type ConsensusState
- type Peer
- type ScanRequest
- type Syncer
- type SyncerConnectRequest
- type TPool
- type Wallet
- type WalletResponse
- type WalletSendSiacoinsRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Benchmark ¶
type Benchmark interface { BenchmarkHost(ctx context.Context, hostAddr string, hostKey types.PublicKey, sectors uint64) (benchmark.Result, error) ScanHost(ctx context.Context, hostAddr string, hostKey types.PublicKey) (benchmark.Settings, error) }
A Benchmark benchmarks hosts and manages contracts
type BenchmarkRequest ¶
type BenchmarkRequest struct { Address string `json:"address"` HostKey types.PublicKey `json:"hostKey"` Sectors uint64 `json:"sectors"` }
A BenchmarkRequest initiates a benchmark with a host
type ChainManager ¶
A ChainManager retrieves the current blockchain state
type ConsensusState ¶
type ConsensusState struct { Synced bool `json:"synced"` ChainIndex types.ChainIndex `json:"chainIndex"` }
ConsensusState is the response body for the [GET] /consensus endpoint.
type ScanRequest ¶
type ScanRequest struct { Address string `json:"address"` HostKey types.PublicKey `json:"hostKey"` }
A ScanRequest scans a host's settings and price table
type Syncer ¶
type Syncer interface { Address() modules.NetAddress Peers() []modules.Peer Connect(addr modules.NetAddress) error Disconnect(addr modules.NetAddress) error }
A Syncer can connect to other peers and synchronize the blockchain.
type SyncerConnectRequest ¶
type SyncerConnectRequest struct {
Address string `json:"address"`
}
SyncerConnectRequest is the request body for the [PUT] /syncer/peers endpoint.
type TPool ¶
type TPool interface { RecommendedFee() (fee types.Currency) AcceptTransactionSet(txns []types.Transaction) error }
A TPool manages the transaction pool
type Wallet ¶
type Wallet interface { Address() types.Address ScanHeight() uint64 Balance() (spendable, confirmed, unconfirmed types.Currency, err error) UnconfirmedTransactions() ([]wallet.Transaction, error) FundTransaction(txn *types.Transaction, amount types.Currency) (toSign []types.Hash256, release func(), err error) SignTransaction(cs consensus.State, txn *types.Transaction, toSign []types.Hash256, cf types.CoveredFields) error Transactions(limit, offset int) ([]wallet.Transaction, error) }
A Wallet manages Siacoins and funds transactions
type WalletResponse ¶
type WalletResponse struct { ScanHeight uint64 `json:"scanHeight"` Address types.Address `json:"address"` Spendable types.Currency `json:"spendable"` Confirmed types.Currency `json:"confirmed"` Unconfirmed types.Currency `json:"unconfirmed"` }
WalletResponse is the response body for the [GET] /wallet endpoint.
Click to show internal directories.
Click to hide internal directories.