github.com/Synthesix/Sia@v1.3.3-0.20180413141344-f863baeed3ca/node/api/client/consensus.go (about) 1 package client 2 3 import ( 4 "fmt" 5 6 "github.com/Synthesix/Sia/node/api" 7 "github.com/Synthesix/Sia/types" 8 ) 9 10 // ConsensusGet requests the /consensus api resource 11 func (c *Client) ConsensusGet() (cg api.ConsensusGET, err error) { 12 err = c.get("/consensus", &cg) 13 return 14 } 15 16 // ConsensusBlocksIDGet requests the /consensus/blocks api resource 17 func (c *Client) ConsensusBlocksIDGet(id types.BlockID) (block types.Block, err error) { 18 err = c.get("/consensus/blocks?id="+id.String(), &block) 19 return 20 } 21 22 // ConsensusBlocksHeightGet requests the /consensus/blocks api resource 23 func (c *Client) ConsensusBlocksHeightGet(height types.BlockHeight) (block types.Block, err error) { 24 err = c.get("/consensus/blocks?height="+fmt.Sprint(height), &block) 25 return 26 }