core, rpc: add GetCommittee method

Closes #1414
This commit is contained in:
Anna Shaleva 2020-09-21 15:34:04 +03:00
parent dbfdfd8e9b
commit 770c8d774c
7 changed files with 74 additions and 0 deletions

View file

@ -9,6 +9,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/core/block"
"github.com/nspcc-dev/neo-go/pkg/core/state"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/io"
"github.com/nspcc-dev/neo-go/pkg/rpc/request"
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result"
@ -179,6 +180,18 @@ func (c *Client) GetConnectionCount() (int, error) {
return resp, nil
}
// GetCommittee returns the current public keys of NEO nodes in committee.
func (c *Client) GetCommittee() (keys.PublicKeys, error) {
var (
params = request.NewRawParams()
resp = new(keys.PublicKeys)
)
if err := c.performRequest("getcommittee", params, resp); err != nil {
return nil, err
}
return *resp, nil
}
// GetContractState queries contract information, according to the contract script hash.
func (c *Client) GetContractState(hash util.Uint160) (*state.Contract, error) {
var (