Node Provisioning API
Dynamically provision nodes and receive staking transactions to sign.
What is the Node Provisioning API?
The Node Provisioning API allows partners to programmatically spin-up nodes for staking. Partners specify the number of nodes needed and receive a transaction to sign that stakes with those node/s.
ETH2
Provision validators with an API request and submit the deposits through a single ETH1 transaction.
Integration Environments
Staked supports integration testing on ETH2, as defined below.
Post ETH2 Provisioning Request
POST
https://mainnet.staked.cloud/api/provisioning_requests/eth2
Provision ETH2 validators in our secure cloud environments. The response contains a unique identifier for the provisioning request.
Query Parameters
Request Body
ETH2 Attributes Object
Validator Config Object
Provisioning Response Object
Get ETH2 Delegation Objects
GET
https://mainnet.staked.cloud/api/delegations/eth2
After POSTing a provisioning request, use the unique identifier to GET the delegation objects for each validator. Delegation objects contain the information required to submit deposits on ETH1.
Query Parameters
Validators are provisioned asynchronously, meaning the GET request will fill-in over time as our infrastructure fulfills the associated provisioning request. Use the "total" field in the response object to track the number of validators provisioned at any given time.
Paginated Response Object
ETH2 Delegation Object
ETH2 Delegation Attributes Object
ETH2 Delegation Status Enum
Submit Deposits through the Batching Contract
The canonical ETH2 deposit contract, used to convert ETH1 to ETH2, only supports one deposit transaction at a time. Since 32 ETH is required for each validator, depositors with large amounts of ETH would have to broadcast many deposit transactions.
To simplify submitting deposits, we have created a batching contract which takes up to 185 deposits at once and submits each to the deposit contract. Integrators can therefore stake up to 5920 ETH in one Ethereum transaction, and leave behind the hassle of tracking many individually broadcasted transactions.
Batching Contract Deployments
The batching contract contains an external payable function, batchDeposits
, which loops over each validator's deposit and sends them to the deposit contract. The function arguments are passed as a 2-d array where the array at [i]
represents the deposit arguments for validator i
.
For release notifications of the ETH2 API and developer tools, click here.
Dash
Automate provisioning of Dash masternodes.
Integration Environments
Staked supports integration testing on Dash, as described below.
Email sam@staked.us for testnet Dash, or request it in the Dash Discord. Staked will support 2 masternodes per partner account in a testnet environment.
Getting Started
Each masternode requires an unspent transaction output (UTXO) of exactly 1,000 DASH. The address that owns this UTXO is the collateral address.
Instructions below assume use of the dash command line tool or debug console in the GUI wallet. If using the debug console, please remove dash-cli
from the beginning of each command.
Create a new address to hold your masternode collateral.
dash-cli getnewaddress <address-alias>
Example
dash-cli getnewaddress masternode_collateral_1
Next, send exactly 1,000 Dash to your collateral address.
dash-cli sendtoaddress <address> <amount>
Example
dash-cli sendtoaddress yTrtvsNuVgezcGmcVyv2n8D2dFeJEHCYhg 1000
Get the transaction id and output index of the transaction you just created (you may need to wait up to 2 minutes until your transaction is added to a block).
dash-cli masternode outputs
A payout address is also needed and can be generated using the getnewaddress
command. A single payout address can be shared across masternodes.
Step 1: Post Masternode Provisioning Request
POST
https://mainnet.staked.cloud/api/delegations/DASH/delegator/:collateralAddress
Provision a new masternode after sending 1,000 DASH to a collateral address.
Path Parameters
Query Parameters
Headers
Request Body
Step 2: Poll Masternode Status
GET
https://mainnet.staked.cloud/api/delegations/DASH/delegator/:collateralAddress
Poll the masternode status. The status is initially set as CREATED
. Once the masternode registration message is created through Staked's provisioning infrastructure the response will pass the message for signing along with a status of WaitingForSigning
.
Path Parameters
Query Parameters
Step 3: Sign Delegation Message
This must be run on the wallet or device that holds collateral key, and can be done completely offline if required. signMessage
is returned in the response of the previous step.
Example Output:
Step 4: Send Us the Signed Delegation Message
PUT
https://mainnet.staked.cloud/api/delegations/DASH/delegator/:collateralAddress
Finally, send Staked the signed transaction and we will broadcast it to the Dash blockchain!
Path Parameters
Query Parameters
Request Body
The status of the delegation object is now WaitingToSubmit
. When the Masternode is synched, the signedTx will be submitted and the status will be Ready
.
Boom! You've programmatically set up a Masternode. Check out the Reporting API to monitor your position.
Last updated