Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add getSubnet to p-chain api reference #3204

Merged
merged 5 commits into from
Jul 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions vms/platformvm/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,61 @@ Testnet: U8iRqJoiJm8xZHAacmvYyZVwqQx6uDNtQeP3CQ6fcgQk3JqnK

:::

### `platform.getSubnet`

Get owners and elastic info about the Subnet.

**Signature:**

```sh
platform.getSubnet({
subnetID: string
}) ->
{
id: string,
felipemadero marked this conversation as resolved.
Show resolved Hide resolved
isPermissioned: bool,
controlKeys: []string,
threshold: string,
locktime: string,
subnetTransformationTxID: string
}
```

- `id` are the ID of the Subnet to get information about. If omitted, fails.
felipemadero marked this conversation as resolved.
Show resolved Hide resolved
- `threshold` signatures from addresses in `controlKeys` are needed to make changes to
a permissioned subnet. If the Subnet is a PoS Subnet, then `threshold` will be `0` and `controlKeys`
will be empty.
- changes can not be made into the subnet until `locktime` is in the past.
- `subnetTransformationTxID` is the ID of the transaction that changed the subnet into a elastic one,
for when this was change was performed.

**Example Call:**

```sh
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.getSubnet",
"params": {"subnetID":"Vz2ArUpigHt7fyE79uF3gAXvTPLJi2LGgZoMpgNPHowUZJxBb"},
"id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P
```

**Example Response:**

```json
{
"jsonrpc": "2.0",
"result": {
"isPermissioned": true,
"controlKeys": ["P-fuji1ztvstx6naeg6aarfd047fzppdt8v4gsah88e0c","P-fuji193kvt4grqewv6ce2x59wnhydr88xwdgfcedyr3"],
"threshold": "1",
"locktime": "0",
"subnetTransformationTxID": "11111111111111111111111111111111LpoYY"
},
"id": 1
}
```

### `platform.getSubnets`

:::caution
Expand Down
Loading