Spawn a neuron
Overview
Since version | 1.3.0 |
Idempotent? | yes |
Minimal access level | controller |
In this section you will learn how to split a neuron and spawn a new one out of your existing neuron.
The SPAWN
operation transfers all the maturity from the existing neuron to the staked amount of the newly spawned neuron.
Prerequisites:
account.address
is a ledger address of a neuron controller.The parent neuron has at least 1 ICP worth of maturity.
Postconditions:
Parent neuron maturity is set to
0
.A new neuron is spawned with a balance equal to the transferred maturity.
An example command to spawn a new neuron resembles the following. Make sure to give the spawned_neuron_index
a different index than the parent neuron.
curl --location '0.0.0.0:8081/construction/payloads' --header 'Content-Type: application/json' --data '{
{
"operation_identifier": { "index": 0 },
"type": "SPAWN",
"account": { "address": "907ff6c714a545110b42982b72aa39c5b7742d610e234a9d40bf8cf624e7a70d" },
"metadata": {
"neuron_index": 0,
"controller": {
"principal": "sp3em-jkiyw-tospm-2huim-jor4p-et4s7-ay35f-q7tnm-hi4k2-pyicb-xae"
},
"spawned_neuron_index": 1,
"percentage_to_spawn": 75
}
}'
spawned_neuron_index
metadata field is required. The Rosetta node uses this index to compute the subaccount for the spawned neuron. All spawned neurons must have different values ofspawned_neuron_index
.controller
metadata field is optional and equal to the existing neuron controller by default.percentage_to_spawn
metadata field is optional and equal to 100 by default. If specified, the value must be an integer between 1 and 100 (bounds included).