Ethereum
Create Staking Request
Set up nodes for staking using P2P infrastructure.
POST
/
api
/
v1
/
eth
/
staking
/
direct
/
nodes-request
/
create
Create Staking Request
curl --request POST \
--url https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"validatorsCount": 1,
"nodesOptions": {
"location": "any",
"relaysSet": null
},
"type": "REGULAR",
"amountPerValidator": "32000000000",
"withdrawalCredentialsType": "0x02",
"withdrawalAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"eigenPodOwnerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"controllerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"feeRecipientAddress": "0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585"
}
'import requests
url = "https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create"
payload = {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"validatorsCount": 1,
"nodesOptions": {
"location": "any",
"relaysSet": None
},
"type": "REGULAR",
"amountPerValidator": "32000000000",
"withdrawalCredentialsType": "0x02",
"withdrawalAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"eigenPodOwnerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"controllerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"feeRecipientAddress": "0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
validatorsCount: 1,
nodesOptions: {location: 'any', relaysSet: null},
type: 'REGULAR',
amountPerValidator: '32000000000',
withdrawalCredentialsType: '0x02',
withdrawalAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
eigenPodOwnerAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
controllerAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
feeRecipientAddress: '0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585'
})
};
fetch('https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3fa85f64-5717-4562-b3fc-2c963f66afa6',
'validatorsCount' => 1,
'nodesOptions' => [
'location' => 'any',
'relaysSet' => null
],
'type' => 'REGULAR',
'amountPerValidator' => '32000000000',
'withdrawalCredentialsType' => '0x02',
'withdrawalAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'eigenPodOwnerAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'controllerAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'feeRecipientAddress' => '0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create"
payload := strings.NewReader("{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"nodesOptions\": {\n \"location\": \"any\",\n \"relaysSet\": null\n },\n \"type\": \"REGULAR\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"eigenPodOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"controllerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"nodesOptions\": {\n \"location\": \"any\",\n \"relaysSet\": null\n },\n \"type\": \"REGULAR\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"eigenPodOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"controllerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"nodesOptions\": {\n \"location\": \"any\",\n \"relaysSet\": null\n },\n \"type\": \"REGULAR\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"eigenPodOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"controllerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585\"\n}"
response = http.request(request)
puts response.read_body"<unknown>"Authorizations
Body
application/json
Response
OK
The response is of type any.
Create Staking Request
curl --request POST \
--url https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"validatorsCount": 1,
"nodesOptions": {
"location": "any",
"relaysSet": null
},
"type": "REGULAR",
"amountPerValidator": "32000000000",
"withdrawalCredentialsType": "0x02",
"withdrawalAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"eigenPodOwnerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"controllerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"feeRecipientAddress": "0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585"
}
'import requests
url = "https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create"
payload = {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"validatorsCount": 1,
"nodesOptions": {
"location": "any",
"relaysSet": None
},
"type": "REGULAR",
"amountPerValidator": "32000000000",
"withdrawalCredentialsType": "0x02",
"withdrawalAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"eigenPodOwnerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"controllerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"feeRecipientAddress": "0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
validatorsCount: 1,
nodesOptions: {location: 'any', relaysSet: null},
type: 'REGULAR',
amountPerValidator: '32000000000',
withdrawalCredentialsType: '0x02',
withdrawalAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
eigenPodOwnerAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
controllerAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
feeRecipientAddress: '0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585'
})
};
fetch('https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3fa85f64-5717-4562-b3fc-2c963f66afa6',
'validatorsCount' => 1,
'nodesOptions' => [
'location' => 'any',
'relaysSet' => null
],
'type' => 'REGULAR',
'amountPerValidator' => '32000000000',
'withdrawalCredentialsType' => '0x02',
'withdrawalAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'eigenPodOwnerAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'controllerAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'feeRecipientAddress' => '0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create"
payload := strings.NewReader("{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"nodesOptions\": {\n \"location\": \"any\",\n \"relaysSet\": null\n },\n \"type\": \"REGULAR\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"eigenPodOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"controllerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"nodesOptions\": {\n \"location\": \"any\",\n \"relaysSet\": null\n },\n \"type\": \"REGULAR\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"eigenPodOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"controllerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"nodesOptions\": {\n \"location\": \"any\",\n \"relaysSet\": null\n },\n \"type\": \"REGULAR\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"eigenPodOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"controllerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585\"\n}"
response = http.request(request)
puts response.read_body"<unknown>"