diff --git a/vms/platformvm/service.md b/vms/platformvm/service.md index 7190ed719326..79e44b721d8d 100644 --- a/vms/platformvm/service.md +++ b/vms/platformvm/service.md @@ -807,16 +807,16 @@ curl -X POST --data '{ ```json { - "jsonrpc": "2.0", - "result": { - "weights": [1,1000,1000,4], - "maxCapacity": 1000000, - "maxPerSecond": 100000, - "targetPerSecond": 50000, - "minPrice": 1, - "excessConversionConstant": 2164043 - }, - "id": 1 + "jsonrpc": "2.0", + "result": { + "weights": [1, 1000, 1000, 4], + "maxCapacity": 1000000, + "maxPerSecond": 100000, + "targetPerSecond": 50000, + "minPrice": 1, + "excessConversionConstant": 2164043 + }, + "id": 1 } ``` @@ -850,75 +850,27 @@ curl -X POST --data '{ ```json { - "jsonrpc": "2.0", - "result": { - "capacity":973044, - "excess":26956, - "price":1, - "timestamp":"2024-12-16T17:19:07Z" - }, - "id": 1 + "jsonrpc": "2.0", + "result": { + "capacity": 973044, + "excess": 26956, + "price": 1, + "timestamp": "2024-12-16T17:19:07Z" + }, + "id": 1 } ``` -### `platform.getValidatorFeeConfig` +### `platform.getHeight` -Returns the validator fee configuration of the P-chain. +Returns the height of the last accepted block. **Signature:** ``` -platform.getValidatorFeeConfig() -> { - capacity: uint64, - target: uint64, - minPrice: uint64, - excessConversionConstant: uint64 -} -``` - -- `capacity` is the maximum number of L1 validators the chain is allowed to have at any given time -- `target` is the target number of L1 validators the chain should have to keep fees stable -- `minPrice` is the minimum price per L1 validator -- `excessConversionConstant` is used to convert excess L1 validators to a gas price - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getValidatorFeeConfig", - "params": {}, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json +platform.getHeight() -> { - "jsonrpc": "2.0", - "result": { - "capacity": 20000, - "target": 10000, - "targetPerSecond": 50000, - "minPrice": 512, - "excessConversionConstant": 1246488515 - }, - "id": 1 -} -``` - -### `platform.getValidatorFeeState` - -Returns the current validator fee state of the P-chain. - -**Signature:** - -``` -platform.getValidatorFeeState() -> { - excess: uint64, - price: uint64, - timestamp: string + height: int, } ``` @@ -927,7 +879,7 @@ platform.getValidatorFeeState() -> { ```sh curl -X POST --data '{ "jsonrpc": "2.0", - "method": "platform.getValidatorFeeState", + "method": "platform.getHeight", "params": {}, "id": 1 }' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P @@ -937,13 +889,11 @@ curl -X POST --data '{ ```json { - "jsonrpc": "2.0", - "result": { - "excess":26956, - "price":512, - "timestamp":"2024-12-16T17:19:07Z" - }, - "id": 1 + "jsonrpc": "2.0", + "result": { + "height": "56" + }, + "id": 1 } ``` @@ -1004,64 +954,28 @@ curl -X POST --data '{ **Example Response:** -```json -{ - "jsonrpc": "2.0", - "result": { - "subnetID": "2DeHa7Qb6sufPkmQcFWG2uCd4pBPv9WB6dkzroiMQhd1NSRtof", - "nodeID": "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg", - "publicKey": "0x900c9b119b5c82d781d4b49be78c3fc7ae65f2b435b7ed9e3a8b9a03e475edff86d8a64827fec8db23a6f236afbf127d", - "remainingBalanceOwner": { - "locktime": "0", - "threshold": "0", - "addresses": [] - }, - "deactivationOwner": { - "locktime": "0", - "threshold": "0", - "addresses": [] - }, - "startTime": "1731445206", - "weight": "49463", - "minNonce": "0", - "balance": "1000000000", - "height": "3" - }, - "id": 1 -} -``` - -### `platform.getHeight` - -Returns the height of the last accepted block. - -**Signature:** - -``` -platform.getHeight() -> -{ - height: int, -} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getHeight", - "params": {}, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - ```json { "jsonrpc": "2.0", "result": { - "height": "56" + "subnetID": "2DeHa7Qb6sufPkmQcFWG2uCd4pBPv9WB6dkzroiMQhd1NSRtof", + "nodeID": "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg", + "publicKey": "0x900c9b119b5c82d781d4b49be78c3fc7ae65f2b435b7ed9e3a8b9a03e475edff86d8a64827fec8db23a6f236afbf127d", + "remainingBalanceOwner": { + "locktime": "0", + "threshold": "0", + "addresses": [] + }, + "deactivationOwner": { + "locktime": "0", + "threshold": "0", + "addresses": [] + }, + "startTime": "1731445206", + "weight": "49463", + "minNonce": "0", + "balance": "1000000000", + "height": "3" }, "id": 1 } @@ -1535,7 +1449,10 @@ curl -X POST --data '{ "jsonrpc": "2.0", "result": { "isPermissioned": true, - "controlKeys": ["P-fuji1ztvstx6naeg6aarfd047fzppdt8v4gsah88e0c","P-fuji193kvt4grqewv6ce2x59wnhydr88xwdgfcedyr3"], + "controlKeys": [ + "P-fuji1ztvstx6naeg6aarfd047fzppdt8v4gsah88e0c", + "P-fuji193kvt4grqewv6ce2x59wnhydr88xwdgfcedyr3" + ], "threshold": "1", "locktime": "0", "subnetTransformationTxID": "11111111111111111111111111111111LpoYY", @@ -2061,7 +1978,7 @@ platform.getValidatorsAt( ``` - `height` is the P-Chain height to get the validator set at, or the string literal "proposed" - to return the validator set at this node's ProposerVM height. + to return the validator set at this node's ProposerVM height. - `subnetID` is the Subnet ID to get the validator set of. If not given, gets validator set of the Primary Network. @@ -2096,6 +2013,92 @@ curl -X POST --data '{ } ``` +### `platform.getValidatorFeeConfig` + +Returns the validator fee configuration of the P-chain. + +**Signature:** + +``` +platform.getValidatorFeeConfig() -> { + capacity: uint64, + target: uint64, + minPrice: uint64, + excessConversionConstant: uint64 +} +``` + +- `capacity` is the maximum number of L1 validators the chain is allowed to have at any given time +- `target` is the target number of L1 validators the chain should have to keep fees stable +- `minPrice` is the minimum price per L1 validator +- `excessConversionConstant` is used to convert excess L1 validators to a gas price + +**Example Call:** + +```sh +curl -X POST --data '{ + "jsonrpc": "2.0", + "method": "platform.getValidatorFeeConfig", + "params": {}, + "id": 1 +}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P +``` + +**Example Response:** + +```json +{ + "jsonrpc": "2.0", + "result": { + "capacity": 20000, + "target": 10000, + "targetPerSecond": 50000, + "minPrice": 512, + "excessConversionConstant": 1246488515 + }, + "id": 1 +} +``` + +### `platform.getValidatorFeeState` + +Returns the current validator fee state of the P-chain. + +**Signature:** + +``` +platform.getValidatorFeeState() -> { + excess: uint64, + price: uint64, + timestamp: string +} +``` + +**Example Call:** + +```sh +curl -X POST --data '{ + "jsonrpc": "2.0", + "method": "platform.getValidatorFeeState", + "params": {}, + "id": 1 +}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P +``` + +**Example Response:** + +```json +{ + "jsonrpc": "2.0", + "result": { + "excess": 26956, + "price": 512, + "timestamp": "2024-12-16T17:19:07Z" + }, + "id": 1 +} +``` + ### `platform.issueTx` Issue a transaction to the Platform Chain.