Gnosis Beacon — Config, Debug, Events, Node, Validator (3/3)
API reference for Gnosis Beacon. All methods ->
Validator
GET /eth/v1/validator/aggregate_attestation
Retrieves aggregated attestation.
Aggregates all attestations matching given attestation data root and slot.
Parameters
attestation_data_root(string; query; required): HashTreeRoot of AttestationData that validator wants aggregated.slot(string; query; required): a slot.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_attestation" \
-H "Accept: application/json"
Responses
Code 200: Success. Returns aggregatedAttestationobject with sameAttestationDataroot.
{
"data": {
"aggregation_bits": "0x01",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"data": {
"slot": "1",
"index": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"source": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"target": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
}
}
Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
Code 404: Not found.
{
"code": 404,
"message": "Requested item not found"
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
POST /eth/v1/validator/aggregate_and_proofs
Publishes multiple aggregate and proofs.
Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic.
Parameters
<request body>(required):
[
{
"message": {
"aggregator_index": "1",
"aggregate": {
"aggregation_bits": "0x01",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"data": {
"slot": "1",
"index": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"source": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"target": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
},
"selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
]
Request example
curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_and_proofs" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'
Responses
Code 200: Success.Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
POST /eth/v1/validator/beacon_committee_subscriptions
Signals the Beacon node to prepare for a committee subnet.
After beacon node receives this request, search using discv5 for peers related to this subnet and replace current peers with those ones if necessary. If validator is_aggregator, beacon node must:
- Announce subnet topic subscription on gossipsub.
- Aggregate attestations received on that subnet.
Parameters
<request body>:
[
{
"validator_index": "1",
"committee_index": "1",
"committees_at_slot": "1",
"slot": "1",
"is_aggregator": true
}
]
Request example
curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/beacon_committee_subscriptions" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'
Responses
Code 200: Success. Slot signature is valid and beacon node has prepared the attestation subnet.
Note that we cannot be certain the Beacon node will find peers for that subnet for various reasons.
Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
Code 503: Beacon node is currently syncing, try again later.
{
"code": 503,
"message": "Beacon node is currently syncing and not serving request on that endpoint"
}
POST /eth/v1/validator/sync_committee_subscriptions
Subscribes to sync committee subnets.
Subscribe to a number of sync committee subnets.
Sync committees are not present in phase0, but are required for Altair networks.
Subscribing to sync committee subnets is an action performed by VC to enable network participation in Altair networks, and only required if the VC has an active validator in an active sync committee.
Parameters
<request body>:
[
{
"validator_index": "1",
"sync_committee_indices": [
"1"
],
"until_epoch": "1"
}
]
Request example
curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_subscriptions" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'
Responses
Code 200: Success.Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/validator/sync_committee_contribution
Produces a sync committee contribution.
Requests that the beacon node to produce a sync committee contribution.
Parameters
slot(string; query; required): the slot for which a sync committee contribution should be created.subcommittee_index(string; query; required): the subcommittee index for which to produce the contribution.beacon_block_root(string; query; required): the block root for which to produce the contribution.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_contribution" \
-H "Accept: application/json"
Responses
Code 200: Success.
{
"data": {
"slot": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"subcommittee_index": "1",
"aggregation_bits": "0x01",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
}
Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
Code 404: Not found.
{
"code": 404,
"message": "Requested item not found"
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
Code 503: Beacon node is currently syncing, try again later.
{
"code": 503,
"message": "Beacon node is currently syncing and not serving request on that endpoint"
}