github.com/ZuluSpl0it/Sia@v1.3.7/node/api/client/consensus.go (about) 1 package client 2 3 import ( 4 "fmt" 5 6 "github.com/NebulousLabs/Sia/node/api" 7 "github.com/NebulousLabs/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) (cbg api.ConsensusBlocksGet, err error) { 18 err = c.get("/consensus/blocks?id="+id.String(), &cbg) 19 return 20 } 21 22 // ConsensusBlocksHeightGet requests the /consensus/blocks api resource 23 func (c *Client) ConsensusBlocksHeightGet(height types.BlockHeight) (cbg api.ConsensusBlocksGet, err error) { 24 err = c.get("/consensus/blocks?height="+fmt.Sprint(height), &cbg) 25 return 26 }