diff options
Diffstat (limited to 'daemon/algod/api/client/restClient.go')
-rw-r--r-- | daemon/algod/api/client/restClient.go | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/daemon/algod/api/client/restClient.go b/daemon/algod/api/client/restClient.go index 626bec0b7..f57c0d0be 100644 --- a/daemon/algod/api/client/restClient.go +++ b/daemon/algod/api/client/restClient.go @@ -59,9 +59,10 @@ const ( // rawRequestPaths is a set of paths where the body should not be urlencoded var rawRequestPaths = map[string]bool{ - "/v1/transactions": true, - "/v2/teal/dryrun": true, - "/v2/teal/compile": true, + "/v1/transactions": true, + "/v2/teal/dryrun": true, + "/v2/teal/compile": true, + "/v2/participation": true, } // unauthorizedRequestError is generated when we receive 401 error from the server. This error includes the inner error @@ -604,3 +605,21 @@ func (client RestClient) Proof(txid string, round uint64) (response generatedV2. err = client.get(&response, fmt.Sprintf("/v2/blocks/%d/transactions/%s/proof", round, txid), nil) return } + +// PostParticipationKey sends a key file to the node. +func (client RestClient) PostParticipationKey(file []byte) (response generatedV2.PostParticipationResponse, err error) { + err = client.post(&response, "/v2/participation", file) + return +} + +// GetParticipationKeys gets all of the participation keys +func (client RestClient) GetParticipationKeys() (response generatedV2.ParticipationKeysResponse, err error) { + err = client.get(&response, "/v2/participation", nil) + return +} + +// GetParticipationKeyByID gets a single participation key +func (client RestClient) GetParticipationKeyByID(participationID string) (response generatedV2.ParticipationKeyResponse, err error) { + err = client.get(&response, fmt.Sprintf("/v2/participation/%s", participationID), nil) + return +} |