From 3fef25dad63a1be6415097cc132ecd1168d52ac0 Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 11 Mar 2024 16:45:03 +0100 Subject: [PATCH 01/18] p-chain api --- .gitignore | 3 + configs/remoteContent.js | 25 + docs/reference/avalanchego/p-chain/api.md | 1990 --------------------- 3 files changed, 28 insertions(+), 1990 deletions(-) delete mode 100644 docs/reference/avalanchego/p-chain/api.md diff --git a/.gitignore b/.gitignore index ecaa91b11ce..dd2590a9583 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ docs/build/cross-chain/awm/evm-integration.md docs/build/cross-chain/awm/relayer.md docs/learn/acp.md +# AvalancheGo API from GH repo via docusaurus-plugin-remote-content +docs/reference/avalanchego/p-chain/api.md + # Misc .DS_Store .env.local diff --git a/configs/remoteContent.js b/configs/remoteContent.js index b7c334e868c..1c6eadaee17 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -393,6 +393,31 @@ ${updatedContent}`, }, }, ], + [ + "docusaurus-plugin-remote-content", + { + // /docs/reference/p-chain/api.md + name: "p-api", + sourceBaseUrl: + "https://raw.githubusercontent.com/ava-labs/avalanchego/meag/docs-format/vms/platformvm/", + documents: ["service.md"], + outDir: "docs/reference/avalanchego/p-chain/", + // change filename and correct links + modifyContent(filename, content) { + if (filename.includes("service")) { + const updatedContent = replaceRelativeLinks( + content, + "https://github.com/ava-labs/avalanchego/blob/master/vms/platformvm/" + ); + return { + filename: "api.md", + content: `${updatedContent}`, + }; + } + return undefined; + }, + }, + ], ]; module.exports = remoteContent; diff --git a/docs/reference/avalanchego/p-chain/api.md b/docs/reference/avalanchego/p-chain/api.md deleted file mode 100644 index 099968c26e8..00000000000 --- a/docs/reference/avalanchego/p-chain/api.md +++ /dev/null @@ -1,1990 +0,0 @@ ---- -tags: [P-Chain, Platform Chain, AvalancheGo APIs] -description: This page is an overview of the P-Chain API associated with AvalancheGo. -sidebar_label: API -pagination_label: P-Chain Transaction Format ---- -# Platform Chain API - -This API allows clients to interact with the -[P-Chain](/learn/avalanche/avalanche-platform.md#p-chain), which -maintains Avalanche’s [validator](/nodes/validate/how-to-stake#validators) set and handles -blockchain creation. - -## Endpoint - -```sh -/ext/bc/P -``` - -## Format - -This API uses the `json 2.0` RPC format. - -## Methods - -### `platform.exportKey` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning - -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). - -::: - -Get the private key that controls a given address. - -**Signature:** - -```sh -platform.exportKey({ - username: string, - password: string, - address: string -}) -> {privateKey: string} -``` - -- `username` is the user that controls `address`. -- `password` is `username`‘s password. -- `privateKey` is the string representation of the private key that controls `address`. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"platform.exportKey", - "params" :{ - "username" :"myUsername", - "password": "myPassword", - "address": "P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "privateKey": "PrivateKey-Lf49kAJw3CbaL783vmbeAJvhscJqC7vi5yBYLxw2XfbzNS5RS" - } -} -``` - -### `platform.getBalance` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Get the balance of AVAX controlled by a given address. - -**Signature:** - -```sh -platform.getBalance({ - addresses: []string -}) -> { - balances: string -> int, - unlockeds: string -> int, - lockedStakeables: string -> int, - lockedNotStakeables: string -> int, - utxoIDs: []{ - txID: string, - outputIndex: int - } -} -``` - -- `addresses` are the addresses to get the balance of. -- `balances` is a map from assetID to the total balance. -- `unlockeds` is a map from assetID to the unlocked balance. -- `lockedStakeables` is a map from assetID to the locked stakeable balance. -- `lockedNotStakeables` is a map from assetID to the locked and not stakeable balance. -- `utxoIDs` are the IDs of the UTXOs that reference `address`. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"platform.getBalance", - "params" :{ - "addresses":["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"] - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "balance": "30000000000000000", - "unlocked": "20000000000000000", - "lockedStakeable": "10000000000000000", - "lockedNotStakeable": "0", - "balances": { - "BUuypiq2wyuLMvyhzFXcPyxPMCgSp7eeDohhQRqTChoBjKziC": "30000000000000000" - }, - "unlockeds": { - "BUuypiq2wyuLMvyhzFXcPyxPMCgSp7eeDohhQRqTChoBjKziC": "20000000000000000" - }, - "lockedStakeables": { - "BUuypiq2wyuLMvyhzFXcPyxPMCgSp7eeDohhQRqTChoBjKziC": "10000000000000000" - }, - "lockedNotStakeables": {}, - "utxoIDs": [ - { - "txID": "11111111111111111111111111111111LpoYY", - "outputIndex": 1 - }, - { - "txID": "11111111111111111111111111111111LpoYY", - "outputIndex": 0 - } - ] - }, - "id": 1 -} -``` - -### `platform.getBlock` - -Get a block by its ID. - -**Signature:** - -```sh -platform.getBlock({ - blockID: string - encoding: string // optional -}) -> { - block: string, - encoding: string -} -``` - -**Request:** - -- `blockID` is the block ID. It should be in cb58 format. -- `encoding` is the encoding format to use. Can be either `hex` or `json`. Defaults to `hex`. - -**Response:** - -- `block` is the block encoded to `encoding`. -- `encoding` is the `encoding`. - -#### Hex Example - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getBlock", - "params": { - "blockID": "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG", - "encoding": "hex" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "block": "0x00000000000309473dc99a0851a29174d84e522da8ccb1a56ac23f7b0ba79f80acce34cf576900000000000f4241000000010000001200000001000000000000000000000000000000000000000000000000000000000000000000000000000000011c4c57e1bcb3c567f9f03caa75563502d1a21393173c06d9d79ea247b20e24800000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000050000000338e0465f0000000100000000000000000427d4b22a2a78bcddd456742caf91b56badbff985ee19aef14573e7343fd6520000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000000338d1041f0000000000000000000000010000000195a4467dd8f939554ea4e6501c08294386938cbf000000010000000900000001c79711c4b48dcde205b63603efef7c61773a0eb47efb503fcebe40d21962b7c25ebd734057400a12cce9cf99aceec8462923d5d91fffe1cb908372281ed738580119286dde", - "encoding": "hex" - }, - "id": 1 -} -``` - -#### JSON Example - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getBlock", - "params": { - "blockID": "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG", - "encoding": "json" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "block": { - "parentID": "5615di9ytxujackzaXNrVuWQy5y8Yrt8chPCscMr5Ku9YxJ1S", - "height": 1000001, - "txs": [ - { - "unsignedTx": { - "inputs": { - "networkID": 1, - "blockchainID": "11111111111111111111111111111111LpoYY", - "outputs": [], - "inputs": [ - { - "txID": "DTqiagiMFdqbNQ62V2Gt1GddTVLkKUk2caGr4pyza9hTtsfta", - "outputIndex": 0, - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "input": { - "amount": 13839124063, - "signatureIndices": [0] - } - } - ], - "memo": "0x" - }, - "destinationChain": "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5", - "exportedOutputs": [ - { - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "output": { - "addresses": [ - "P-avax1jkjyvlwclyu42n4yuegpczpfgwrf8r9lyj0d3c" - ], - "amount": 13838124063, - "locktime": 0, - "threshold": 1 - } - } - ] - }, - "credentials": [ - { - "signatures": [ - "0xc79711c4b48dcde205b63603efef7c61773a0eb47efb503fcebe40d21962b7c25ebd734057400a12cce9cf99aceec8462923d5d91fffe1cb908372281ed7385801" - ] - } - ] - } - ] - }, - "encoding": "json" - }, - "id": 1 -} -``` - -### `platform.getBlockByHeight` - -Get a block by its height. - -**Signature:** - -```sh -platform.getBlockByHeight({ - height: int - encoding: string // optional -}) -> { - block: string, - encoding: string -} -``` - -**Request:** - -- `height` is the block height. -- `encoding` is the encoding format to use. Can be either `hex` or `json`. Defaults to `hex`. - -**Response:** - -- `block` is the block encoded to `encoding`. -- `encoding` is the `encoding`. - -#### Hex Example - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getBlockByHeight", - "params": { - "height": 1000001, - "encoding": "hex" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "block": "0x00000000000309473dc99a0851a29174d84e522da8ccb1a56ac23f7b0ba79f80acce34cf576900000000000f4241000000010000001200000001000000000000000000000000000000000000000000000000000000000000000000000000000000011c4c57e1bcb3c567f9f03caa75563502d1a21393173c06d9d79ea247b20e24800000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000050000000338e0465f0000000100000000000000000427d4b22a2a78bcddd456742caf91b56badbff985ee19aef14573e7343fd6520000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000000338d1041f0000000000000000000000010000000195a4467dd8f939554ea4e6501c08294386938cbf000000010000000900000001c79711c4b48dcde205b63603efef7c61773a0eb47efb503fcebe40d21962b7c25ebd734057400a12cce9cf99aceec8462923d5d91fffe1cb908372281ed738580119286dde", - "encoding": "hex" - }, - "id": 1 -} -``` - -#### JSON Example - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getBlockByHeight", - "params": { - "height": 1000001, - "encoding": "json" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "block": { - "parentID": "5615di9ytxujackzaXNrVuWQy5y8Yrt8chPCscMr5Ku9YxJ1S", - "height": 1000001, - "txs": [ - { - "unsignedTx": { - "inputs": { - "networkID": 1, - "blockchainID": "11111111111111111111111111111111LpoYY", - "outputs": [], - "inputs": [ - { - "txID": "DTqiagiMFdqbNQ62V2Gt1GddTVLkKUk2caGr4pyza9hTtsfta", - "outputIndex": 0, - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "input": { - "amount": 13839124063, - "signatureIndices": [0] - } - } - ], - "memo": "0x" - }, - "destinationChain": "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5", - "exportedOutputs": [ - { - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "output": { - "addresses": [ - "P-avax1jkjyvlwclyu42n4yuegpczpfgwrf8r9lyj0d3c" - ], - "amount": 13838124063, - "locktime": 0, - "threshold": 1 - } - } - ] - }, - "credentials": [ - { - "signatures": [ - "0xc79711c4b48dcde205b63603efef7c61773a0eb47efb503fcebe40d21962b7c25ebd734057400a12cce9cf99aceec8462923d5d91fffe1cb908372281ed7385801" - ] - } - ] - } - ] - }, - "encoding": "json" - }, - "id": 1 -} -``` - -### `platform.getBlockchains` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Get all the blockchains that exist (excluding the P-Chain). - -**Signature:** - -```sh -platform.getBlockchains() -> -{ - blockchains: []{ - id: string, - name:string, - subnetID: string, - vmID: string - } -} -``` - -- `blockchains` is all of the blockchains that exists on the Avalanche network. -- `name` is the human-readable name of this blockchain. -- `id` is the blockchain’s ID. -- `subnetID` is the ID of the Subnet that validates this blockchain. -- `vmID` is the ID of the Virtual Machine the blockchain runs. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getBlockchains", - "params": {}, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "blockchains": [ - { - "id": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", - "name": "X-Chain", - "subnetID": "11111111111111111111111111111111LpoYY", - "vmID": "jvYyfQTxGMJLuGWa55kdP2p2zSUYsQ5Raupu4TW34ZAUBAbtq" - }, - { - "id": "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5", - "name": "C-Chain", - "subnetID": "11111111111111111111111111111111LpoYY", - "vmID": "mgj786NP7uDwBCcq6YwThhaN8FLyybkCa4zBWTQbNgmK6k9A6" - }, - { - "id": "CqhF97NNugqYLiGaQJ2xckfmkEr8uNeGG5TQbyGcgnZ5ahQwa", - "name": "Simple DAG Payments", - "subnetID": "11111111111111111111111111111111LpoYY", - "vmID": "sqjdyTKUSrQs1YmKDTUbdUhdstSdtRTGRbUn8sqK8B6pkZkz1" - }, - { - "id": "VcqKNBJsYanhVFxGyQE5CyNVYxL3ZFD7cnKptKWeVikJKQkjv", - "name": "Simple Chain Payments", - "subnetID": "11111111111111111111111111111111LpoYY", - "vmID": "sqjchUjzDqDfBPGjfQq2tXW1UCwZTyvzAWHsNzF2cb1eVHt6w" - }, - { - "id": "2SMYrx4Dj6QqCEA3WjnUTYEFSnpqVTwyV3GPNgQqQZbBbFgoJX", - "name": "Simple Timestamp Server", - "subnetID": "11111111111111111111111111111111LpoYY", - "vmID": "tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH" - }, - { - "id": "KDYHHKjM4yTJTT8H8qPs5KXzE6gQH5TZrmP1qVr1P6qECj3XN", - "name": "My new timestamp", - "subnetID": "2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r", - "vmID": "tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH" - }, - { - "id": "2TtHFqEAAJ6b33dromYMqfgavGPF3iCpdG3hwNMiart2aB5QHi", - "name": "My new AVM", - "subnetID": "2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r", - "vmID": "jvYyfQTxGMJLuGWa55kdP2p2zSUYsQ5Raupu4TW34ZAUBAbtq" - } - ] - }, - "id": 1 -} -``` - -### `platform.getBlockchainStatus` - -Get the status of a blockchain. - -**Signature:** - -```sh -platform.getBlockchainStatus( - { - blockchainID: string - } -) -> {status: string} -``` - -`status` is one of: - -- `Validating`: The blockchain is being validated by this node. -- `Created`: The blockchain exists but isn’t being validated by this node. -- `Preferred`: The blockchain was proposed to be created and is likely to be created but the - transaction isn’t yet accepted. -- `Syncing`: This node is participating in this blockchain as a non-validating node. -- `Unknown`: The blockchain either wasn’t proposed or the proposal to create it isn’t preferred. The - proposal may be resubmitted. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getBlockchainStatus", - "params":{ - "blockchainID":"2NbS4dwGaf2p1MaXb65PrkZdXRwmSX4ZzGnUu7jm3aykgThuZE" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "status": "Created" - }, - "id": 1 -} -``` - -### `platform.getCurrentSupply` - -Returns an upper bound on amount of tokens that exist that can stake the requested Subnet. This is -an upper bound because it does not account for burnt tokens, including transaction fees. - -**Signature:** - -```sh -platform.getCurrentSupply({ - subnetID: string // optional -}) -> {supply: int} -``` - -- `supply` is an upper bound on the number of tokens that exist. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getCurrentSupply", - "params": { - "subnetID": "11111111111111111111111111111111LpoYY" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "supply": "365865167637779183" - }, - "id": 1 -} -``` - -The response in this example indicates that AVAX’s supply is at most 365.865 million. - -### `platform.getCurrentValidators` - -List the current validators of the given Subnet. - -**Signature:** - -```sh -platform.getCurrentValidators({ - subnetID: string, // optional - nodeIDs: string[], // optional -}) -> { - validators: []{ - txID: string, - startTime: string, - endTime: string, - stakeAmount: string, - nodeID: string, - weight: string, - validationRewardOwner: { - locktime: string, - threshold: string, - addresses: string[] - }, - delegationRewardOwner: { - locktime: string, - threshold: string, - addresses: string[] - }, - potentialReward: string, - delegationFee: string, - uptime: string, - connected: bool, - signer: { - publicKey: string, - proofOfPosession: string - }, - delegatorCount: string, - delegatorWeight: string, - delegators: []{ - txID: string, - startTime: string, - endTime: string, - stakeAmount: string, - nodeID: string, - rewardOwner: { - locktime: string, - threshold: string, - addresses: string[] - }, - potentialReward: string, - } - } -} -``` - -- `subnetID` is the Subnet whose current validators are returned. If omitted, returns the current - validators of the Primary Network. -- `nodeIDs` is a list of the NodeIDs of current validators to request. If omitted, all current - validators are returned. If a specified NodeID is not in the set of current validators, it will - not be included in the response. -- `validators`: - - `txID` is the validator transaction. - - `startTime` is the Unix time when the validator starts validating the Subnet. - - `endTime` is the Unix time when the validator stops validating the Subnet. - - `stakeAmount` is the amount of tokens this validator staked. Omitted if `subnetID` is not a PoS - Subnet. - - `nodeID` is the validator’s node ID. - - `weight` is the validator’s weight when sampling validators. Omitted if `subnetID` is a PoS - Subnet. - - `validationRewardOwner` is an `OutputOwners` output which includes `locktime`, `threshold` and - array of `addresses`. Specifies the owner of the potential reward earned from staking. Omitted - if `subnetID` is not a PoS Subnet. - - `delegationRewardOwner` is an `OutputOwners` output which includes `locktime`, `threshold` and - array of `addresses`. Specifies the owner of the potential reward earned from delegations. - Omitted if `subnetID` is not a PoS Subnet. - - `potentialReward` is the potential reward earned from staking. Omitted if `subnetID` is not a - PoS Subnet. - - `delegationFeeRate` is the percent fee this validator charges when others delegate stake to - them. Omitted if `subnetID` is not a PoS Subnet. - - `uptime` is the % of time the queried node has reported the peer as online and validating the - Subnet. Omitted if `subnetID` is not a PoS Subnet. - - `connected` is if the node is connected and tracks the Subnet. - - `signer` is the node's BLS public key and proof of possession. Omitted if the validator doesn't - have a BLS public key. - - `delegatorCount` is the number of delegators on this validator. - Omitted if `subnetID` is not a PoS Subnet. - - `delegatorWeight` is total weight of delegators on this validator. - Omitted if `subnetID` is not a PoS Subnet. - - `delegators` is the list of delegators to this validator. - Omitted if `subnetID` is not a PoS Subnet. - Omitted unless `nodeIDs` specifies a single NodeID. - - `txID` is the delegator transaction. - - `startTime` is the Unix time when the delegator started. - - `endTime` is the Unix time when the delegator stops. - - `stakeAmount` is the amount of nAVAX this delegator staked. - - `nodeID` is the validating node’s node ID. - - `rewardOwner` is an `OutputOwners` output which includes `locktime`, `threshold` and array of - `addresses`. - - `potentialReward` is the potential reward earned from staking - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getCurrentValidators", - "params": { - "nodeIDs": ["NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD"] - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "validators": [ - { - "txID": "2NNkpYTGfTFLSGXJcHtVv6drwVU2cczhmjK2uhvwDyxwsjzZMm", - "startTime": "1600368632", - "endTime": "1602960455", - "stakeAmount": "2000000000000", - "nodeID": "NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD", - "validationRewardOwner": { - "locktime": "0", - "threshold": "1", - "addresses": ["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"] - }, - "delegationRewardOwner": { - "locktime": "0", - "threshold": "1", - "addresses": ["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"] - }, - "potentialReward": "117431493426", - "delegationFee": "10.0000", - "uptime": "0.0000", - "connected": false, - "delegatorCount": "1", - "delegatorWeight": "25000000000", - "delegators": [ - { - "txID": "Bbai8nzGVcyn2VmeYcbS74zfjJLjDacGNVuzuvAQkHn1uWfoV", - "startTime": "1600368523", - "endTime": "1602960342", - "stakeAmount": "25000000000", - "nodeID": "NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD", - "rewardOwner": { - "locktime": "0", - "threshold": "1", - "addresses": ["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"] - }, - "potentialReward": "11743144774" - } - ] - } - ] - }, - "id": 1 -} -``` - -### `platform.getHeight` - -Returns the height of the last accepted block. - -**Signature:** - -```sh -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" - }, - "id": 1 -} -``` - -### `platform.getMaxStakeAmount` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Returns the maximum amount of nAVAX staking to the named node during a particular time period. - -**Signature:** - -```sh -platform.getMaxStakeAmount( - { - subnetID: string, - nodeID: string, - startTime: int, - endTime: int - } -) -> -{ - amount: uint64 -} -``` - -- `subnetID` is a Buffer or cb58 string representing Subnet -- `nodeID` is a string representing ID of the node whose stake amount is required during the given - duration -- `startTime` is a big number denoting start time of the duration during which stake amount of the - node is required. -- `endTime` is a big number denoting end time of the duration during which stake amount of the node - is required. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getMaxStakeAmount", - "params": { - "subnetID":"11111111111111111111111111111111LpoYY", - "nodeID":"NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg", - "startTime": 1644240334, - "endTime": 1644240634 - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "amount": "2000000000000000" - }, - "id": 1 -} -``` - -### `platform.getMinStake` - -Get the minimum amount of tokens required to validate the requested Subnet and the minimum amount of -tokens that can be delegated. - -**Signature:** - -```sh -platform.getMinStake({ - subnetID: string // optional -}) -> -{ - minValidatorStake : uint64, - minDelegatorStake : uint64 -} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"platform.getMinStake", - "params": { - "subnetID":"11111111111111111111111111111111LpoYY" - }, -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "minValidatorStake": "2000000000000", - "minDelegatorStake": "25000000000" - }, - "id": 1 -} -``` - -### `platform.getPendingValidators` - -List the validators in the pending validator set of the specified Subnet. Each validator is not -currently validating the Subnet but will in the future. - -**Signature:** - -```sh -platform.getPendingValidators({ - subnetID: string, // optional - nodeIDs: string[], // optional -}) -> { - validators: []{ - txID: string, - startTime: string, - endTime: string, - stakeAmount: string, - nodeID: string, - delegationFee: string, - connected: bool, - signer: { - publicKey: string, - proofOfPosession: string - }, - weight: string, - }, - delegators: []{ - txID: string, - startTime: string, - endTime: string, - stakeAmount: string, - nodeID: string - } -} -``` - -- `subnetID` is the Subnet whose current validators are returned. If omitted, returns the current - validators of the Primary Network. -- `nodeIDs` is a list of the NodeIDs of pending validators to request. If omitted, all pending - validators are returned. If a specified NodeID is not in the set of pending validators, it will - not be included in the response. -- `validators`: - - `txID` is the validator transaction. - - `startTime` is the Unix time when the validator starts validating the Subnet. - - `endTime` is the Unix time when the validator stops validating the Subnet. - - `stakeAmount` is the amount of tokens this validator staked. Omitted if `subnetID` is not a PoS - Subnet. - - `nodeID` is the validator’s node ID. - - `connected` if the node is connected and tracks the Subnet. - - `signer` is the node's BLS public key and proof of possession. Omitted if the validator doesn't - have a BLS public key. - - `weight` is the validator’s weight when sampling validators. Omitted if `subnetID` is a PoS - Subnet. -- `delegators`: - - `txID` is the delegator transaction. - - `startTime` is the Unix time when the delegator starts. - - `endTime` is the Unix time when the delegator stops. - - `stakeAmount` is the amount of tokens this delegator staked. - - `nodeID` is the validating node’s node ID. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getPendingValidators", - "params": {}, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "validators": [ - { - "txID": "2NNkpYTGfTFLSGXJcHtVv6drwVU2cczhmjK2uhvwDyxwsjzZMm", - "startTime": "1600368632", - "endTime": "1602960455", - "stakeAmount": "200000000000", - "nodeID": "NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD", - "delegationFee": "10.0000", - "connected": false - } - ], - "delegators": [ - { - "txID": "Bbai8nzGVcyn2VmeYcbS74zfjJLjDacGNVuzuvAQkHn1uWfoV", - "startTime": "1600368523", - "endTime": "1602960342", - "stakeAmount": "20000000000", - "nodeID": "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg" - } - ] - }, - "id": 1 -} -``` - -### `platform.getRewardUTXOs` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Returns the UTXOs that were rewarded after the provided transaction's staking or delegation period -ended. - -**Signature:** - -```sh -platform.getRewardUTXOs({ - txID: string, - encoding: string // optional -}) -> { - numFetched: integer, - utxos: []string, - encoding: string -} -``` - -- `txID` is the ID of the staking or delegating transaction -- `numFetched` is the number of returned UTXOs -- `utxos` is an array of encoded reward UTXOs -- `encoding` specifies the format for the returned UTXOs. Can only be `hex` when a value is - provided. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getRewardUTXOs", - "params": { - "txID": "2nmH8LithVbdjaXsxVQCQfXtzN9hBbmebrsaEYnLM9T32Uy2Y5" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "numFetched": "2", - "utxos": [ - "0x0000a195046108a85e60f7a864bb567745a37f50c6af282103e47cc62f036cee404700000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216c1f01765", - "0x0000ae8b1b94444eed8de9a81b1222f00f1b4133330add23d8ac288bffa98b85271100000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216473d042a" - ], - "encoding": "hex" - }, - "id": 1 -} -``` - -### `platform.getStake` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Get the amount of nAVAX staked by a set of addresses. The amount returned does not include staking -rewards. - -**Signature:** - -```sh -platform.getStake({ - addresses: []string, - validatorsOnly: true or false -}) -> -{ - stakeds: string -> int, - stakedOutputs: []string, - encoding: string -} -``` - -- `addresses` are the addresses to get information about. -- `validatorsOnly` can be either `true` or `false`. If `true`, will skip checking delegators for stake. -- `stakeds` is a map from assetID to the amount staked by addresses provided. -- `stakedOutputs` are the string representation of staked outputs. -- `encoding` specifies the format for the returned outputs. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getStake", - "params": { - "addresses": [ - "P-avax1pmgmagjcljjzuz2ve339dx82khm7q8getlegte" - ], - "validatorsOnly": true - }, - "id": 1 -} -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "staked": "6500000000000", - "stakeds": { - "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z": "6500000000000" - }, - "stakedOutputs": [ - "0x000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000007000005e96630e800000000000000000000000001000000011f1c933f38da6ba0ba46f8c1b0a7040a9a991a80dd338ed1" - ], - "encoding": "hex" - }, - "id": 1 -} -``` - -### `platform.getStakingAssetID` - -Retrieve an assetID for a Subnet’s staking asset. - -**Signature:** - -```sh -platform.getStakingAssetID({ - subnetID: string // optional -}) -> { - assetID: string -} -``` - -- `subnetID` is the Subnet whose assetID is requested. -- `assetID` is the assetID for a Subnet’s staking asset. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getStakingAssetID", - "params": { - "subnetID": "11111111111111111111111111111111LpoYY" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "assetID": "2fombhL7aGPwj3KH4bfrmJwW6PVnMobf9Y2fn9GwxiAAJyFDbe" - }, - "id": 1 -} -``` - -:::note - -The AssetID for AVAX differs depending on the network you are on. - -Mainnet: FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z - -Testnet: U8iRqJoiJm8xZHAacmvYyZVwqQx6uDNtQeP3CQ6fcgQk3JqnK - -::: - -### `platform.getSubnets` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Get info about the Subnets. - -**Signature:** - -```sh -platform.getSubnets({ - ids: []string -}) -> -{ - subnets: []{ - id: string, - controlKeys: []string, - threshold: string - } -} -``` - -- `ids` are the IDs of the Subnets to get information about. If omitted, gets information about all - Subnets. -- `id` is the Subnet’s ID. -- `threshold` signatures from addresses in `controlKeys` are needed to add a validator to the - Subnet. If the Subnet is a PoS Subnet, then `threshold` will be `0` and `controlKeys` will be - empty. - -See [here](/nodes/validate/add-a-validator.md) for information on adding a validator to a -Subnet. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getSubnets", - "params": {"ids":["hW8Ma7dLMA7o4xmJf3AXBbo17bXzE7xnThUd3ypM4VAWo1sNJ"]}, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "subnets": [ - { - "id": "hW8Ma7dLMA7o4xmJf3AXBbo17bXzE7xnThUd3ypM4VAWo1sNJ", - "controlKeys": [ - "KNjXsaA1sZsaKCD1cd85YXauDuxshTes2", - "Aiz4eEt5xv9t4NCnAWaQJFNz5ABqLtJkR" - ], - "threshold": "2" - } - ] - }, - "id": 1 -} -``` - -### `platform.getTimestamp` - -Get the current P-Chain timestamp. - -**Signature:** - -```sh -platform.getTimestamp() -> {time: string} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getTimestamp", - "params": {}, - "id": 1 -} -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "timestamp": "2021-09-07T00:00:00-04:00" - }, - "id": 1 -} -``` - -### `platform.getTotalStake` - -Get the total amount of tokens staked on the requested Subnet. - -**Signature:** - -```sh -platform.getTotalStake({ - subnetID: string -}) -> { - stake: int - weight: int -} -``` - -#### Primary Network Example - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getTotalStake", - "params": { - "subnetID": "11111111111111111111111111111111LpoYY" - }, - "id": 1 -} -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "stake": "279825917679866811", - "weight": "279825917679866811" - }, - "id": 1 -} -``` - -#### Subnet Example - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getTotalStake", - "params": { - "subnetID": "2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r", - }, - "id": 1 -} -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "weight": "100000" - }, - "id": 1 -} -``` - -### `platform.getTx` - -Gets a transaction by its ID. - -Optional `encoding` parameter to specify the format for the returned transaction. Can be either -`hex` or `json`. Defaults to `hex`. - -**Signature:** - -```sh -platform.getTx({ - txID: string, - encoding: string // optional -}) -> { - tx: string, - encoding: string, -} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getTx", - "params": { - "txID":"28KVjSw5h3XKGuNpJXWY74EdnGq4TUWvCgEtJPymgQTvudiugb", - "encoding": "json" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "tx": { - "unsignedTx": { - "networkID": 1, - "blockchainID": "11111111111111111111111111111111LpoYY", - "outputs": [], - "inputs": [ - { - "txID": "NXNJHKeaJyjjWVSq341t6LGQP5UNz796o1crpHPByv1TKp9ZP", - "outputIndex": 0, - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "input": { - "amount": 20824279595, - "signatureIndices": [ - 0 - ] - } - }, - { - "txID": "2ahK5SzD8iqi5KBqpKfxrnWtrEoVwQCqJsMoB9kvChCaHgAQC9", - "outputIndex": 1, - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "input": { - "amount": 28119890783, - "signatureIndices": [ - 0 - ] - } - } - ], - "memo": "0x", - "validator": { - "nodeID": "NodeID-VT3YhgFaWEzy4Ap937qMeNEDscCammzG", - "start": 1682945406, - "end": 1684155006, - "weight": 48944170378 - }, - "stake": [ - { - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "output": { - "addresses": [ - "P-avax1tnuesf6cqwnjw7fxjyk7lhch0vhf0v95wj5jvy" - ], - "amount": 48944170378, - "locktime": 0, - "threshold": 1 - } - } - ], - "rewardsOwner": { - "addresses": [ - "P-avax19zfygxaf59stehzedhxjesads0p5jdvfeedal0" - ], - "locktime": 0, - "threshold": 1 - } - }, - "credentials": [ - { - "signatures": [ - "0x6954e90b98437646fde0c1d54c12190fc23ae5e319c4d95dda56b53b4a23e43825251289cdc3728f1f1e0d48eac20e5c8f097baa9b49ea8a3cb6a41bb272d16601" - ] - }, - { - "signatures": [ - "0x6954e90b98437646fde0c1d54c12190fc23ae5e319c4d95dda56b53b4a23e43825251289cdc3728f1f1e0d48eac20e5c8f097baa9b49ea8a3cb6a41bb272d16601" - ] - } - ], - "id": "28KVjSw5h3XKGuNpJXWY74EdnGq4TUWvCgEtJPymgQTvudiugb" - }, - "encoding": "json" - }, - "id": 1 -} -``` - -### `platform.getTxStatus` - -Gets a transaction’s status by its ID. If the transaction was dropped, response will include a -`reason` field with more information why the transaction was dropped. - -**Signature:** - -```sh -platform.getTxStatus({ - txID: string -}) -> {status: string} -``` - -`status` is one of: - -- `Committed`: The transaction is (or will be) accepted by every node -- `Processing`: The transaction is being voted on by this node -- `Dropped`: The transaction will never be accepted by any node in the network, check `reason` field - for more information -- `Unknown`: The transaction hasn’t been seen by this node - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getTxStatus", - "params": { - "txID":"TAG9Ns1sa723mZy1GSoGqWipK6Mvpaj7CAswVJGM6MkVJDF9Q" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "status": "Committed" - }, - "id": 1 -} -``` - -### `platform.getUTXOs` - -Gets the UTXOs that reference a given set of addresses. - -**Signature:** - -```sh -platform.getUTXOs( - { - addresses: []string, - limit: int, // optional - startIndex: { // optional - address: string, - utxo: string - }, - sourceChain: string, // optional - encoding: string, // optional - }, -) -> -{ - numFetched: int, - utxos: []string, - endIndex: { - address: string, - utxo: string - }, - encoding: string, -} -``` - -- `utxos` is a list of UTXOs such that each UTXO references at least one address in `addresses`. -- At most `limit` UTXOs are returned. If `limit` is omitted or greater than 1024, it is set to 1024. -- This method supports pagination. `endIndex` denotes the last UTXO returned. To get the next set of - UTXOs, use the value of `endIndex` as `startIndex` in the next call. -- If `startIndex` is omitted, will fetch all UTXOs up to `limit`. -- When using pagination (that is when `startIndex` is provided), UTXOs are not guaranteed to be unique - across multiple calls. That is, a UTXO may appear in the result of the first call, and then again - in the second call. -- When using pagination, consistency is not guaranteed across multiple calls. That is, the UTXO set - of the addresses may have changed between calls. -- `encoding` specifies the format for the returned UTXOs. Can only be `hex` when a value is - provided. - -#### **Example** - -Suppose we want all UTXOs that reference at least one of -`P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5` and `P-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6`. - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"platform.getUTXOs", - "params" :{ - "addresses":["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "P-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6"], - "limit":5, - "encoding": "hex" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -This gives response: - -```json -{ - "jsonrpc": "2.0", - "result": { - "numFetched": "5", - "utxos": [ - "0x0000a195046108a85e60f7a864bb567745a37f50c6af282103e47cc62f036cee404700000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216c1f01765", - "0x0000ae8b1b94444eed8de9a81b1222f00f1b4133330add23d8ac288bffa98b85271100000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216473d042a", - "0x0000731ce04b1feefa9f4291d869adc30a33463f315491e164d89be7d6d2d7890cfc00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21600dd3047", - "0x0000b462030cc4734f24c0bc224cf0d16ee452ea6b67615517caffead123ab4fbf1500000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216c71b387e", - "0x000054f6826c39bc957c0c6d44b70f961a994898999179cc32d21eb09c1908d7167b00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f2166290e79d" - ], - "endIndex": { - "address": "P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "utxo": "kbUThAUfmBXUmRgTpgD6r3nLj7rJUGho6xyht5nouNNypH45j" - }, - "encoding": "hex" - }, - "id": 1 -} -``` - -Since `numFetched` is the same as `limit`, we can tell that there may be more UTXOs that were not -fetched. We call the method again, this time with `startIndex`: - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"platform.getUTXOs", - "params" :{ - "addresses":["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "limit":5, - "startIndex": { - "address": "P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "utxo": "0x62fc816bb209857923770c286192ab1f9e3f11e4a7d4ba0943111c3bbfeb9e4a5ea72fae" - }, - "encoding": "hex" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -This gives response: - -```json -{ - "jsonrpc": "2.0", - "result": { - "numFetched": "4", - "utxos": [ - "0x000020e182dd51ee4dcd31909fddd75bb3438d9431f8e4efce86a88a684f5c7fa09300000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21662861d59", - "0x0000a71ba36c475c18eb65dc90f6e85c4fd4a462d51c5de3ac2cbddf47db4d99284e00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21665f6f83f", - "0x0000925424f61cb13e0fbdecc66e1270de68de9667b85baa3fdc84741d048daa69fa00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216afecf76a", - "0x000082f30327514f819da6009fad92b5dba24d27db01e29ad7541aa8e6b6b554615c00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216779c2d59" - ], - "endIndex": { - "address": "P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "utxo": "21jG2RfqyHUUgkTLe2tUp6ETGLriSDTW3th8JXFbPRNiSZ11jK" - }, - "encoding": "hex" - }, - "id": 1 -} -``` - -Since `numFetched` is less than `limit`, we know that we are done fetching UTXOs and don’t need to -call this method again. - -Suppose we want to fetch the UTXOs exported from the X Chain to the P Chain in order to build an -ImportTx. Then we need to call GetUTXOs with the `sourceChain` argument in order to retrieve the -atomic UTXOs: - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"platform.getUTXOs", - "params" :{ - "addresses":["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "sourceChain": "X", - "encoding": "hex" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -This gives response: - -```json -{ - "jsonrpc": "2.0", - "result": { - "numFetched": "1", - "utxos": [ - "0x00001f989ffaf18a18a59bdfbf209342aa61c6a62a67e8639d02bb3c8ddab315c6fa0000000139c33a499ce4c33a3b09cdd2cfa01ae70dbf2d18b2d7d168524440e55d55008800000007000000746a528800000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29cd704fe76" - ], - "endIndex": { - "address": "P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "utxo": "S5UKgWoVpoGFyxfisebmmRf8WqC7ZwcmYwS7XaDVZqoaFcCwK" - }, - "encoding": "hex" - }, - "id": 1 -} -``` - -### `platform.getValidatorsAt` - -Get the validators and their weights of a Subnet or the Primary Network at a given P-Chain height. - -**Signature:** - -```sh -platform.getValidatorsAt( - { - height: int, - subnetID: string, // optional - } -) -``` - -- `height` is the P-Chain height to get the validator set at. -- `subnetID` is the Subnet ID to get the validator set of. If not given, gets validator set of the - Primary Network. - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.getValidatorsAt", - "params": { - "height":1 - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "validators": { - "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg": 2000000000000000, - "NodeID-GWPcbFJZFfZreETSoWjPimr846mXEKCtu": 2000000000000000, - "NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ": 2000000000000000, - "NodeID-NFBbbJ4qCmNaCzeW7sxErhvWqvEQMnYcN": 2000000000000000, - "NodeID-P7oB2McjBGgW2NXXWVYjV8JEDFoW9xDE5": 2000000000000000 - } - }, - "id": 1 -} -``` - -### `platform.issueTx` - -Issue a transaction to the Platform Chain. - -**Signature:** - -```sh -platform.issueTx({ - tx: string, - encoding: string, // optional -}) -> {txID: string} -``` - -- `tx` is the byte representation of a transaction. -- `encoding` specifies the encoding format for the transaction bytes. Can only be `hex` when a value - is provided. -- `txID` is the transaction’s ID. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.issueTx", - "params": { - "tx":"0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730", - "encoding": "hex" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "txID": "G3BuH6ytQ2averrLxJJugjWZHTRubzCrUZEXoheG5JMqL5ccY" - }, - "id": 1 -} -``` - -### `platform.listAddresses` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning - -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). - -::: - -List addresses controlled by the given user. - -**Signature:** - -```sh -platform.listAddresses({ - username: string, - password: string -}) -> {addresses: []string} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.listAddresses", - "params": { - "username":"myUsername", - "password":"myPassword" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "addresses": ["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"] - }, - "id": 1 -} -``` - -### `platform.sampleValidators` - -Sample validators from the specified Subnet. - -**Signature:** - -```sh -platform.sampleValidators( - { - size: int, - subnetID: string, // optional - } -) -> -{ - validators: []string -} -``` - -- `size` is the number of validators to sample. -- `subnetID` is the Subnet to sampled from. If omitted, defaults to the Primary Network. -- Each element of `validators` is the ID of a validator. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"platform.sampleValidators", - "params" :{ - "size":2 - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "validators": [ - "NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ", - "NodeID-NFBbbJ4qCmNaCzeW7sxErhvWqvEQMnYcN" - ] - } -} -``` - -### `platform.validatedBy` - -Get the Subnet that validates a given blockchain. - -**Signature:** - -```sh -platform.validatedBy( - { - blockchainID: string - } -) -> {subnetID: string} -``` - -- `blockchainID` is the blockchain’s ID. -- `subnetID` is the ID of the Subnet that validates the blockchain. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.validatedBy", - "params": { - "blockchainID": "KDYHHKjM4yTJTT8H8qPs5KXzE6gQH5TZrmP1qVr1P6qECj3XN" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "subnetID": "2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r" - }, - "id": 1 -} -``` - -### `platform.validates` - -Get the IDs of the blockchains a Subnet validates. - -**Signature:** - -```sh -platform.validates( - { - subnetID: string - } -) -> {blockchainIDs: []string} -``` - -- `subnetID` is the Subnet’s ID. -- Each element of `blockchainIDs` is the ID of a blockchain the Subnet validates. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "platform.validates", - "params": { - "subnetID":"2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "blockchainIDs": [ - "KDYHHKjM4yTJTT8H8qPs5KXzE6gQH5TZrmP1qVr1P6qECj3XN", - "2TtHFqEAAJ6b33dromYMqfgavGPF3iCpdG3hwNMiart2aB5QHi" - ] - }, - "id": 1 -} -``` From 25bc936ae1174b61204b6085b09be1c598c3d823 Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 11 Mar 2024 18:18:19 +0100 Subject: [PATCH 02/18] source link function --- configs/remoteContent.js | 41 ++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/configs/remoteContent.js b/configs/remoteContent.js index 1c6eadaee17..355022bf6e5 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -50,7 +50,7 @@ function insertLinesAfterFirstLine(content, newLines) { return lines.join("\n"); } -let newLines = [ +let teleporterCourse = [ ` :::info Dive deeper into Teleporter and kickstart your journey in building cross-chain dApps by enrolling in our [Teleporter course](https://academy.avax.network/course/teleporter). @@ -58,6 +58,27 @@ Dive deeper into Teleporter and kickstart your journey in building cross-chain d `, ]; +// Function to insert link to source doc in the content +function insertSourceDocLink(content, sourceDocUrl) { + const lines = content.split("\n"); + const h1Index = lines.findIndex((line) => line.trim().startsWith("#")); + if (h1Index !== -1) { + const tip = [ + " :::tip", + ` This page was generated by a plugin that directly references this [file](${sourceDocUrl})`, + " in the AvalancheGo GitHub repository.", + " :::", + ]; + lines.splice(h1Index + 1, 0, ...tip); // Insert the admonition block after the h1 + } else { + console.error( + "No first-level heading found in the Markdown content. Admonition block not inserted." + ); + } + + return lines.join("\n"); +} + const remoteContent = [ [ "docusaurus-plugin-remote-content", @@ -111,7 +132,7 @@ ${updatedContent}`, const newContent = insertLinesAfterFirstLine( updatedContent, - newLines + teleporterCourse ); return { @@ -150,7 +171,7 @@ ${newContent}`, const newContent = insertLinesAfterFirstLine( updatedContent, - newLines + teleporterCourse ); return { @@ -189,7 +210,7 @@ ${newContent}`, const newContent = insertLinesAfterFirstLine( updatedContent, - newLines + teleporterCourse ); return { @@ -229,7 +250,7 @@ ${newContent}`, const newContent = insertLinesAfterFirstLine( updatedContent, - newLines + teleporterCourse ); return { @@ -268,7 +289,7 @@ ${newContent}`, const newContent = insertLinesAfterFirstLine( updatedContent, - newLines + teleporterCourse ); return { @@ -307,7 +328,7 @@ ${newContent}`, const newContent = insertLinesAfterFirstLine( updatedContent, - newLines + teleporterCourse ); return { @@ -409,9 +430,13 @@ ${updatedContent}`, content, "https://github.com/ava-labs/avalanchego/blob/master/vms/platformvm/" ); + const newContent = insertSourceDocLink( + updatedContent, + "https://github.com/ava-labs/avalanchego/tree/master/vms/platformvm/service.md" + ); return { filename: "api.md", - content: `${updatedContent}`, + content: `${newContent}`, }; } return undefined; From dec517723eeb364d2bd0eee898ec6770b9e3f4af Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 11 Mar 2024 19:04:03 +0100 Subject: [PATCH 03/18] fix teleporter deep dive page --- configs/remoteContent.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/configs/remoteContent.js b/configs/remoteContent.js index 355022bf6e5..01fbb4d0585 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -208,11 +208,6 @@ ${newContent}`, "https://github.com/ava-labs/teleporter/blob/main/" ); - const newContent = insertLinesAfterFirstLine( - updatedContent, - teleporterCourse - ); - return { filename: "deep-dive.md", content: `--- @@ -224,7 +219,7 @@ sidebar_position: 2 title: Teleporter Deep Dive --- -${newContent}`, +${updatedContent}`, }; } return undefined; From 52963272ee93309be0d396cb89e4a874e1339c1e Mon Sep 17 00:00:00 2001 From: meaghan Date: Tue, 12 Mar 2024 22:32:30 +0100 Subject: [PATCH 04/18] x-chain api --- .gitignore | 1 + configs/remoteContent.js | 29 + docs/reference/avalanchego/x-chain/api.md | 2319 --------------------- 3 files changed, 30 insertions(+), 2319 deletions(-) delete mode 100644 docs/reference/avalanchego/x-chain/api.md diff --git a/.gitignore b/.gitignore index dd2590a9583..4fc1ddcde68 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ docs/learn/acp.md # AvalancheGo API from GH repo via docusaurus-plugin-remote-content docs/reference/avalanchego/p-chain/api.md +docs/reference/avalanchego/x-chain/api.md # Misc .DS_Store diff --git a/configs/remoteContent.js b/configs/remoteContent.js index 01fbb4d0585..ae7d8d497cc 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -438,6 +438,35 @@ ${updatedContent}`, }, }, ], + [ + "docusaurus-plugin-remote-content", + { + // /docs/reference/x-chain/api.md + name: "x-api", + sourceBaseUrl: + "https://raw.githubusercontent.com/ava-labs/avalanchego/meag/docs-format/vms/avm/", + documents: ["service.md"], + outDir: "docs/reference/avalanchego/x-chain/", + // change filename and correct links + modifyContent(filename, content) { + if (filename.includes("service")) { + const updatedContent = replaceRelativeLinks( + content, + "https://github.com/ava-labs/avalanchego/blob/master/vms/avm/" + ); + const newContent = insertSourceDocLink( + updatedContent, + "https://github.com/ava-labs/avalanchego/tree/master/vms/avm/service.md" + ); + return { + filename: "api.md", + content: `${newContent}`, + }; + } + return undefined; + }, + }, + ], ]; module.exports = remoteContent; diff --git a/docs/reference/avalanchego/x-chain/api.md b/docs/reference/avalanchego/x-chain/api.md deleted file mode 100644 index dfba13b05f0..00000000000 --- a/docs/reference/avalanchego/x-chain/api.md +++ /dev/null @@ -1,2319 +0,0 @@ ---- -tags: [X-Chain, AvalancheGo APIs] -description: This page is an overview of the Exchange Chain (X-Chain) API associated with AvalancheGo. -sidebar_label: API -pagination_label: X-Chain API ---- - -# X-Chain API - -The [X-Chain](/learn/avalanche/avalanche-platform.md#x-chain), -Avalanche’s native platform for creating and trading assets, is an instance of the Avalanche Virtual -Machine (AVM). This API allows clients to create and trade assets on the X-Chain and other instances -of the AVM. - -## Format - -This API uses the `json 2.0` RPC format. For more information on making JSON RPC calls, see -[here](/reference/standards/guides/issuing-api-calls.md). - -## Endpoints - -`/ext/bc/X` to interact with the X-Chain. - -`/ext/bc/blockchainID` to interact with other AVM instances, where `blockchainID` is the ID of a -blockchain running the AVM. - -## Methods - -### `avm.buildGenesis` - -Given a JSON representation of this Virtual Machine’s genesis state, create the byte representation -of that state. - -#### **Endpoint** - -This call is made to the AVM’s static API endpoint: - -`/ext/vm/avm` - -Note: addresses should not include a chain prefix (that is `X-`) in calls to the static API endpoint -because these prefixes refer to a specific chain. - -**Signature:** - -```sh -avm.buildGenesis({ - networkID: int, - genesisData: JSON, - encoding: string, //optional -}) -> { - bytes: string, - encoding: string, -} -``` - -Encoding specifies the encoding format to use for arbitrary bytes, that is the genesis bytes that are -returned. Can only be `hex` when a value is provided. - -`genesisData` has this form: - -```json -{ -"genesisData" : - { - "assetAlias1": { // Each object defines an asset - "name": "human readable name", - "symbol":"AVAL", // Symbol is between 0 and 4 characters - "initialState": { - "fixedCap" : [ // Choose the asset type. - { // Can be "fixedCap", "variableCap", "limitedTransfer", "nonFungible" - "amount":1000, // At genesis, address A has - "address":"A" // 1000 units of asset - }, - { - "amount":5000, // At genesis, address B has - "address":"B" // 1000 units of asset - }, - ... // Can have many initial holders - ] - } - }, - "assetAliasCanBeAnythingUnique": { // Asset alias can be used in place of assetID in calls - "name": "human readable name", // names need not be unique - "symbol": "AVAL", // symbols need not be unique - "initialState": { - "variableCap" : [ // No units of the asset exist at genesis - { - "minters": [ // The signature of A or B can mint more of - "A", // the asset. - "B" - ], - "threshold":1 - }, - { - "minters": [ // The signatures of 2 of A, B and C can mint - "A", // more of the asset - "B", - "C" - ], - "threshold":2 - }, - ... // Can have many minter sets - ] - } - }, - ... // Can list more assets - } -} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "id" : 1, - "method" : "avm.buildGenesis", - "params" : { - "networkId": 16, - "genesisData": { - "asset1": { - "name": "myFixedCapAsset", - "symbol":"MFCA", - "initialState": { - "fixedCap" : [ - { - "amount":100000, - "address": "avax13ery2kvdrkd2nkquvs892gl8hg7mq4a6ufnrn6" - }, - { - "amount":100000, - "address": "avax1rvks3vpe4cm9yc0rrk8d5855nd6yxxutfc2h2r" - }, - { - "amount":50000, - "address": "avax1ntj922dj4crc4pre4e0xt3dyj0t5rsw9uw0tus" - }, - { - "amount":50000, - "address": "avax1yk0xzmqyyaxn26sqceuky2tc2fh2q327vcwvda" - } - ] - } - }, - "asset2": { - "name": "myVarCapAsset", - "symbol":"MVCA", - "initialState": { - "variableCap" : [ - { - "minters": [ - "avax1kcfg6avc94ct3qh2mtdg47thsk8nrflnrgwjqr", - "avax14e2s22wxvf3c7309txxpqs0qe9tjwwtk0dme8e" - ], - "threshold":1 - }, - { - "minters": [ - "avax1y8pveyn82gjyqr7kqzp72pqym6xlch9gt5grck", - "avax1c5cmm0gem70rd8dcnpel63apzfnfxye9kd4wwe", - "avax12euam2lwtwa8apvfdl700ckhg86euag2hlhmyw" - ], - "threshold":2 - } - ] - } - } - }, - "encoding": "hex" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/vm/avm -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "bytes": "0x0000000000010006617373657431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f6d794669786564436170417373657400044d464341000000000100000000000000010000000700000000000186a10000000000000000000000010000000152b219bc1b9ab0a9f2e3f9216e4460bd5db8d153bfa57c3c", - "encoding": "hex" - }, - "id": 1 -} -``` - -### `avm.createAddress` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Create a new address controlled by the given user. - -**Signature:** - -```sh -avm.createAddress({ - username: string, - password: string -}) -> {address: string} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "avm.createAddress", - "params": { - "username": "myUsername", - "password": "myPassword" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5" - }, - "id": 1 -} -``` - - - -### `avm.createFixedCapAsset` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Create a new fixed-cap, fungible asset. A quantity of it is created at initialization and then no -more is ever created. The asset can be sent with `avm.send`. - -**Signature:** - -```sh -avm.createFixedCapAsset({ - name: string, - symbol: string, - denomination: int, //optional - initialHolders: []{ - address: string, - amount: int - }, - from: []string, //optional - changeAddr: string, //optional - username: string, - password: string -}) -> -{ - assetID: string, - changeAddr: string -} -``` - -- `name` is a human-readable name for the asset. Not necessarily unique. -- `symbol` is a shorthand symbol for the asset. Between 0 and 4 characters. Not necessarily unique. - May be omitted. -- `denomination` determines how balances of this asset are displayed by user interfaces. If - `denomination` is 0, 100 units of this asset are displayed as 100. If `denomination` is 1, 100 - units of this asset are displayed as 10.0. If `denomination` is 2, 100 units of this asset are - displayed as 1.00, etc. Defaults to 0. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. -- `changeAddr` is the address any change will be sent to. If omitted, change is sent to one of the - addresses controlled by the user. -- `username` and `password` denote the user paying the transaction fee. -- Each element in `initialHolders` specifies that `address` holds `amount` units of the asset at - genesis. -- `assetID` is the ID of the new asset. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"avm.createFixedCapAsset", - "params" :{ - "name": "myFixedCapAsset", - "symbol":"MFCA", - "initialHolders": [ - { - "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "amount": 10000 - }, - { - "address":"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "amount":50000 - } - ], - "from":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "changeAddr":"X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "username":"myUsername", - "password":"myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "assetID": "ZiKfqRXCZgHLgZ4rxGU9Qbycdzuq5DRY4tdSNS9ku8kcNxNLD", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - } -} -``` - -### `avm.createNFTAsset` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Create a new non-fungible asset. No units of the asset exist at initialization. Minters can mint -units of this asset using `avm.mintNFT`. - -**Signature:** - -```sh -avm.createNFTAsset({ - name: string, - symbol: string, - minterSets: []{ - minters: []string, - threshold: int - }, - from: []string, //optional - changeAddr: string, //optional - username: string, - password: string -}) -> - { - assetID: string, - changeAddr: string, -} -``` - -- `name` is a human-readable name for the asset. Not necessarily unique. -- `symbol` is a shorthand symbol for the asset. Between 0 and 4 characters. Not necessarily unique. - May be omitted. -- `minterSets` is a list where each element specifies that `threshold` of the addresses in `minters` - may together mint more of the asset by signing a minting transaction. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. -- `changeAddr` is the address any change will be sent to. If omitted, change is sent to one of the - addresses controlled by the user. -- `username` pays the transaction fee. -- `assetID` is the ID of the new asset. -- `changeAddr` in the result is the address where any change was sent. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"avm.createNFTAsset", - "params" :{ - "name":"Coincert", - "symbol":"TIXX", - "minterSets":[ - { - "minters":[ - "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - ], - "threshold": 1 - } - ], - "from": ["X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"], - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "username":"myUsername", - "password":"myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "assetID": "2KGdt2HpFKpTH5CtGZjYt5XPWs6Pv9DLoRBhiFfntbezdRvZWP", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - }, - "id": 1 -} -``` - -### `avm.createVariableCapAsset` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Create a new variable-cap, fungible asset. No units of the asset exist at initialization. Minters -can mint units of this asset using `avm.mint`. - -**Signature:** - -```sh -avm.createVariableCapAsset({ - name: string, - symbol: string, - denomination: int, //optional - minterSets: []{ - minters: []string, - threshold: int - }, - from: []string, //optional - changeAddr: string, //optional - username: string, - password: string -}) -> -{ - assetID: string, - changeAddr: string, -} -``` - -- `name` is a human-readable name for the asset. Not necessarily unique. -- `symbol` is a shorthand symbol for the asset. Between 0 and 4 characters. Not necessarily unique. - May be omitted. -- `denomination` determines how balances of this asset are displayed by user interfaces. If - denomination is 0, 100 units of this asset are displayed as 100. If denomination is 1, 100 units - of this asset are displayed as 10.0. If denomination is 2, 100 units of this asset are displays as - .100, etc. -- `minterSets` is a list where each element specifies that `threshold` of the addresses in `minters` - may together mint more of the asset by signing a minting transaction. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. -- `changeAddr` is the address any change will be sent to. If omitted, change is sent to one of the - addresses controlled by the user. -- `username` pays the transaction fee. -- `assetID` is the ID of the new asset. -- `changeAddr` in the result is the address where any change was sent. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"avm.createVariableCapAsset", - "params" :{ - "name":"myVariableCapAsset", - "symbol":"MFCA", - "minterSets":[ - { - "minters":[ - "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5" - ], - "threshold": 1 - }, - { - "minters": [ - "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5" - ], - "threshold": 2 - } - ], - "from":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "changeAddr":"X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "username":"myUsername", - "password":"myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "assetID": "2QbZFE7J4MAny9iXHUwq8Pz8SpFhWk3maCw4SkinVPv6wPmAbK", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - } -} -``` - -### `avm.export` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -::: -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Send an asset from the X-Chain to the P-Chain or C-Chain. - -**Signature:** - -```sh -avm.export({ - to: string, - amount: int, - assetID: string, - from: []string, //optional - changeAddr: string, //optional - username: string, - password: string, -}) -> -{ - txID: string, - changeAddr: string, -} -``` - -- `to` is the P-Chain or C-Chain address the asset is sent to. -- `amount` is the amount of the asset to send. -- `assetID` is the asset id of the asset which is sent. Use `AVAX` for AVAX exports. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. -- `changeAddr` is the address any change will be sent to. If omitted, change is sent to one of the - addresses controlled by the user. -- The asset is sent from addresses controlled by `username` -- `password` is `username`‘s password. - -- `txID` is this transaction’s ID. -- `changeAddr` in the result is the address where any change was sent. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.export", - "params" :{ - "to":"C-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "amount": 10, - "assetID": "AVAX", - "from":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "changeAddr":"X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "username":"myUsername", - "password":"myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "txID": "2Eu16yNaepP57XrrJgjKGpiEDandpiGWW8xbUm6wcTYny3fejj", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - }, - "id": 1 -} -``` - - - -### `avm.exportKey` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Get the private key that controls a given address. The returned private key can be added to a user -with [`avm.importKey`](/reference/avalanchego/x-chain/api.md#avmimportkey). - -**Signature:** - -```sh -avm.exportKey({ - username: string, - password: string, - address: string -}) -> {privateKey: string} -``` - -- `username` must control `address`. -- `privateKey` is the string representation of the private key that controls `address`. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.exportKey", - "params" :{ - "username":"myUsername", - "password":"myPassword", - "address":"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "privateKey": "PrivateKey-2w4XiXxPfQK4TypYqnohRL8DRNTz9cGiGmwQ1zmgEqD9c9KWLq" - } -} -``` - -### `avm.getAddressTxs` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Returns all transactions that change the balance of the given address. A transaction is said to -change an address's balance if either is true: - -- A UTXO that the transaction consumes was at least partially owned by the address. -- A UTXO that the transaction produces is at least partially owned by the address. - -:::tip -Note: Indexing (`index-transactions`) must be enabled in the X-chain config. -::: - -**Signature:** - -```sh -avm.getAddressTxs({ - address: string, - cursor: uint64, // optional, leave empty to get the first page - assetID: string, - pageSize: uint64 // optional, defaults to 1024 -}) -> { - txIDs: []string, - cursor: uint64, -} -``` - -**Request Parameters:** - -- `address`: The address for which we're fetching related transactions -- `assetID`: Only return transactions that changed the balance of this asset. Must be an ID or an - alias for an asset. -- `pageSize`: Number of items to return per page. Optional. Defaults to 1024. - -**Response Parameter:** - -- `txIDs`: List of transaction IDs that affected the balance of this address. -- `cursor`: Page number or offset. Use this in request to get the next page. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"avm.getAddressTxs", - "params" :{ - "address":"X-local1kpprmfpzzm5lxyene32f6lr7j0aj7gxsu6hp9y", - "assetID":"AVAX", - "pageSize":20 - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "txIDs": ["SsJF7KKwxiUJkczygwmgLqo3XVRotmpKP8rMp74cpLuNLfwf6"], - "cursor": "1" - }, - "id": 1 -} -``` - -### `avm.getAllBalances` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Get the balances of all assets controlled by a given address. - -**Signature:** - -```sh -avm.getAllBalances({address:string}) -> { - balances: []{ - asset: string, - balance: int - } -} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"avm.getAllBalances", - "params" :{ - "address":"X-avax1c79e0dd0susp7dc8udq34jgk2yvve7hapvdyht" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "balances": [ - { - "asset": "AVAX", - "balance": "102" - }, - { - "asset": "2sdnziCz37Jov3QSNMXcFRGFJ1tgauaj6L7qfk7yUcRPfQMC79", - "balance": "10000" - } - ] - }, - "id": 1 -} -``` - -### `avm.getAssetDescription` - -Get information about an asset. - -**Signature:** - -```sh -avm.getAssetDescription({assetID: string}) -> { - assetId: string, - name: string, - symbol: string, - denomination: int -} -``` - -- `assetID` is the id of the asset for which the information is requested. -- `name` is the asset’s human-readable, not necessarily unique name. -- `symbol` is the asset’s symbol. -- `denomination` determines how balances of this asset are displayed by user interfaces. If - denomination is 0, 100 units of this asset are displayed as 100. If denomination is 1, 100 units - of this asset are displayed as 10.0. If denomination is 2, 100 units of this asset are displays as - .100, etc. - -:::note - -The AssetID for AVAX differs depending on the network you are on. - -Mainnet: FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z - -Testnet: U8iRqJoiJm8xZHAacmvYyZVwqQx6uDNtQeP3CQ6fcgQk3JqnK - -For finding the `assetID` of other assets, this [info] might be useful. -Also, `avm.getUTXOs` returns the `assetID` in its output. - -::: - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.getAssetDescription", - "params" :{ - "assetID" :"FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "name": "Avalanche", - "symbol": "AVAX", - "denomination": "9" - }, - "id": 1 -}` -``` - -### `avm.getBalance` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Get the balance of an asset controlled by a given address. - -**Signature:** - -```sh -avm.getBalance({ - address: string, - assetID: string -}) -> {balance: int} -``` - -- `address` owner of the asset -- `assetID` id of the asset for which the balance is requested - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"avm.getBalance", - "params" :{ - "address":"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "assetID": "2pYGetDWyKdHxpFxh2LHeoLNCH6H5vxxCxHQtFnnFaYxLsqtHC" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "balance": "299999999999900", - "utxoIDs": [ - { - "txID": "WPQdyLNqHfiEKp4zcCpayRHYDVYuh1hqs9c1RqgZXS4VPgdvo", - "outputIndex": 1 - } - ] - } -} -``` - -### `avm.getBlock` - -Returns the block with the given id. - -**Signature:** - -```sh -avm.getBlock({ - blockID: string - encoding: string // optional -}) -> { - block: string, - encoding: string -} -``` - -**Request:** - -- `blockID` is the block ID. It should be in cb58 format. -- `encoding` is the encoding format to use. Can be either `hex` or `json`. Defaults to `hex`. - -**Response:** - -- `block` is the transaction encoded to `encoding`. -- `encoding` is the `encoding`. - -#### Hex Example - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "avm.getBlock", - "params": { - "blockID": "tXJ4xwmR8soHE6DzRNMQPtiwQvuYsHn6eLLBzo2moDqBquqy6", - "encoding": "hex" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "block": "0x00000000002000000000641ad33ede17f652512193721df87994f783ec806bb5640c39ee73676caffcc3215e0651000000000049a80a000000010000000e0000000100000000000000000000000000000000000000000000000000000000000000000000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000002e1a2a3910000000000000000000000001000000015cf998275803a7277926912defdf177b2e97b0b400000001e0d825c5069a7336671dd27eaa5c7851d2cf449e7e1cdc469c5c9e5a953955950000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000050000008908223b680000000100000000000000005e45d02fcc9e585544008f1df7ae5c94bf7f0f2600000000641ad3b600000000642d48b60000005aedf802580000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000005aedf80258000000000000000000000001000000015cf998275803a7277926912defdf177b2e97b0b40000000b000000000000000000000001000000012892441ba9a160bcdc596dcd2cc3ad83c3493589000000010000000900000001adf2237a5fe2dfd906265e8e14274aa7a7b2ee60c66213110598ba34fb4824d74f7760321c0c8fb1e8d3c5e86909248e48a7ae02e641da5559351693a8a1939800286d4fa2", - "encoding": "hex" - }, - "id": 1 -} -``` - -### `avm.getBlockByHeight` - -Returns block at the given height. - -**Signature:** - -```sh -avm.getBlockByHeight({ - height: string - encoding: string // optional -}) -> { - block: string, - encoding: string -} -``` - -**Request:** - -- `blockHeight` is the block height. It should be in `string` format. -- `encoding` is the encoding format to use. Can be either `hex` or `json`. Defaults to `hex`. - -**Response:** - -- `block` is the transaction encoded to `encoding`. -- `encoding` is the `encoding`. - -#### Hex Example - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "avm.getBlockByHeight”, - "params": { - “height”: “275686313486”, - "encoding": “hex” - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "block": "0x00000000002000000000642f6739d4efcdd07e4d4919a7fc2020b8a0f081dd64c262aaace5a6dad22be0b55fec0700000000004db9e100000001000000110000000100000000000000000000000000000000000000000000000000000000000000000000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000005c6ece390000000000000000000000000100000001930ab7bf5018bfc6f9435c8b15ba2fe1e619c0230000000000000000ed5f38341e436e5d46e2bb00b45d62ae97d1b050c64bc634ae10626739e35c4b00000001c6dda861341665c3b555b46227fb5e56dc0a870c5482809349f04b00348af2a80000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000050000005c6edd7b40000000010000000000000001000000090000000178688f4d5055bd8733801f9b52793da885bef424c90526c18e4dd97f7514bf6f0c3d2a0e9a5ea8b761bc41902eb4902c34ef034c4d18c3db7c83c64ffeadd93600731676de", - "encoding": "hex" - }, - "id": 1 -} -``` - -### `avm.getHeight` - -Returns the height of the last accepted block. - -**Signature:** - -```sh -avm.getHeight() -> -{ - height: uint64, -} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "avm.getHeight", - "params": {}, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "height": "5094088" - }, - "id": 1 -} -``` - -### `avm.getTx` - -Returns the specified transaction. The `encoding` parameter sets the format of the returned -transaction. Can be either `"hex"` or `"json"`. Defaults to `"hex"`. - -**Signature:** - -```sh -avm.getTx({ - txID: string, - encoding: string, //optional -}) -> { - tx: string, - encoding: string, -} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.getTx", - "params" :{ - "txID":"2oJCbb8pfdxEHAf9A8CdN4Afj9VSR3xzyzNkf8tDv7aM1sfNFL", - "encoding": "json" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "tx": { - "unsignedTx": { - "networkID": 1, - "blockchainID": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", - "outputs": [], - "inputs": [ - { - "txID": "2jbZUvi6nHy3Pgmk8xcMpSg5cW6epkPqdKkHSCweb4eRXtq4k9", - "outputIndex": 1, - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "input": { - "amount": 2570382395, - "signatureIndices": [0] - } - } - ], - "memo": "0x", - "destinationChain": "11111111111111111111111111111111LpoYY", - "exportedOutputs": [ - { - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "output": { - "addresses": ["X-avax1tnuesf6cqwnjw7fxjyk7lhch0vhf0v95wj5jvy"], - "amount": 2569382395, - "locktime": 0, - "threshold": 1 - } - } - ] - }, - "credentials": [ - { - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "credential": { - "signatures": [ - "0x46ebcbcfbee3ece1fd15015204045cf3cb77f42c48d0201fc150341f91f086f177cfca8894ca9b4a0c55d6950218e4ea8c01d5c4aefb85cd7264b47bd57d224400" - ] - } - } - ], - "id": "2oJCbb8pfdxEHAf9A8CdN4Afj9VSR3xzyzNkf8tDv7aM1sfNFL" - }, - "encoding": "json" - }, - "id": 1 -} -``` - -Where: - -- `credentials` is a list of this transaction's credentials. Each credential proves that this - transaction's creator is allowed to consume one of this transaction's inputs. Each credential is a - list of signatures. -- `unsignedTx` is the non-signature portion of the transaction. -- `networkID` is the ID of the network this transaction happened on. (Avalanche Mainnet is `1`.) -- `blockchainID` is the ID of the blockchain this transaction happened on. (Avalanche Mainnet - X-Chain is `2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM`.) -- Each element of `outputs` is an output (UTXO) of this transaction that is not being exported to - another chain. -- Each element of `inputs` is an input of this transaction which has not been imported from another - chain. -- Import Transactions have additional fields `sourceChain` and `importedInputs`, which specify the - blockchain ID that assets are being imported from, and the inputs that are being imported. -- Export Transactions have additional fields `destinationChain` and `exportedOutputs`, which specify - the blockchain ID that assets are being exported to, and the UTXOs that are being exported. - -An output contains: - -- `assetID`: The ID of the asset being transferred. (The Mainnet Avax ID is - `FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z`.) -- `fxID`: The ID of the FX this output uses. -- `output`: The FX-specific contents of this output. - -Most outputs use the secp256k1 FX, look like this: - -```json -{ - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "output": { - "addresses": ["X-avax126rd3w35xwkmj8670zvf7y5r8k36qa9z9803wm"], - "amount": 1530084210, - "locktime": 0, - "threshold": 1 - } -} -``` - -The above output can be consumed after Unix time `locktime` by a transaction that has signatures -from `threshold` of the addresses in `addresses`. - -### `avm.getTxStatus` - -:::caution -Deprecated as of **v1.10.0**. -::: - -Get the status of a transaction sent to the network. - -**Signature:** - -```sh -avm.getTxStatus({txID: string}) -> {status: string} -``` - -`status` is one of: - -- `Accepted`: The transaction is (or will be) accepted by every node -- `Processing`: The transaction is being voted on by this node -- `Rejected`: The transaction will never be accepted by any node in the network -- `Unknown`: The transaction hasn’t been seen by this node - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.getTxStatus", - "params" :{ - "txID":"2QouvFWUbjuySRxeX5xMbNCuAaKWfbk5FeEa2JmoF85RKLk2dD" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "status": "Accepted" - } -} -``` - -### `avm.getUTXOs` - -Gets the UTXOs that reference a given address. If `sourceChain` is specified, then it will retrieve -the atomic UTXOs exported from that chain to the X Chain. - -**Signature:** - -```sh -avm.getUTXOs({ - addresses: []string, - limit: int, //optional - startIndex: { //optional - address: string, - utxo: string - }, - sourceChain: string, //optional - encoding: string //optional -}) -> { - numFetched: int, - utxos: []string, - endIndex: { - address: string, - utxo: string - }, - sourceChain: string, //optional - encoding: string -} -``` - -- `utxos` is a list of UTXOs such that each UTXO references at least one address in `addresses`. -- At most `limit` UTXOs are returned. If `limit` is omitted or greater than 1024, it is set to 1024. -- This method supports pagination. `endIndex` denotes the last UTXO returned. To get the next set of - UTXOs, use the value of `endIndex` as `startIndex` in the next call. -- If `startIndex` is omitted, will fetch all UTXOs up to `limit`. -- When using pagination (when `startIndex` is provided), UTXOs are not guaranteed to be unique - across multiple calls. That is, a UTXO may appear in the result of the first call, and then again - in the second call. -- When using pagination, consistency is not guaranteed across multiple calls. That is, the UTXO set - of the addresses may have changed between calls. -- `encoding` sets the format for the returned UTXOs. Can only be `hex` when a value is provided. - -#### **Example** - -Suppose we want all UTXOs that reference at least one of -`X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5` and `X-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6`. - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.getUTXOs", - "params" :{ - "addresses":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "X-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6"], - "limit":5, - "encoding": "hex" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -This gives response: - -```json -{ - "jsonrpc": "2.0", - "result": { - "numFetched": "5", - "utxos": [ - "0x0000a195046108a85e60f7a864bb567745a37f50c6af282103e47cc62f036cee404700000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216c1f01765", - "0x0000ae8b1b94444eed8de9a81b1222f00f1b4133330add23d8ac288bffa98b85271100000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216473d042a", - "0x0000731ce04b1feefa9f4291d869adc30a33463f315491e164d89be7d6d2d7890cfc00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21600dd3047", - "0x0000b462030cc4734f24c0bc224cf0d16ee452ea6b67615517caffead123ab4fbf1500000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216c71b387e", - "0x000054f6826c39bc957c0c6d44b70f961a994898999179cc32d21eb09c1908d7167b00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f2166290e79d" - ], - "endIndex": { - "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "utxo": "kbUThAUfmBXUmRgTpgD6r3nLj7rJUGho6xyht5nouNNypH45j" - }, - "encoding": "hex" - }, - "id": 1 -} -``` - -Since `numFetched` is the same as `limit`, we can tell that there may be more UTXOs that were not -fetched. We call the method again, this time with `startIndex`: - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :2, - "method" :"avm.getUTXOs", - "params" :{ - "addresses":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "limit":5, - "startIndex": { - "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "utxo": "kbUThAUfmBXUmRgTpgD6r3nLj7rJUGho6xyht5nouNNypH45j" - }, - "encoding": "hex" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -This gives response: - -```json -{ - "jsonrpc": "2.0", - "result": { - "numFetched": "4", - "utxos": [ - "0x000020e182dd51ee4dcd31909fddd75bb3438d9431f8e4efce86a88a684f5c7fa09300000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21662861d59", - "0x0000a71ba36c475c18eb65dc90f6e85c4fd4a462d51c5de3ac2cbddf47db4d99284e00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21665f6f83f", - "0x0000925424f61cb13e0fbdecc66e1270de68de9667b85baa3fdc84741d048daa69fa00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216afecf76a", - "0x000082f30327514f819da6009fad92b5dba24d27db01e29ad7541aa8e6b6b554615c00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216779c2d59" - ], - "endIndex": { - "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "utxo": "21jG2RfqyHUUgkTLe2tUp6ETGLriSDTW3th8JXFbPRNiSZ11jK" - }, - "encoding": "hex" - }, - "id": 1 -} -``` - -Since `numFetched` is less than `limit`, we know that we are done fetching UTXOs and don’t need to -call this method again. - -Suppose we want to fetch the UTXOs exported from the P Chain to the X Chain in order to build an -ImportTx. Then we need to call GetUTXOs with the `sourceChain` argument in order to retrieve the -atomic UTXOs: - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.getUTXOs", - "params" :{ - "addresses":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "X-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6"], - "limit":5, - "sourceChain": "P", - "encoding": "hex" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -This gives response: - -```json -{ - "jsonrpc": "2.0", - "result": { - "numFetched": "1", - "utxos": [ - "0x00001f989ffaf18a18a59bdfbf209342aa61c6a62a67e8639d02bb3c8ddab315c6fa0000000039c33a499ce4c33a3b09cdd2cfa01ae70dbf2d18b2d7d168524440e55d550088000000070011c304cd7eb5c0000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c83497819" - ], - "endIndex": { - "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "utxo": "2Sz2XwRYqUHwPeiKoRnZ6ht88YqzAF1SQjMYZQQaB5wBFkAqST" - }, - "encoding": "hex" - }, - "id": 1 -} -``` - -### `avm.import` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Finalize a transfer of an asset from the P-Chain or C-Chain to the X-Chain. - -**Signature:** - -```sh -avm.import({ - to: string, - sourceChain: string, - username: string, - password: string, -}) -> {txID: string} -``` - -- `to` is the address the AVAX is sent to. This must be the same as the `to` argument in the - corresponding call to the P-Chain’s `exportAVAX` or C-Chain's `export`. -- `sourceChain` is the ID or alias of the chain the AVAX is being imported from. To import funds - from the C-Chain, use `"C"`. -- `username` is the user that controls `to`. -- `txID` is the ID of the newly created atomic transaction. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.import", - "params" :{ - "to":"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "sourceChain":"C", - "username":"myUsername", - "password":"myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "txID": "2gXpf4jFoMAWQ3rxBfavgFfSdLkL2eFUYprKsUQuEdB5H6Jo1H" - }, - "id": 1 -} -``` - - - -### `avm.importKey` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Give a user control over an address by providing the private key that controls the address. - -**Signature:** - -```sh -avm.importKey({ - username: string, - password: string, - privateKey: string -}) -> {address: string} -``` - -- Add `privateKey` to `username`‘s set of private keys. `address` is the address `username` now - controls with the private key. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.importKey", - "params" :{ - "username":"myUsername", - "password":"myPassword", - "privateKey":"PrivateKey-2w4XiXxPfQK4TypYqnohRL8DRNTz9cGiGmwQ1zmgEqD9c9KWLq" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5" - } -} -``` - -### `avm.issueTx` - -Send a signed transaction to the network. `encoding` specifies the format of the signed transaction. -Can only be `hex` when a value is provided. - -**Signature:** - -```sh -avm.issueTx({ - tx: string, - encoding: string, //optional -}) -> { - txID: string -} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"avm.issueTx", - "params" :{ - "tx":"0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730", - "encoding": "hex" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "txID": "NUPLwbt2hsYxpQg4H2o451hmTWQ4JZx2zMzM4SinwtHgAdX1JLPHXvWSXEnpecStLj" - } -} -``` - -### `avm.listAddresses` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -List addresses controlled by the given user. - -**Signature:** - -```sh -avm.listAddresses({ - username: string, - password: string -}) -> {addresses: []string} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc": "2.0", - "method": "avm.listAddresses", - "params": { - "username":"myUsername", - "password":"myPassword" - }, - "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "addresses": ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"] - }, - "id": 1 -} -``` - -### `avm.mint` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Mint units of a variable-cap asset created with -[`avm.createVariableCapAsset`](/reference/avalanchego/x-chain/api.md#avmcreatevariablecapasset). - -**Signature:** - -```sh -avm.mint({ - amount: int, - assetID: string, - to: string, - from: []string, //optional - changeAddr: string, //optional - username: string, - password: string -}) -> -{ - txID: string, - changeAddr: string, -} -``` - -- `amount` units of `assetID` will be created and controlled by address `to`. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. -- `changeAddr` is the address any change will be sent to. If omitted, change is sent to one of the - addresses controlled by the user. -- `username` is the user that pays the transaction fee. `username` must hold keys giving it - permission to mint more of this asset. That is, it must control at least _threshold_ keys for one - of the minter sets. -- `txID` is this transaction’s ID. -- `changeAddr` in the result is the address where any change was sent. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"avm.mint", - "params" :{ - "amount":10000000, - "assetID":"i1EqsthjiFTxunrj8WD2xFSrQ5p2siEKQacmCCB5qBFVqfSL2", - "to":"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "from":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "changeAddr":"X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "username":"myUsername", - "password":"myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "txID": "2oGdPdfw2qcNUHeqjw8sU2hPVrFyNUTgn6A8HenDra7oLCDtja", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - } -} -``` - -### `avm.mintNFT` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Mint non-fungible tokens which were created with -[`avm.createNFTAsset`](/reference/avalanchego/x-chain/api.md#avmcreatenftasset). - -**Signature:** - -```sh -avm.mintNFT({ - assetID: string, - payload: string, - to: string, - encoding: string, //optional - from: []string, //optional - changeAddr: string, //optional - username: string, - password: string -}) -> -{ - txID: string, - changeAddr: string, -} -``` - -- `assetID` is the assetID of the newly created NFT asset. -- `payload` is an arbitrary payload of up to 1024 bytes. Its encoding format is specified by the - `encoding` argument. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. -- `changeAddr` is the address any change will be sent to. If omitted, change is sent to one of the - addresses controlled by the user. -- `username` is the user that pays the transaction fee. `username` must hold keys giving it - permission to mint more of this asset. That is, it must control at least _threshold_ keys for one - of the minter sets. -- `txID` is this transaction’s ID. -- `changeAddr` in the result is the address where any change was sent. -- `encoding` is the encoding format to use for the payload argument. Can only be `hex` when a value - is provided. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"avm.mintNFT", - "params" :{ - "assetID":"2KGdt2HpFKpTH5CtGZjYt5XPWs6Pv9DLoRBhiFfntbezdRvZWP", - "payload":"0x415641204c61627338259aed", - "to":"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "from":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "changeAddr":"X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "username":"myUsername", - "password":"myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "txID": "2oGdPdfw2qcNUHeqjw8sU2hPVrFyNUTgn6A8HenDra7oLCDtja", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - } -} -``` - -### `avm.send` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Send a quantity of an asset to an address. - -**Signature:** - -```sh -avm.send({ - amount: int, - assetID: string, - to: string, - memo: string, //optional - from: []string, //optional - changeAddr: string, //optional - username: string, - password: string -}) -> {txID: string, changeAddr: string} -``` - -- Sends `amount` units of asset with ID `assetID` to address `to`. `amount` is denominated in the - smallest increment of the asset. For AVAX this is 1 nAVAX (one billionth of 1 AVAX.) -- `to` is the X-Chain address the asset is sent to. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. -- `changeAddr` is the address any change will be sent to. If omitted, change is sent to one of the - addresses controlled by the user. -- You can attach a `memo`, whose length can be up to 256 bytes. -- The asset is sent from addresses controlled by user `username`. (Of course, that user will need to - hold at least the balance of the asset being sent.) - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.send", - "params" :{ - "assetID" : "AVAX", - "amount" : 10000, - "to" : "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "from" : ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "memo" : "hi, mom!", - "username" : "userThatControlsAtLeast10000OfThisAsset", - "password" : "myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "txID": "2iXSVLPNVdnFqn65rRvLrsu8WneTFqBJRMqkBJx5vZTwAQb8c1", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - } -} -``` - -### `avm.sendMultiple` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Sends multiple transfers of `amount` of `assetID`, to a specified address from a list of owned -addresses. - -**Signature:** - -```sh -avm.sendMultiple({ - outputs: []{ - assetID: string, - amount: int, - to: string - }, - from: []string, //optional - changeAddr: string, //optional - memo: string, //optional - username: string, - password: string -}) -> {txID: string, changeAddr: string} -``` - -- `outputs` is an array of object literals which each contain an `assetID`, `amount` and `to`. -- `memo` is an optional message, whose length can be up to 256 bytes. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. -- `changeAddr` is the address any change will be sent to. If omitted, change is sent to one of the - addresses controlled by the user. -- The asset is sent from addresses controlled by user `username`. (Of course, that user will need to - hold at least the balance of the asset being sent.) - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.sendMultiple", - "params" :{ - "outputs": [ - { - "assetID" : "AVAX", - "to" : "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "amount" : 1000000000 - }, - { - "assetID" : "26aqSTpZuWDAVtRmo44fjCx4zW6PDEx3zy9Qtp2ts1MuMFn9FB", - "to" : "X-avax18knvhxx8uhc0mwlgrfyzjcm2wrd6e60w37xrjq", - "amount" : 10 - } - ], - "memo" : "hi, mom!", - "from" : ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "username" : "username", - "password" : "myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "txID": "2iXSVLPNVdnFqn65rRvLrsu8WneTFqBJRMqkBJx5vZTwAQb8c1", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - } -} -``` - -### `avm.sendNFT` - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Send a non-fungible token. - -**Signature:** - -```sh -avm.sendNFT({ - assetID: string, - groupID: number, - to: string, - from: []string, //optional - changeAddr: string, //optional - username: string, - password: string -}) -> {txID: string} -``` - -- `assetID` is the asset ID of the NFT being sent. -- `groupID` is the NFT group from which to send the NFT. NFT creation allows multiple groups under - each NFT ID. You can issue multiple NFTs to each group. -- `to` is the X-Chain address the NFT is sent to. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. `changeAddr` is the address any change will be sent to. If omitted, change is - sent to one of the addresses controlled by the user. -- The asset is sent from addresses controlled by user `username`. (Of course, that user will need to - hold at least the balance of the NFT being sent.) - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.sendNFT", - "params" :{ - "assetID" : "2KGdt2HpFKpTH5CtGZjYt5XPWs6Pv9DLoRBhiFfntbezdRvZWP", - "groupID" : 0, - "to" : "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "from" : ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "username" : "myUsername", - "password" : "myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "txID": "DoR2UtG1Trd3Q8gWXVevNxD666Q3DPqSFmBSMPQ9dWTV8Qtuy", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - }, - "id": 1 -} -``` - -### `wallet.issueTx` - -Send a signed transaction to the network and assume the TX will be accepted. `encoding` specifies -the format of the signed transaction. Can only be `hex` when a value is provided. - -This call is made to the wallet API endpoint: - -`/ext/bc/X/wallet` - -:::caution - -Endpoint deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -**Signature:** - -```sh -wallet.issueTx({ - tx: string, - encoding: string, //optional -}) -> { - txID: string -} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" : 1, - "method" :"wallet.issueTx", - "params" :{ - "tx":"0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730", - "encoding": "hex" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X/wallet -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "txID": "NUPLwbt2hsYxpQg4H2o451hmTWQ4JZx2zMzM4SinwtHgAdX1JLPHXvWSXEnpecStLj" - } -} -``` - -### `wallet.send` - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Send a quantity of an asset to an address and assume the TX will be accepted so that future calls -can use the modified UTXO set. - -This call is made to the wallet API endpoint: - -`/ext/bc/X/wallet` - -:::caution - -Endpoint deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -**Signature:** - -```sh -wallet.send({ - amount: int, - assetID: string, - to: string, - memo: string, //optional - from: []string, //optional - changeAddr: string, //optional - username: string, - password: string -}) -> {txID: string, changeAddr: string} -``` - -- Sends `amount` units of asset with ID `assetID` to address `to`. `amount` is denominated in the - smallest increment of the asset. For AVAX this is 1 nAVAX (one billionth of 1 AVAX.) -- `to` is the X-Chain address the asset is sent to. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. -- `changeAddr` is the address any change will be sent to. If omitted, change is sent to one of the - addresses controlled by the user. -- You can attach a `memo`, whose length can be up to 256 bytes. -- The asset is sent from addresses controlled by user `username`. (Of course, that user will need to - hold at least the balance of the asset being sent.) - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"wallet.send", - "params" :{ - "assetID" : "AVAX", - "amount" : 10000, - "to" : "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "memo" : "hi, mom!", - "from" : ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "username" : "userThatControlsAtLeast10000OfThisAsset", - "password" : "myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X/wallet -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "txID": "2iXSVLPNVdnFqn65rRvLrsu8WneTFqBJRMqkBJx5vZTwAQb8c1", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - } -} -``` - -### `wallet.sendMultiple` - -:::warning -Not recommended for use on Mainnet. See warning notice in [Keystore API](/reference/avalanchego/keystore-api.md). -::: - -Send multiple transfers of `amount` of `assetID`, to a specified address from a list of owned of -addresses and assume the TX will be accepted so that future calls can use the modified UTXO set. - -This call is made to the wallet API endpoint: - -`/ext/bc/X/wallet` - -:::caution - -Endpoint deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -**Signature:** - -```sh -wallet.sendMultiple({ - outputs: []{ - assetID: string, - amount: int, - to: string - }, - from: []string, //optional - changeAddr: string, //optional - memo: string, //optional - username: string, - password: string -}) -> {txID: string, changeAddr: string} -``` - -- `outputs` is an array of object literals which each contain an `assetID`, `amount` and `to`. -- `from` are the addresses that you want to use for this operation. If omitted, uses any of your - addresses as needed. -- `changeAddr` is the address any change will be sent to. If omitted, change is sent to one of the - addresses controlled by the user. -- You can attach a `memo`, whose length can be up to 256 bytes. -- The asset is sent from addresses controlled by user `username`. (Of course, that user will need to - hold at least the balance of the asset being sent.) - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"wallet.sendMultiple", - "params" :{ - "outputs": [ - { - "assetID" : "AVAX", - "to" : "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", - "amount" : 1000000000 - }, - { - "assetID" : "26aqSTpZuWDAVtRmo44fjCx4zW6PDEx3zy9Qtp2ts1MuMFn9FB", - "to" : "X-avax18knvhxx8uhc0mwlgrfyzjcm2wrd6e60w37xrjq", - "amount" : 10 - } - ], - "memo" : "hi, mom!", - "from" : ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8", - "username" : "username", - "password" : "myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X/wallet -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "txID": "2iXSVLPNVdnFqn65rRvLrsu8WneTFqBJRMqkBJx5vZTwAQb8c1", - "changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8" - } -} -``` - -### Events - -Listen for transactions on a specified address. - -This call is made to the events API endpoint: - -`/ext/bc/X/events` - -:::caution - -Endpoint deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -#### **Golang Example** - -```go -package main - -import ( - "encoding/json" - "log" - "net" - "net/http" - "sync" - - "github.com/ava-labs/avalanchego/api" - "github.com/ava-labs/avalanchego/pubsub" - "github.com/gorilla/websocket" -) - -func main() { - dialer := websocket.Dialer{ - NetDial: func(netw, addr string) (net.Conn, error) { - return net.Dial(netw, addr) - }, - } - - httpHeader := http.Header{} - conn, _, err := dialer.Dial("ws://localhost:9650/ext/bc/X/events", httpHeader) - if err != nil { - panic(err) - } - - waitGroup := &sync.WaitGroup{} - waitGroup.Add(1) - - readMsg := func() { - defer waitGroup.Done() - - for { - mt, msg, err := conn.ReadMessage() - if err != nil { - log.Println(err) - return - } - switch mt { - case websocket.TextMessage: - log.Println(string(msg)) - default: - log.Println(mt, string(msg)) - } - } - } - - go readMsg() - - cmd := &pubsub.Command{NewSet: &pubsub.NewSet{}} - cmdmsg, err := json.Marshal(cmd) - if err != nil { - panic(err) - } - err = conn.WriteMessage(websocket.TextMessage, cmdmsg) - if err != nil { - panic(err) - } - - var addresses []string - addresses = append(addresses, " X-fuji....") - cmd = &pubsub.Command{AddAddresses: &pubsub.AddAddresses{JSONAddresses: api.JSONAddresses{Addresses: addresses}}} - cmdmsg, err = json.Marshal(cmd) - if err != nil { - panic(err) - } - - err = conn.WriteMessage(websocket.TextMessage, cmdmsg) - if err != nil { - panic(err) - } - - waitGroup.Wait() -} -``` - -**Operations:** - -| Command | Description | Example | Arguments | -| :--------------- | :--------------------------- | :------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------- | -| **NewSet** | create a new address map set | `{"newSet":{}}` | | -| **NewBloom** | create a new bloom set. | `{"newBloom":{"maxElements":"1000","collisionProb":"0.0100"}}` | `maxElements` - number of elements in filter must be > 0 `collisionProb` - allowed collision probability must be > 0 and <= 1 | -| **AddAddresses** | add an address to the set | `{"addAddresses":{"addresses":\["X-fuji..."\]}}` | addresses - list of addresses to match | - -Calling **NewSet** or **NewBloom** resets the filter, and must be followed with **AddAddresses**. -**AddAddresses** can be called multiple times. - -**Set details:** - -- **NewSet** performs absolute address matches, if the address is in the set you will be sent the - transaction. -- **NewBloom** [Bloom filtering](https://en.wikipedia.org/wiki/Bloom_filter) can produce false - positives, but can allow a greater number of addresses to be filtered. If the addresses is in the - filter, you will be sent the transaction. - -**Example Response:** - -```json -2021/05/11 15:59:35 {"txID":"22HWKHrREyXyAiDnVmGp3TQQ79tHSSVxA9h26VfDEzoxvwveyk"} -``` From 358443a272ca914f67d342af1a57effc496ce33c Mon Sep 17 00:00:00 2001 From: meaghan Date: Tue, 12 Mar 2024 22:36:24 +0100 Subject: [PATCH 05/18] admin-api --- .gitignore | 1 + configs/remoteContent.js | 29 ++ docs/reference/avalanchego/admin-api.md | 442 ------------------------ 3 files changed, 30 insertions(+), 442 deletions(-) delete mode 100644 docs/reference/avalanchego/admin-api.md diff --git a/.gitignore b/.gitignore index 4fc1ddcde68..e087d6e9fef 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ docs/learn/acp.md # AvalancheGo API from GH repo via docusaurus-plugin-remote-content docs/reference/avalanchego/p-chain/api.md docs/reference/avalanchego/x-chain/api.md +docs/reference/avalanchego/admin-api.md # Misc .DS_Store diff --git a/configs/remoteContent.js b/configs/remoteContent.js index ae7d8d497cc..f0085560677 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -467,6 +467,35 @@ ${updatedContent}`, }, }, ], + [ + "docusaurus-plugin-remote-content", + { + // /docs/reference/admin-api.md + name: "admin-api", + sourceBaseUrl: + "https://raw.githubusercontent.com/ava-labs/avalanchego/meag/docs-format/api/admin/", + documents: ["service.md"], + outDir: "docs/reference/avalanchego/", + // change filename and correct links + modifyContent(filename, content) { + if (filename.includes("service")) { + const updatedContent = replaceRelativeLinks( + content, + "https://github.com/ava-labs/avalanchego/blob/master/vms/avm/" + ); + const newContent = insertSourceDocLink( + updatedContent, + "https://github.com/ava-labs/avalanchego/tree/master/api/admin/service.md" + ); + return { + filename: "admin-api.md", + content: `${newContent}`, + }; + } + return undefined; + }, + }, + ], ]; module.exports = remoteContent; diff --git a/docs/reference/avalanchego/admin-api.md b/docs/reference/avalanchego/admin-api.md deleted file mode 100644 index 1ffe42aca39..00000000000 --- a/docs/reference/avalanchego/admin-api.md +++ /dev/null @@ -1,442 +0,0 @@ ---- -tags: [AvalancheGo APIs] -description: This page is an overview of the Admin API associated with AvalancheGo. -sidebar_label: Admin API -pagination_label: Admin API ---- - -# Admin API - -This API can be used for measuring node health and debugging. - -:::info -The Admin API is disabled by default for security reasons. To run a node with the Admin API -enabled, use [config flag `--api-admin-enabled=true`](/nodes/configure/avalanchego-config-flags.md#--api-admin-enabled-boolean). - -This API set is for a specific node, it is unavailable on the [public server](/tooling/rpc-providers.md). - -::: - -## Format - -This API uses the `json 2.0` RPC format. For details, see [here](/reference/standards/guides/issuing-api-calls.md). - -## Endpoint - -```text -/ext/admin -``` - -## Methods - -### `admin.alias` - -Assign an API endpoint an alias, a different endpoint for the API. The original endpoint will still -work. This change only affects this node; other nodes will not know about this alias. - -**Signature:** - -```text -admin.alias({endpoint:string, alias:string}) -> {} -``` - -- `endpoint` is the original endpoint of the API. `endpoint` should only include the part of the - endpoint after `/ext/`. -- The API being aliased can now be called at `ext/alias`. -- `alias` can be at most 512 characters. - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"admin.alias", - "params": { - "alias":"myAlias", - "endpoint":"bc/X" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": {} -} -``` - -Now, calls to the X-Chain can be made to either `/ext/bc/X` or, equivalently, to `/ext/myAlias`. - -### `admin.aliasChain` - -Give a blockchain an alias, a different name that can be used any place the blockchain’s ID is used. - -:::note Aliasing a chain can also be done via the [Node API](https://docs.avax.network/nodes/configure/avalanchego-config-flags.md#--chain-aliases-file-string). -Note that the alias is set for each chain on each node individually. In a multi-node Subnet, the -same alias should be configured on each node to use an alias across a Subnet successfully. Setting -an alias for a chain on one node does not register that alias with other nodes automatically. - -::: - -**Signature:** - -```text -admin.aliasChain( - { - chain:string, - alias:string - } -) -> {} -``` - -- `chain` is the blockchain’s ID. -- `alias` can now be used in place of the blockchain’s ID (in API endpoints, for example.) - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"admin.aliasChain", - "params": { - "chain":"sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM", - "alias":"myBlockchainAlias" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": {} -} -``` - -Now, instead of interacting with the blockchain whose ID is -`sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM` by making API calls to -`/ext/bc/sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM`, one can also make calls to -`ext/bc/myBlockchainAlias`. - -### `admin.getChainAliases` - -Returns the aliases of the chain - -**Signature:** - -```text -admin.getChainAliases( - { - chain:string - } -) -> {aliases:string[]} -``` - -- `chain` is the blockchain’s ID. - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"admin.getChainAliases", - "params": { - "chain":"sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "aliases": [ - "X", - "avm", - "2eNy1mUFdmaxXNj1eQHUe7Np4gju9sJsEtWQ4MX3ToiNKuADed" - ] - }, - "id": 1 -} -``` - -### `admin.getLoggerLevel` - -Returns log and display levels of loggers. - -**Signature:** - -```text -admin.getLoggerLevel( - { - loggerName:string // optional - } -) -> { - loggerLevels: { - loggerName: { - logLevel: string, - displayLevel: string - } - } - } -``` - -- `loggerName` is the name of the logger to be returned. This is an optional argument. If not - specified, it returns all possible loggers. - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"admin.getLoggerLevel", - "params": { - "loggerName": "C" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "loggerLevels": { - "C": { - "logLevel": "DEBUG", - "displayLevel": "INFO" - } - } - }, - "id": 1 -} -``` - -### `admin.loadVMs` - -Dynamically loads any virtual machines installed on the node as plugins. See -[here](/build/vm/intro#installing-a-vm) for more information on how to install a -virtual machine on a node. - -**Signature:** - -```sh -admin.loadVMs() -> { - newVMs: map[string][]string - failedVMs: map[string]string, -} -``` - -- `failedVMs` is only included in the response if at least one virtual machine fails to be loaded. - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"admin.loadVMs", - "params" :{} -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "newVMs": { - "tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH": ["foovm"] - }, - "failedVMs": { - "rXJsCSEYXg2TehWxCEEGj6JU2PWKTkd6cBdNLjoe2SpsKD9cy": "error message" - } - }, - "id": 1 -} -``` - -### `admin.lockProfile` - -Writes a profile of mutex statistics to `lock.profile`. - -**Signature:** - -```text -admin.lockProfile() -> {} -``` - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"admin.lockProfile", - "params" :{} -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": {} -} -``` - -### `admin.memoryProfile` - -Writes a memory profile of the to `mem.profile`. - -**Signature:** - -```text -admin.memoryProfile() -> {} -``` - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"admin.memoryProfile", - "params" :{} -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": {} -} -``` - -### `admin.setLoggerLevel` - -Sets log and display levels of loggers. - -**Signature:** - -```text -admin.setLoggerLevel( - { - loggerName: string, // optional - logLevel: string, // optional - displayLevel: string, // optional - } -) -> {} -``` - -- `loggerName` is the logger's name to be changed. This is an optional parameter. If not specified, - it changes all possible loggers. -- `logLevel` is the log level of written logs, can be omitted. -- `displayLevel` is the log level of displayed logs, can be omitted. - -`logLevel` and `displayLevel` cannot be omitted at the same time. - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"admin.setLoggerLevel", - "params": { - "loggerName": "C", - "logLevel": "DEBUG", - "displayLevel": "INFO" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": {} -} -``` - -### `admin.startCPUProfiler` - -Start profiling the CPU utilization of the node. To stop, call `admin.stopCPUProfiler`. On stop, -writes the profile to `cpu.profile`. - -**Signature:** - -```text -admin.startCPUProfiler() -> {} -``` - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"admin.startCPUProfiler", - "params" :{} -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": {} -} -``` - -### `admin.stopCPUProfiler` - -Stop the CPU profile that was previously started. - -**Signature:** - -```text -admin.stopCPUProfiler() -> {} -``` - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"admin.stopCPUProfiler" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": {} -} -``` From d01d711e48c27935598fd90ae70b764608cee01c Mon Sep 17 00:00:00 2001 From: meaghan Date: Tue, 12 Mar 2024 23:25:18 +0100 Subject: [PATCH 06/18] health and info --- .gitignore | 2 + configs/remoteContent.js | 60 +- docs/reference/avalanchego/health-api.md | 214 ------- docs/reference/avalanchego/info-api.md | 689 ----------------------- 4 files changed, 61 insertions(+), 904 deletions(-) delete mode 100644 docs/reference/avalanchego/health-api.md delete mode 100644 docs/reference/avalanchego/info-api.md diff --git a/.gitignore b/.gitignore index e087d6e9fef..90977cfbd8c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ docs/learn/acp.md docs/reference/avalanchego/p-chain/api.md docs/reference/avalanchego/x-chain/api.md docs/reference/avalanchego/admin-api.md +docs/reference/avalanchego/health-api.md +docs/reference/avalanchego/info-api.md # Misc .DS_Store diff --git a/configs/remoteContent.js b/configs/remoteContent.js index f0085560677..95eddb3ccf0 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -481,7 +481,7 @@ ${updatedContent}`, if (filename.includes("service")) { const updatedContent = replaceRelativeLinks( content, - "https://github.com/ava-labs/avalanchego/blob/master/vms/avm/" + "https://github.com/ava-labs/avalanchego/blob/master/api/admin/" ); const newContent = insertSourceDocLink( updatedContent, @@ -496,6 +496,64 @@ ${updatedContent}`, }, }, ], + [ + "docusaurus-plugin-remote-content", + { + // /docs/reference/health-api.md + name: "health-api", + sourceBaseUrl: + "https://raw.githubusercontent.com/ava-labs/avalanchego/meag/docs-format/api/health/", + documents: ["service.md"], + outDir: "docs/reference/avalanchego/", + // change filename and correct links + modifyContent(filename, content) { + if (filename.includes("service")) { + const updatedContent = replaceRelativeLinks( + content, + "https://github.com/ava-labs/avalanchego/blob/master/api/health" + ); + const newContent = insertSourceDocLink( + updatedContent, + "https://github.com/ava-labs/avalanchego/tree/master/api/health/service.md" + ); + return { + filename: "health-api.md", + content: `${newContent}`, + }; + } + return undefined; + }, + }, + ], + [ + "docusaurus-plugin-remote-content", + { + // /docs/reference/info-api.md + name: "info-api", + sourceBaseUrl: + "https://raw.githubusercontent.com/ava-labs/avalanchego/meag/docs-format/api/info/", + documents: ["service.md"], + outDir: "docs/reference/avalanchego/", + // change filename and correct links + modifyContent(filename, content) { + if (filename.includes("service")) { + const updatedContent = replaceRelativeLinks( + content, + "https://github.com/ava-labs/avalanchego/blob/master/api/info" + ); + const newContent = insertSourceDocLink( + updatedContent, + "https://github.com/ava-labs/avalanchego/tree/master/api/info/service.md" + ); + return { + filename: "info-api.md", + content: `${newContent}`, + }; + } + return undefined; + }, + }, + ], ]; module.exports = remoteContent; diff --git a/docs/reference/avalanchego/health-api.md b/docs/reference/avalanchego/health-api.md deleted file mode 100644 index bd14b042428..00000000000 --- a/docs/reference/avalanchego/health-api.md +++ /dev/null @@ -1,214 +0,0 @@ ---- -tags: [AvalancheGo APIs] -description: This page is an overview of the Health API associated with AvalancheGo. This API can be used for measuring node health. -sidebar_label: Health API -pagination_label: Health API ---- - -# Health API - -This API can be used for measuring node health. - -:::info - -This API set is for a specific node, it is unavailable on the [public server](/tooling/rpc-providers.md). - -::: - -## Filterable Health Checks - -The health checks that are run by the node are filterable. You can specify which health checks -you want to see by using `tags` filters. Returned results will only include health checks that -match the specified tags and global -health checks like `network`, `database` etc. -When filtered, the returned results will not show the full node health, -but only a subset of filtered health checks. -This means the node can be still unhealthy in unfiltered checks, even if the returned results show that -the node is healthy. -AvalancheGo supports filtering tags by subnetIDs. For more information check Filtering sections below. - -## GET Request - -To get an HTTP status code response that indicates the node’s health, make a `GET` request to -`/ext/health`. If the node is healthy, it will return a `200` status code. If you want more in-depth -information about a node’s health, use the JSON RPC methods. - -### Filtering - -To filter GET health checks, add a `tag` query parameter to the request. The `tag` parameter is a -string. -To filter health results by subnetID, use the -`subnetID` tag. For example, -to filter health results by subnetID `29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL`, -use the following query: - -```sh -curl --location --request GET 'http://localhost:9650/ext/health?tag=29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"health.health", -}' -``` - -In this example returned results will contain global health checks and health checks that are -related to subnetID `29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL`. - -**Note:** This filtering can show healthy results even if the node is unhealthy in other Chains/Subnets. - -In order to filter results by multiple tags, use multiple `tag` query parameters. For example, to -filter health results by subnetID `29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL` and -`28nrH5T2BMvNrWecFcV3mfccjs6axM1TVyqe79MCv2Mhs8kxiY` use the following query: - -```sh -curl --location --request GET 'http://localhost:9650/ext/health?tag=29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL&tag=28nrH5T2BMvNrWecFcV3mfccjs6axM1TVyqe79MCv2Mhs8kxiY' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"health.health", -}' -``` - -Returned results will contain checks for both subnetIDs and global health checks. - -## JSON RPC Request - -### Format - -This API uses the `json 2.0` RPC format. For more information on making JSON RPC calls, see -[here](/reference/standards/guides/issuing-api-calls.md). - -### Endpoint - -```text -/ext/health -``` - -### Methods - -#### `health.health` - -The node runs a set of health checks every 30 seconds, including a health check for each chain. This -method returns the last set of health check results. - -**Signature:** - -```sh -health.health() -> { - checks: []{ - checkName: { - message: JSON, - error: JSON, - timestamp: string, - duration: int, - contiguousFailures: int, - timeOfFirstFailure: int - } - }, - healthy: bool -} -``` - -`healthy` is true if the node if all health checks are passing. - -`checks` is a list of health check responses. - -- A check response may include a `message` with additional context. -- A check response may include an `error` describing why the check failed. -- `timestamp` is the timestamp of the last health check. -- `duration` is the execution duration of the last health check, in nanoseconds. -- `contiguousFailures` is the number of times in a row this check failed. -- `timeOfFirstFailure` is the time this check first failed. - -More information on these measurements can be found in the documentation for the -[go-sundheit](https://github.com/AppsFlyer/go-sundheit) library. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"health.health" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/health -``` - -**Example Response:** - -In this example response, the C-Chain’s health check is failing. - -```json -{ - "jsonrpc": "2.0", - "result": { - "checks": { - "C": { - "message": null, - "error": { - "message": "example error message" - }, - "timestamp": "2020-10-14T14:04:20.57759662Z", - "duration": 465253, - "contiguousFailures": 50, - "timeOfFirstFailure": "2020-10-14T13:16:10.576435413Z" - }, - "P": { - "message": { - "percentConnected": 0.9967694992864075 - }, - "timestamp": "2020-10-14T14:04:08.668743851Z", - "duration": 433363830, - "contiguousFailures": 0, - "timeOfFirstFailure": null - }, - "X": { - "timestamp": "2020-10-14T14:04:20.3962705Z", - "duration": 1853, - "contiguousFailures": 0, - "timeOfFirstFailure": null - }, - "chains.default.bootstrapped": { - "timestamp": "2020-10-14T14:04:04.238623814Z", - "duration": 8075, - "contiguousFailures": 0, - "timeOfFirstFailure": null - }, - "network.validators.heartbeat": { - "message": { - "heartbeat": 1602684245 - }, - "timestamp": "2020-10-14T14:04:05.610007874Z", - "duration": 6124, - "contiguousFailures": 0, - "timeOfFirstFailure": null - } - }, - "healthy": false - }, - "id": 1 -} -``` - -### Filtering - -JSON RPC methods in Health API supports filtering by tags. In order to filter results use `tags` -params in the -request body. `tags` accepts a list of tags. Currently only `subnetID`s are supported as tags. -For example, to filter health results by subnetID `29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL` -use the following request: - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"health.health", - "params":{ - "tags": ["29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL"] - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/health -``` - -Returned results will contain checks for subnetID `29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL` -and global health checks. diff --git a/docs/reference/avalanchego/info-api.md b/docs/reference/avalanchego/info-api.md deleted file mode 100644 index eac23afc59d..00000000000 --- a/docs/reference/avalanchego/info-api.md +++ /dev/null @@ -1,689 +0,0 @@ ---- -tags: [AvalancheGo APIs] -description: This page is an overview of the Info API associated with AvalancheGo. -sidebar_label: Info API -pagination_label: Info API ---- - -# Info API - -This API can be used to access basic information about the node. - -## Format - -This API uses the `json 2.0` RPC format. For more information on making JSON RPC calls, see -[here](/reference/standards/guides/issuing-api-calls.md). - -## Endpoint - -```text -/ext/info -``` - -## Methods - -### `info.acps` - -Returns peer preferences for Avalanche Community Proposals (ACPs) - -**Signature:** - -```go -info.acps() -> { - acps: map[uint32]{ - supportWeight: uint64 - supporters: set[string] - objectWeight: uint64 - objectors: set[string] - abstainWeight: uint64 - } -} -``` - -**Example Call:** - -```sh -curl -sX POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.acps", - "params" :{} -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "acps": { - "23": { - "supportWeight": "0", - "supporters": [], - "objectWeight": "0", - "objectors": [], - "abstainWeight": "161147778098286584" - }, - "24": { - "supportWeight": "0", - "supporters": [], - "objectWeight": "0", - "objectors": [], - "abstainWeight": "161147778098286584" - }, - "25": { - "supportWeight": "0", - "supporters": [], - "objectWeight": "0", - "objectors": [], - "abstainWeight": "161147778098286584" - }, - "30": { - "supportWeight": "0", - "supporters": [], - "objectWeight": "0", - "objectors": [], - "abstainWeight": "161147778098286584" - }, - "31": { - "supportWeight": "0", - "supporters": [], - "objectWeight": "0", - "objectors": [], - "abstainWeight": "161147778098286584" - }, - "41": { - "supportWeight": "0", - "supporters": [], - "objectWeight": "0", - "objectors": [], - "abstainWeight": "161147778098286584" - }, - "62": { - "supportWeight": "0", - "supporters": [], - "objectWeight": "0", - "objectors": [], - "abstainWeight": "161147778098286584" - } - } - }, - "id": 1 -} -``` - -### `info.isBootstrapped` - -Check whether a given chain is done bootstrapping - -**Signature:** - -```sh -info.isBootstrapped({chain: string}) -> {isBootstrapped: bool} -``` - -`chain` is the ID or alias of a chain. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.isBootstrapped", - "params": { - "chain":"X" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "isBootstrapped": true - }, - "id": 1 -} -``` - -### `info.getBlockchainID` - -Given a blockchain’s alias, get its ID. (See [`admin.aliasChain`](/reference/avalanchego/admin-api.md#adminaliaschain).) - -**Signature:** - -```sh -info.getBlockchainID({alias:string}) -> {blockchainID:string} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.getBlockchainID", - "params": { - "alias":"X" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "blockchainID": "sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM" - } -} -``` - -### `info.getNetworkID` - -Get the ID of the network this node is participating in. - -**Signature:** - -```sh -info.getNetworkID() -> {networkID:int} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.getNetworkID" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "networkID": "2" - } -} -``` - -Network ID of 1 = Mainnet -Network ID of 5 = Fuji (testnet) - -### `info.getNetworkName` - -Get the name of the network this node is participating in. - -**Signature:** - -```sh -info.getNetworkName() -> {networkName:string} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.getNetworkName" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "networkName": "local" - } -} -``` - -### `info.getNodeID` - -Get the ID, the BLS key, and the proof of possession(BLS signature) of this node. - -:::info -This endpoint set is for a specific node, it is unavailable on the [public server](/tooling/rpc-providers.md). -::: - -**Signature:** - -```sh -info.getNodeID() -> { - nodeID: string, - nodePOP: { - publicKey: string, - proofOfPossession: string - } -} -``` - -- `nodeID` Node ID is the unique identifier of the node that you set to act as a validator on the -Primary Network. -- `nodePOP` is this node's BLS key and proof of possession. Nodes must register a BLS key to act as -a validator on the Primary Network. Your node's POP is logged on startup and is accessible over this endpoint. - - `publicKey` is the 48 byte hex representation of the BLS key. - - `proofOfPossession` is the 96 byte hex representation of the BLS signature. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.getNodeID" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "nodeID": "NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD", - "nodePOP": { - "publicKey": "0x8f95423f7142d00a48e1014a3de8d28907d420dc33b3052a6dee03a3f2941a393c2351e354704ca66a3fc29870282e15", - "proofOfPossession": "0x86a3ab4c45cfe31cae34c1d06f212434ac71b1be6cfe046c80c162e057614a94a5bc9f1ded1a7029deb0ba4ca7c9b71411e293438691be79c2dbf19d1ca7c3eadb9c756246fc5de5b7b89511c7d7302ae051d9e03d7991138299b5ed6a570a98" - } - }, - "id": 1 -} -``` - -### `info.getNodeIP` - -Get the IP of this node. - -:::info -This endpoint set is for a specific node, it is unavailable on the [public server](/tooling/rpc-providers.md). -::: - -**Signature:** - -```text -info.getNodeIP() -> {ip: string} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.getNodeIP" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "ip": "192.168.1.1:9651" - }, - "id": 1 -} -``` - -### `info.getNodeVersion` - -Get the version of this node. - -**Signature:** - -```sh -info.getNodeVersion() -> { - version: string, - databaseVersion: string, - gitCommit: string, - vmVersions: map[string]string, - rpcProtocolVersion: string, -} -``` - -where: - -- `version` is this node's version -- `databaseVersion` is the version of the database this node is using -- `gitCommit` is the Git commit that this node was built from -- `vmVersions` is map where each key/value pair is the name of a VM, and the version of that VM this - node runs -- `rpcProtocolVersion` is the RPCChainVM protocol version - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.getNodeVersion" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "version": "avalanche/1.9.1", - "databaseVersion": "v1.4.5", - "rpcProtocolVersion": "18", - "gitCommit": "79cd09ba728e1cecef40acd60702f0a2d41ea404", - "vmVersions": { - "avm": "v1.9.1", - "evm": "v0.11.1", - "platform": "v1.9.1" - } - }, - "id": 1 -} -``` - -### `info.getTxFee` - -Get the fees of the network. - -**Signature:** - -```sh -info.getTxFee() -> -{ - txFee: uint64, - createAssetTxFee: uint64, - createSubnetTxFee: uint64, - transformSubnetTxFee: uint64, - createBlockchainTxFee: uint64, - addPrimaryNetworkValidatorFee: uint64, - addPrimaryNetworkDelegatorFee: uint64, - addSubnetValidatorFee: uint64, - addSubnetDelegatorFee: uint64 -} -``` - -- `txFee` is the default fee for making transactions. -- `createAssetTxFee` is the fee for creating a new asset. -- `createSubnetTxFee` is the fee for creating a new Subnet. -- `transformSubnetTxFee` is the fee for converting a PoA Subnet into a PoS Subnet. -- `createBlockchainTxFee` is the fee for creating a new blockchain. -- `addPrimaryNetworkValidatorFee` is the fee for adding a new primary network validator. -- `addPrimaryNetworkDelegatorFee` is the fee for adding a new primary network delegator. -- `addSubnetValidatorFee` is the fee for adding a new Subnet validator. -- `addSubnetDelegatorFee` is the fee for adding a new Subnet delegator. - -All fees are denominated in nAVAX. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.getTxFee" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "txFee": "1000000", - "createAssetTxFee": "10000000", - "createSubnetTxFee": "1000000000", - "transformSubnetTxFee": "10000000000", - "createBlockchainTxFee": "1000000000", - "addPrimaryNetworkValidatorFee": "0", - "addPrimaryNetworkDelegatorFee": "0", - "addSubnetValidatorFee": "1000000", - "addSubnetDelegatorFee": "1000000" - } -} -``` - -### `info.getVMs` - -Get the virtual machines installed on this node. - -:::info -This endpoint set is for a specific node, it is unavailable on the [public server](/tooling/rpc-providers.md). -::: - -**Signature:** - -```sh -info.getVMs() -> { - vms: map[string][]string -} -``` - -**Example Call:** - -```bash -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.getVMs", - "params" :{} -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "vms": { - "jvYyfQTxGMJLuGWa55kdP2p2zSUYsQ5Raupu4TW34ZAUBAbtq": ["avm"], - "mgj786NP7uDwBCcq6YwThhaN8FLyybkCa4zBWTQbNgmK6k9A6": ["evm"], - "qd2U4HDWUvMrVUeTcCHp6xH3Qpnn1XbU5MDdnBoiifFqvgXwT": ["nftfx"], - "rWhpuQPF1kb72esV2momhMuTYGkEb1oL29pt2EBXWmSy4kxnT": ["platform"], - "rXJsCSEYXg2TehWxCEEGj6JU2PWKTkd6cBdNLjoe2SpsKD9cy": ["propertyfx"], - "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ": ["secp256k1fx"] - } - }, - "id": 1 -} -``` - -### `info.peers` - -Get a description of peer connections. - -**Signature:** - -```sh -info.peers({ - nodeIDs: string[] // optional -}) -> -{ - numPeers: int, - peers:[]{ - ip: string, - publicIP: string, - nodeID: string, - version: string, - lastSent: string, - lastReceived: string, - benched: string[], - observedUptime: int, - observedSubnetUptime: map[string]int, - } -} -``` - -- `nodeIDs` is an optional parameter to specify what NodeID's descriptions should be returned. If - this parameter is left empty, descriptions for all active connections will be returned. If the - node is not connected to a specified NodeID, it will be omitted from the response. -- `ip` is the remote IP of the peer. -- `publicIP` is the public IP of the peer. -- `nodeID` is the prefixed Node ID of the peer. -- `version` shows which version the peer runs on. -- `lastSent` is the timestamp of last message sent to the peer. -- `lastReceived` is the timestamp of last message received from the peer. -- `benched` shows chain IDs that the peer is being benched. -- `observedUptime` is this node's primary network uptime, observed by the peer. -- `observedSubnetUptime` is a map of Subnet IDs to this node's Subnet uptimes, observed by the peer. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.peers", - "params": { - "nodeIDs": [] - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "numPeers": 3, - "peers": [ - { - "ip": "206.189.137.87:9651", - "publicIP": "206.189.137.87:9651", - "nodeID": "NodeID-8PYXX47kqLDe2wD4oPbvRRchcnSzMA4J4", - "version": "avalanche/1.9.4", - "lastSent": "2020-06-01T15:23:02Z", - "lastReceived": "2020-06-01T15:22:57Z", - "benched": [], - "observedUptime": "99", - "observedSubnetUptimes": {}, - "trackedSubnets": [], - "benched": [] - }, - { - "ip": "158.255.67.151:9651", - "publicIP": "158.255.67.151:9651", - "nodeID": "NodeID-C14fr1n8EYNKyDfYixJ3rxSAVqTY3a8BP", - "version": "avalanche/1.9.4", - "lastSent": "2020-06-01T15:23:02Z", - "lastReceived": "2020-06-01T15:22:34Z", - "benched": [], - "observedUptime": "75", - "observedSubnetUptimes": { - "29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL": "100" - }, - "trackedSubnets": [ - "29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL" - ], - "benched": [] - }, - { - "ip": "83.42.13.44:9651", - "publicIP": "83.42.13.44:9651", - "nodeID": "NodeID-LPbcSMGJ4yocxYxvS2kBJ6umWeeFbctYZ", - "version": "avalanche/1.9.3", - "lastSent": "2020-06-01T15:23:02Z", - "lastReceived": "2020-06-01T15:22:55Z", - "benched": [], - "observedUptime": "95", - "observedSubnetUptimes": {}, - "trackedSubnets": [], - "benched": [] - } - ] - } -} -``` - -### `info.uptime` - -Returns the network's observed uptime of this node. -This is the only reliable source of data for your node's uptime. -Other sources may be using data gathered with incomplete (limited) information. - -**Signature:** - -```sh -info.uptime({ - subnetID: string // optional -}) -> -{ - rewardingStakePercentage: float64, - weightedAveragePercentage: float64 -} -``` - -- `subnetID` is the Subnet to get the uptime of. If not provided, returns the uptime of the node on - the primary network. - -- `rewardingStakePercentage` is the percent of stake which thinks this node is above the uptime - requirement. -- `weightedAveragePercentage` is the stake-weighted average of all observed uptimes for this node. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.uptime" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "rewardingStakePercentage": "100.0000", - "weightedAveragePercentage": "99.0000" - } -} -``` - -#### **Example Subnet Call** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"info.uptime", - "params" :{ - "subnetID":"29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info -``` - -#### **Example Subnet Response** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "rewardingStakePercentage": "74.0741", - "weightedAveragePercentage": "72.4074" - } -} -``` From b7718aca5d36fe490946b6f945ff6598d9f94128 Mon Sep 17 00:00:00 2001 From: meaghan Date: Tue, 12 Mar 2024 23:31:58 +0100 Subject: [PATCH 07/18] metrics, keystore --- .gitignore | 2 + configs/remoteContent.js | 58 +++++ docs/reference/avalanchego/keystore-api.md | 290 --------------------- docs/reference/avalanchego/metrics-api.md | 40 --- 4 files changed, 60 insertions(+), 330 deletions(-) delete mode 100644 docs/reference/avalanchego/keystore-api.md delete mode 100644 docs/reference/avalanchego/metrics-api.md diff --git a/.gitignore b/.gitignore index 90977cfbd8c..c6185cf994d 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,8 @@ docs/reference/avalanchego/x-chain/api.md docs/reference/avalanchego/admin-api.md docs/reference/avalanchego/health-api.md docs/reference/avalanchego/info-api.md +docs/reference/avalanchego/metrics-api.md +docs/reference/avalanchego/keystore-api.md # Misc .DS_Store diff --git a/configs/remoteContent.js b/configs/remoteContent.js index 95eddb3ccf0..d9b7c810559 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -554,6 +554,64 @@ ${updatedContent}`, }, }, ], + [ + "docusaurus-plugin-remote-content", + { + // /docs/reference/metrics-api.md + name: "metrics-api", + sourceBaseUrl: + "https://raw.githubusercontent.com/ava-labs/avalanchego/meag/docs-format/api/metrics/", + documents: ["service.md"], + outDir: "docs/reference/avalanchego/", + // change filename and correct links + modifyContent(filename, content) { + if (filename.includes("service")) { + const updatedContent = replaceRelativeLinks( + content, + "https://github.com/ava-labs/avalanchego/blob/master/api/metrics" + ); + const newContent = insertSourceDocLink( + updatedContent, + "https://github.com/ava-labs/avalanchego/tree/master/api/metrics/service.md" + ); + return { + filename: "metrics-api.md", + content: `${newContent}`, + }; + } + return undefined; + }, + }, + ], + [ + "docusaurus-plugin-remote-content", + { + // /docs/reference/keystore-api.md + name: "keystore-api", + sourceBaseUrl: + "https://raw.githubusercontent.com/ava-labs/avalanchego/meag/docs-format/api/keystore/", + documents: ["service.md"], + outDir: "docs/reference/avalanchego/", + // change filename and correct links + modifyContent(filename, content) { + if (filename.includes("service")) { + const updatedContent = replaceRelativeLinks( + content, + "https://github.com/ava-labs/avalanchego/blob/master/api/keystore" + ); + const newContent = insertSourceDocLink( + updatedContent, + "https://github.com/ava-labs/avalanchego/tree/master/api/keystore/service.md" + ); + return { + filename: "keystore-api.md", + content: `${newContent}`, + }; + } + return undefined; + }, + }, + ], ]; module.exports = remoteContent; diff --git a/docs/reference/avalanchego/keystore-api.md b/docs/reference/avalanchego/keystore-api.md deleted file mode 100644 index e6a83473f6e..00000000000 --- a/docs/reference/avalanchego/keystore-api.md +++ /dev/null @@ -1,290 +0,0 @@ ---- -tags: [AvalancheGo APIs] -description: This page is an overview of the Keystore API associated with AvalancheGo. -sidebar_label: Keystore API -pagination_label: Keystore API ---- - -# Keystore API - -:::warning -Because the node operator has access to your plain-text password, you should only create a -keystore user on a node that you operate. If that node is breached, you could lose all your tokens. -Keystore APIs are not recommended for use on Mainnet. -::: - -Every node has a built-in keystore. Clients create users on the keystore, which act as identities to -be used when interacting with blockchains. A keystore exists at the node level, so if you create a -user on a node it exists _only_ on that node. However, users may be imported and exported using this -API. - -For validation and cross-chain transfer on the Mainnet, you should issue transactions through -[AvalancheJS](/tooling/avalanchejs-overview). That way control keys for your funds won't be stored on -the node, which significantly lowers the risk should a computer running a node be compromised. See -following docs for details: - -- Transfer AVAX Tokens Between Chains: - - C-Chain: [export](https://github.com/ava-labs/avalanchejs/blob/master/examples/c-chain/export.ts) and - [import](https://github.com/ava-labs/avalanchejs/blob/master/examples/c-chain/import.ts) - - P-Chain: [export](https://github.com/ava-labs/avalanchejs/blob/master/examples/p-chain/export.ts) and - [import](https://github.com/ava-labs/avalanchejs/blob/master/examples/p-chain/import.ts) - - X-Chain: [export](https://github.com/ava-labs/avalanchejs/blob/master/examples/x-chain/export.ts) and - [import](https://github.com/ava-labs/avalanchejs/blob/master/examples/x-chain/import.ts) - - -- [Add a Node to the Validator Set](/nodes/validate/add-a-validator) - -:::info - -This API set is for a specific node, it is unavailable on the [public server](/tooling/rpc-providers.md). - -::: - -## Format - -This API uses the `json 2.0` API format. For more information on making JSON RPC calls, see -[here](/reference/standards/guides/issuing-api-calls.md). - -## Endpoint - -```text -/ext/keystore -``` - -## Methods - -### keystore.createUser - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Create a new user with the specified username and password. - -**Signature:** - -```sh -keystore.createUser( - { - username:string, - password:string - } -) -> {} -``` - -- `username` and `password` can be at most 1024 characters. -- Your request will be rejected if `password` is too weak. `password` should be at least 8 - characters and contain upper and lower case letters as well as numbers and symbols. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"keystore.createUser", - "params" :{ - "username":"myUsername", - "password":"myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/keystore -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": {} -} -``` - -### keystore.deleteUser - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Delete a user. - -**Signature:** - -```sh -keystore.deleteUser({username: string, password:string}) -> {} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"keystore.deleteUser", - "params" : { - "username":"myUsername", - "password":"myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/keystore -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": {} -} -``` - -### keystore.exportUser - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Export a user. The user can be imported to another node with -[`keystore.importUser`](/reference/avalanchego/keystore-api.md#keystoreimportuser). The user’s password -remains encrypted. - -**Signature:** - -```sh -keystore.exportUser( - { - username:string, - password:string, - encoding:string //optional - } -) -> { - user:string, - encoding:string -} -``` - -`encoding` specifies the format of the string encoding user data. Can only be `hex` when a value is -provided. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"keystore.exportUser", - "params" :{ - "username":"myUsername", - "password":"myPassword" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/keystore -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "user": "7655a29df6fc2747b0874e1148b423b954a25fcdb1f170d0ec8eb196430f7001942ce55b02a83b1faf50a674b1e55bfc00000000", - "encoding": "hex" - } -} -``` - -### keystore.importUser - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -Import a user. `password` must match the user’s password. `username` doesn’t have to match the -username `user` had when it was exported. - -**Signature:** - -```sh -keystore.importUser( - { - username:string, - password:string, - user:string, - encoding:string //optional - } -) -> {} -``` - -`encoding` specifies the format of the string encoding user data. Can only be `hex` when a value is -provided. - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"keystore.importUser", - "params" :{ - "username":"myUsername", - "password":"myPassword", - "user" :"0x7655a29df6fc2747b0874e1148b423b954a25fcdb1f170d0ec8eb196430f7001942ce55b02a83b1faf50a674b1e55bfc000000008cf2d869" - } -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/keystore -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": {} -} -``` - -### keystore.listUsers - -:::caution - -Deprecated as of [**v1.9.12**](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.12). - -::: - -List the users in this keystore. - -**Signature:** - -```sh -keystore.ListUsers() -> {users:[]string} -``` - -**Example Call:** - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"keystore.listUsers" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/keystore -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "users": ["myUsername"] - } -} -``` diff --git a/docs/reference/avalanchego/metrics-api.md b/docs/reference/avalanchego/metrics-api.md deleted file mode 100644 index 08b211d33dd..00000000000 --- a/docs/reference/avalanchego/metrics-api.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -tags: [AvalancheGo APIs] -description: This page is an overview of the Metrics API associated with AvalancheGo. -sidebar_label: Metrics API -pagination_label: Metrics API ---- - -# Metrics API - -The API allows clients to get statistics about a node’s health and performance. - -:::info - -This API set is for a specific node, it is unavailable on the [public server](/tooling/rpc-providers.md). - -::: - -## Endpoint - -```text -/ext/metrics -``` - -## Usage - -To get the node metrics: - -```sh -curl -X POST 127.0.0.1:9650/ext/metrics -``` - -## Format - -This API produces Prometheus compatible metrics. See -[here](https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md) -for information on Prometheus’ formatting. - -[Here](/nodes/maintain/setting-up-node-monitoring) is a tutorial that -shows how to set up Prometheus and Grafana to monitor AvalancheGo node using the -Metrics API. From c20b9862e5e5027934bf6e9ec72fe38316b995e2 Mon Sep 17 00:00:00 2001 From: meaghan Date: Tue, 12 Mar 2024 23:44:12 +0100 Subject: [PATCH 08/18] index --- .gitignore | 1 + configs/remoteContent.js | 29 ++ docs/reference/avalanchego/index-api.md | 584 ------------------------ 3 files changed, 30 insertions(+), 584 deletions(-) delete mode 100644 docs/reference/avalanchego/index-api.md diff --git a/.gitignore b/.gitignore index c6185cf994d..b8eaf931159 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ docs/reference/avalanchego/health-api.md docs/reference/avalanchego/info-api.md docs/reference/avalanchego/metrics-api.md docs/reference/avalanchego/keystore-api.md +docs/reference/avalanchego/index-api.md # Misc .DS_Store diff --git a/configs/remoteContent.js b/configs/remoteContent.js index d9b7c810559..4e3fcfb106a 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -612,6 +612,35 @@ ${updatedContent}`, }, }, ], + [ + "docusaurus-plugin-remote-content", + { + // /docs/reference/index-api.md + name: "index-api", + sourceBaseUrl: + "https://raw.githubusercontent.com/ava-labs/avalanchego/meag/docs-format/indexer/", + documents: ["service.md"], + outDir: "docs/reference/avalanchego/", + // change filename and correct links + modifyContent(filename, content) { + if (filename.includes("service")) { + const updatedContent = replaceRelativeLinks( + content, + "https://github.com/ava-labs/avalanchego/blob/master/indexer" + ); + const newContent = insertSourceDocLink( + updatedContent, + "https://github.com/ava-labs/avalanchego/tree/master/indexer/service.md" + ); + return { + filename: "index-api.md", + content: `${newContent}`, + }; + } + return undefined; + }, + }, + ], ]; module.exports = remoteContent; diff --git a/docs/reference/avalanchego/index-api.md b/docs/reference/avalanchego/index-api.md deleted file mode 100644 index 188378c5751..00000000000 --- a/docs/reference/avalanchego/index-api.md +++ /dev/null @@ -1,584 +0,0 @@ ---- -tags: [AvalancheGo APIs] -description: This page is an overview of the Index API associated with AvalancheGo. -sidebar_label: Index API -pagination_label: Index API ---- - -# Index API - -AvalancheGo can be configured to run with an indexer. That is, it saves (indexes) every container (a -block, vertex or transaction) it accepts on the X-Chain, P-Chain and C-Chain. To run AvalancheGo -with indexing enabled, set command line flag -[--index-enabled](/nodes/configure/avalanchego-config-flags.md#apis) to true. **AvalancheGo -will only index containers that are accepted when running with `--index-enabled` set to true.** To -ensure your node has a complete index, run a node with a fresh database and `--index-enabled` set to -true. The node will accept every block, vertex and transaction in the network history during -bootstrapping, ensuring your index is complete. It is OK to turn off your node if it is running with -indexing enabled. If it restarts with indexing still enabled, it will accept all containers that -were accepted while it was offline. The indexer should never fail to index an accepted block, vertex -or transaction. - -Indexed containers (that is, accepted blocks, vertices and transactions) are timestamped with the -time at which the node accepted that container. Note that if the container was indexed during -bootstrapping, other nodes may have accepted the container much earlier. Every container indexed -during bootstrapping will be timestamped with the time at which the node bootstrapped, not when it -was first accepted by the network. - -If `--index-enabled` is changed to `false` from `true`, AvalancheGo won't start as doing so would -cause a previously complete index to become incomplete, unless the user explicitly says to do so -with `--index-allow-incomplete`. This protects you from accidentally running with indexing disabled, -after previously running with it enabled, which would result in an incomplete index. - -This document shows how to query data from AvalancheGo's Index API. The Index API is only available -when running with `--index-enabled`. - -## Go Client - -There is a Go implementation of an Index API client. See documentation -[here](https://pkg.go.dev/github.com/ava-labs/avalanchego/indexer#Client). This client can be used -inside a Go program to connect to an AvalancheGo node that is running with the Index API enabled and -make calls to the Index API. - -## Format - -This API uses the `json 2.0` RPC format. For more information on making JSON RPC calls, see -[here](/reference/standards/guides/issuing-api-calls.md). - -## Endpoints - -Each chain has one or more index. To see if a C-Chain block is accepted, for example, send an API -call to the C-Chain block index. To see if an X-Chain vertex is accepted, for example, send an API -call to the X-Chain vertex index. - -### C-Chain Blocks - -```text -/ext/index/C/block -``` - -### P-Chain Blocks - -```text -/ext/index/P/block -``` - -### X-Chain Transactions - -```text -/ext/index/X/tx -``` - -### X-Chain Blocks - -```text -/ext/index/X/block -``` - -:::caution - -To ensure historical data can be accessed, the `/ext/index/X/vtx` is still accessible, -even though it is no longer populated with chain data since the Cortina activation. -If you are using `V1.10.0` or higher, you need to migrate to using the `/ext/index/X/block` endpoint. - -::: - -## Methods - -### `index.getContainerByID` - -Get container by ID. - -**Signature:** - -```sh -index.getContainerByID({ - id: string, - encoding: string -}) -> { - id: string, - bytes: string, - timestamp: string, - encoding: string, - index: string -} -``` - -**Request:** - -- `id` is the container's ID -- `encoding` is `"hex"` only. - -**Response:** - -- `id` is the container's ID -- `bytes` is the byte representation of the container -- `timestamp` is the time at which this node accepted the container -- `encoding` is `"hex"` only. -- `index` is how many containers were accepted in this index before this one - -**Example Call:** - -```sh -curl --location --request POST 'localhost:9650/ext/index/X/tx' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "jsonrpc": "2.0", - "method": "index.getContainerByID", - "params": { - "id": "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY", - "encoding":"hex" - }, - "id": 1 -}' -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "id": "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY", - "bytes": "0x00000000000400003039d891ad56056d9c01f18f43f58b5c784ad07a4a49cf3d1f11623804b5cba2c6bf00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000070429ccc5c5eb3b80000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000050429d069189e0000000000010000000000000000c85fc1980a77c5da78fe5486233fc09a769bb812bcb2cc548cf9495d046b3f1b00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007000003a352a38240000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c0000000100000009000000011cdb75d4e0b0aeaba2ebc1ef208373fedc1ebbb498f8385ad6fb537211d1523a70d903b884da77d963d56f163191295589329b5710113234934d0fd59c01676b00b63d2108", - "timestamp": "2021-04-02T15:34:00.262979-07:00", - "encoding": "hex", - "index": "0" - } -} -``` - -### `index.getContainerByIndex` - -Get container by index. The first container accepted is at index 0, the second is at index 1, etc. - -**Signature:** - -```sh -index.getContainerByIndex({ - index: uint64, - encoding: string -}) -> { - id: string, - bytes: string, - timestamp: string, - encoding: string, - index: string -} -``` - -**Request:** - -- `index` is how many containers were accepted in this index before this one -- `encoding` is `"hex"` only. - -**Response:** - -- `id` is the container's ID -- `bytes` is the byte representation of the container -- `timestamp` is the time at which this node accepted the container -- `index` is how many containers were accepted in this index before this one -- `encoding` is `"hex"` only. - -**Example Call:** - -```sh -curl --location --request POST 'localhost:9650/ext/index/X/tx' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "jsonrpc": "2.0", - "method": "index.getContainerByIndex", - "params": { - "index":0, - "encoding": "hex" - }, - "id": 1 -}' -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "id": "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY", - "bytes": "0x00000000000400003039d891ad56056d9c01f18f43f58b5c784ad07a4a49cf3d1f11623804b5cba2c6bf00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000070429ccc5c5eb3b80000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000050429d069189e0000000000010000000000000000c85fc1980a77c5da78fe5486233fc09a769bb812bcb2cc548cf9495d046b3f1b00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007000003a352a38240000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c0000000100000009000000011cdb75d4e0b0aeaba2ebc1ef208373fedc1ebbb498f8385ad6fb537211d1523a70d903b884da77d963d56f163191295589329b5710113234934d0fd59c01676b00b63d2108", - "timestamp": "2021-04-02T15:34:00.262979-07:00", - "encoding": "hex", - "index": "0" - } -} -``` - -### `index.getContainerRange` - -Returns the transactions at index [`startIndex`], [`startIndex+1`], ... , [`startIndex+n-1`] - -- If [`n`] == 0, returns an empty response (for example: null). -- If [`startIndex`] > the last accepted index, returns an error (unless the above apply.) -- If [`n`] > [`MaxFetchedByRange`], returns an error. -- If we run out of transactions, returns the ones fetched before running out. -- `numToFetch` must be in `[0,1024]`. - -**Signature:** - -```sh -index.getContainerRange({ - startIndex: uint64, - numToFetch: uint64, - encoding: string -}) -> []{ - id: string, - bytes: string, - timestamp: string, - encoding: string, - index: string -} -``` - -**Request:** - -- `startIndex` is the beginning index -- `numToFetch` is the number of containers to fetch -- `encoding` is `"hex"` only. - -**Response:** - -- `id` is the container's ID -- `bytes` is the byte representation of the container -- `timestamp` is the time at which this node accepted the container -- `encoding` is `"hex"` only. -- `index` is how many containers were accepted in this index before this one - -**Example Call:** - -```sh -curl --location --request POST 'localhost:9650/ext/index/X/tx' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "jsonrpc": "2.0", - "method": "index.getContainerRange", - "params": { - "startIndex":0, - "numToFetch":100, - "encoding": "hex" - }, - "id": 1 -}' -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": [ - { - "id": "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY", - "bytes": "0x00000000000400003039d891ad56056d9c01f18f43f58b5c784ad07a4a49cf3d1f11623804b5cba2c6bf00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000070429ccc5c5eb3b80000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000050429d069189e0000000000010000000000000000c85fc1980a77c5da78fe5486233fc09a769bb812bcb2cc548cf9495d046b3f1b00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007000003a352a38240000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c0000000100000009000000011cdb75d4e0b0aeaba2ebc1ef208373fedc1ebbb498f8385ad6fb537211d1523a70d903b884da77d963d56f163191295589329b5710113234934d0fd59c01676b00b63d2108", - "timestamp": "2021-04-02T15:34:00.262979-07:00", - "encoding": "hex", - "index": "0" - } - ] -} -``` - -### `index.getIndex` - -Get a container's index. - -**Signature:** - -```sh -index.getIndex({ - id: string, - encoding: string -}) -> { - index: string -} -``` - -**Request:** - -- `id` is the ID of the container to fetch -- `encoding` is `"hex"` only. - -**Response:** - -- `index` is how many containers were accepted in this index before this one - -**Example Call:** - -```sh -curl --location --request POST 'localhost:9650/ext/index/X/tx' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "jsonrpc": "2.0", - "method": "index.getIndex", - "params": { - "id":"6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY", - "encoding": "hex" - }, - "id": 1 -}' -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "index": "0" - }, - "id": 1 -} -``` - -### `index.getLastAccepted` - -Get the most recently accepted container. - -**Signature:** - -```sh -index.getLastAccepted({ - encoding:string -}) -> { - id: string, - bytes: string, - timestamp: string, - encoding: string, - index: string -} -``` - -**Request:** - -- `encoding` is `"hex"` only. - -**Response:** - -- `id` is the container's ID -- `bytes` is the byte representation of the container -- `timestamp` is the time at which this node accepted the container -- `encoding` is `"hex"` only. - -**Example Call:** - -```sh -curl --location --request POST 'localhost:9650/ext/index/X/tx' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "jsonrpc": "2.0", - "method": "index.getLastAccepted", - "params": { - "encoding": "hex" - }, - "id": 1 -}' -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "id": "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY", - "bytes": "0x00000000000400003039d891ad56056d9c01f18f43f58b5c784ad07a4a49cf3d1f11623804b5cba2c6bf00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000070429ccc5c5eb3b80000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000050429d069189e0000000000010000000000000000c85fc1980a77c5da78fe5486233fc09a769bb812bcb2cc548cf9495d046b3f1b00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007000003a352a38240000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c0000000100000009000000011cdb75d4e0b0aeaba2ebc1ef208373fedc1ebbb498f8385ad6fb537211d1523a70d903b884da77d963d56f163191295589329b5710113234934d0fd59c01676b00b63d2108", - "timestamp": "2021-04-02T15:34:00.262979-07:00", - "encoding": "hex", - "index": "0" - } -} -``` - -### `index.isAccepted` - -Returns true if the container is in this index. - -**Signature:** - -```sh -index.isAccepted({ - id: string, - encoding: string -}) -> { - isAccepted: bool -} -``` - -**Request:** - -- `id` is the ID of the container to fetch -- `encoding` is `"hex"` only. - -**Response:** - -- `isAccepted` displays if the container has been accepted - -**Example Call:** - -```sh -curl --location --request POST 'localhost:9650/ext/index/X/tx' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "jsonrpc": "2.0", - "method": "index.isAccepted", - "params": { - "id":"6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY", - "encoding": "hex" - }, - "id": 1 -}' -``` - -**Example Response:** - -```json -{ - "jsonrpc": "2.0", - "result": { - "isAccepted": true - }, - "id": 1 -} -``` - -## Example: Iterating Through X-Chain Transaction - -Here is an example of how to iterate through all transactions on the X-Chain. - -:::warning -To help users to try out this example and other index APIs, we have set up a testing -indexer node located at [https://indexer-demo.avax.network](https://indexer-demo.avax.network). This -indexer node is not for production use. We may change or shut it down at any time without notice. -::: - -You can use the Index API to get the ID of every transaction that has been accepted on the X-Chain, -and use the X-Chain API method `avm.getTx` to get a human-readable representation of the -transaction. - -To get an X-Chain transaction by its index (the order it was accepted in), use Index API method -[index.getlastaccepted](#indexgetlastaccepted). - -For example, to get the _second_ transaction (note that `"index":1`) accepted on the X-Chain, do: - -```sh -curl --location --request POST 'https://indexer-demo.avax.network/ext/index/X/tx' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "jsonrpc": "2.0", - "method": "index.getContainerByIndex", - "params": { - "encoding":"hex", - "index":1 - }, - "id": 1 -}' -``` - -This returns the ID of the second transaction accepted in the X-Chain's history. To get the third -transaction on the X-Chain, use `"index":2`, and so on. - -The above API call gives the response below: - -```json -{ - "jsonrpc": "2.0", - "result": { - "id": "ZGYTSU8w3zUP6VFseGC798vA2Vnxnfj6fz1QPfA9N93bhjJvo", - "bytes": "0x00000000000000000001ed5f38341e436e5d46e2bb00b45d62ae97d1b050c64bc634ae10626739e35c4b0000000221e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000000129f6afc0000000000000000000000001000000017416792e228a765c65e2d76d28ab5a16d18c342f21e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff0000000700000222afa575c00000000000000000000000010000000187d6a6dd3cd7740c8b13a410bea39b01fa83bb3e000000016f375c785edb28d52edb59b54035c96c198e9d80f5f5f5eee070592fe9465b8d0000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff0000000500000223d9ab67c0000000010000000000000000000000010000000900000001beb83d3d29f1247efb4a3a1141ab5c966f46f946f9c943b9bc19f858bd416d10060c23d5d9c7db3a0da23446b97cd9cf9f8e61df98e1b1692d764c84a686f5f801a8da6e40", - "timestamp": "2021-11-04T00:42:55.01643414Z", - "encoding": "hex", - "index": "1" - }, - "id": 1 -} -``` - -The ID of this transaction is `ZGYTSU8w3zUP6VFseGC798vA2Vnxnfj6fz1QPfA9N93bhjJvo`. - -To get the transaction by its ID, use API method `avm.getTx`: - -```sh -curl -X POST --data '{ - "jsonrpc":"2.0", - "id" :1, - "method" :"avm.getTx", - "params" :{ - "txID":"ZGYTSU8w3zUP6VFseGC798vA2Vnxnfj6fz1QPfA9N93bhjJvo", - "encoding": "json" - } -}' -H 'content-type:application/json;' https://api.avax.network/ext/bc/X -``` - -Response: - -```json -{ - "jsonrpc": "2.0", - "result": { - "tx": { - "unsignedTx": { - "networkID": 1, - "blockchainID": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", - "outputs": [ - { - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "output": { - "addresses": ["X-avax1wst8jt3z3fm9ce0z6akj3266zmgccdp03hjlaj"], - "amount": 4999000000, - "locktime": 0, - "threshold": 1 - } - }, - { - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "output": { - "addresses": ["X-avax1slt2dhfu6a6qezcn5sgtagumq8ag8we75f84sw"], - "amount": 2347999000000, - "locktime": 0, - "threshold": 1 - } - } - ], - "inputs": [ - { - "txID": "qysTYUMCWdsR3MctzyfXiSvoSf6evbeFGRLLzA4j2BjNXTknh", - "outputIndex": 0, - "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "input": { - "amount": 2352999000000, - "signatureIndices": [0] - } - } - ], - "memo": "0x" - }, - "credentials": [ - { - "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", - "credential": { - "signatures": [ - "0xbeb83d3d29f1247efb4a3a1141ab5c966f46f946f9c943b9bc19f858bd416d10060c23d5d9c7db3a0da23446b97cd9cf9f8e61df98e1b1692d764c84a686f5f801" - ] - } - } - ] - }, - "encoding": "json" - }, - "id": 1 -} -``` From 571c160f160a7718faa26072e322e44a77aae224 Mon Sep 17 00:00:00 2001 From: meaghan Date: Wed, 13 Mar 2024 00:02:50 +0100 Subject: [PATCH 09/18] remove replace relative links function --- configs/remoteContent.js | 48 +++++++--------------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) diff --git a/configs/remoteContent.js b/configs/remoteContent.js index 4e3fcfb106a..38b1e3178ef 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -421,12 +421,8 @@ ${updatedContent}`, // change filename and correct links modifyContent(filename, content) { if (filename.includes("service")) { - const updatedContent = replaceRelativeLinks( - content, - "https://github.com/ava-labs/avalanchego/blob/master/vms/platformvm/" - ); const newContent = insertSourceDocLink( - updatedContent, + content, "https://github.com/ava-labs/avalanchego/tree/master/vms/platformvm/service.md" ); return { @@ -450,12 +446,8 @@ ${updatedContent}`, // change filename and correct links modifyContent(filename, content) { if (filename.includes("service")) { - const updatedContent = replaceRelativeLinks( - content, - "https://github.com/ava-labs/avalanchego/blob/master/vms/avm/" - ); const newContent = insertSourceDocLink( - updatedContent, + content, "https://github.com/ava-labs/avalanchego/tree/master/vms/avm/service.md" ); return { @@ -479,12 +471,8 @@ ${updatedContent}`, // change filename and correct links modifyContent(filename, content) { if (filename.includes("service")) { - const updatedContent = replaceRelativeLinks( - content, - "https://github.com/ava-labs/avalanchego/blob/master/api/admin/" - ); const newContent = insertSourceDocLink( - updatedContent, + content, "https://github.com/ava-labs/avalanchego/tree/master/api/admin/service.md" ); return { @@ -508,12 +496,8 @@ ${updatedContent}`, // change filename and correct links modifyContent(filename, content) { if (filename.includes("service")) { - const updatedContent = replaceRelativeLinks( - content, - "https://github.com/ava-labs/avalanchego/blob/master/api/health" - ); const newContent = insertSourceDocLink( - updatedContent, + content, "https://github.com/ava-labs/avalanchego/tree/master/api/health/service.md" ); return { @@ -537,12 +521,8 @@ ${updatedContent}`, // change filename and correct links modifyContent(filename, content) { if (filename.includes("service")) { - const updatedContent = replaceRelativeLinks( - content, - "https://github.com/ava-labs/avalanchego/blob/master/api/info" - ); const newContent = insertSourceDocLink( - updatedContent, + content, "https://github.com/ava-labs/avalanchego/tree/master/api/info/service.md" ); return { @@ -566,12 +546,8 @@ ${updatedContent}`, // change filename and correct links modifyContent(filename, content) { if (filename.includes("service")) { - const updatedContent = replaceRelativeLinks( - content, - "https://github.com/ava-labs/avalanchego/blob/master/api/metrics" - ); const newContent = insertSourceDocLink( - updatedContent, + content, "https://github.com/ava-labs/avalanchego/tree/master/api/metrics/service.md" ); return { @@ -595,12 +571,8 @@ ${updatedContent}`, // change filename and correct links modifyContent(filename, content) { if (filename.includes("service")) { - const updatedContent = replaceRelativeLinks( - content, - "https://github.com/ava-labs/avalanchego/blob/master/api/keystore" - ); const newContent = insertSourceDocLink( - updatedContent, + content, "https://github.com/ava-labs/avalanchego/tree/master/api/keystore/service.md" ); return { @@ -624,12 +596,8 @@ ${updatedContent}`, // change filename and correct links modifyContent(filename, content) { if (filename.includes("service")) { - const updatedContent = replaceRelativeLinks( - content, - "https://github.com/ava-labs/avalanchego/blob/master/indexer" - ); const newContent = insertSourceDocLink( - updatedContent, + content, "https://github.com/ava-labs/avalanchego/tree/master/indexer/service.md" ); return { From 8021f0292fa1d6d12c75b1784f022ffb1bf44068 Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 25 Mar 2024 11:56:30 -0400 Subject: [PATCH 10/18] avalanchego and subnet configs --- .gitignore | 2 + configs/remoteContent.js | 50 + .../configure/avalanchego-config-flags.md | 1418 ----------------- docs/nodes/configure/subnet-configs.md | 111 -- 4 files changed, 52 insertions(+), 1529 deletions(-) delete mode 100644 docs/nodes/configure/avalanchego-config-flags.md delete mode 100644 docs/nodes/configure/subnet-configs.md diff --git a/.gitignore b/.gitignore index b8eaf931159..2c44942f3d4 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,8 @@ docs/reference/avalanchego/info-api.md docs/reference/avalanchego/metrics-api.md docs/reference/avalanchego/keystore-api.md docs/reference/avalanchego/index-api.md +docs/nodes/configure/avalanchego-config-flags.md +docs/nodes/configure/subnet-configs.md # Misc .DS_Store diff --git a/configs/remoteContent.js b/configs/remoteContent.js index 38b1e3178ef..0106fb2391c 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -609,6 +609,56 @@ ${updatedContent}`, }, }, ], + [ + "docusaurus-plugin-remote-content", + { + // /docs/nodes/configure/avalanchego-config-flags.md + name: "avalanchego-config-flags", + sourceBaseUrl: + "https://raw.githubusercontent.com/ava-labs/avalanchego/meag/docs-format/config/", + documents: ["config.md"], + outDir: "docs/nodes/configure/", + // change filename and correct links + modifyContent(filename, content) { + if (filename.includes("service")) { + const newContent = insertSourceDocLink( + content, + "https://github.com/ava-labs/avalanchego/tree/master/config/config.md" + ); + return { + filename: "avalanchego-config-flags.md", + content: `${newContent}`, + }; + } + return undefined; + }, + }, + ], + [ + "docusaurus-plugin-remote-content", + { + // /docs/nodes/configure/subnet-configs.md + name: "subnet-configs", + sourceBaseUrl: + "https://raw.githubusercontent.com/ava-labs/avalanchego/meag/docs-format/subnets/", + documents: ["config.md"], + outDir: "docs/nodes/configure/", + // change filename and correct links + modifyContent(filename, content) { + if (filename.includes("service")) { + const newContent = insertSourceDocLink( + content, + "https://github.com/ava-labs/avalanchego/tree/master/subnets/config.md" + ); + return { + filename: "subnet-configs.md", + content: `${newContent}`, + }; + } + return undefined; + }, + }, + ], ]; module.exports = remoteContent; diff --git a/docs/nodes/configure/avalanchego-config-flags.md b/docs/nodes/configure/avalanchego-config-flags.md deleted file mode 100644 index 35d317ccaba..00000000000 --- a/docs/nodes/configure/avalanchego-config-flags.md +++ /dev/null @@ -1,1418 +0,0 @@ ---- -tags: [Nodes] -description: This documents list all available configuration and flags for AvalancheGo. -sidebar_label: AvalancheGo Configs + Flags -pagination_label: AvalancheGo Configs and Flags -sidebar_position: 0 ---- - -# AvalancheGo Configs and Flags - - - -You can specify the configuration of a node with the arguments below. - -## Data Directory - -#### `--data-dir` (string) - -Sets the base data directory where default sub-directories will be placed unless otherwise specified. -Defaults to `$HOME/.avalanchego`. - -## Config File - -#### `--config-file` (string) - -Path to a JSON file that specifies this node's configuration. Command line -arguments will override arguments set in the config file. This flag is ignored -if `--config-file-content` is specified. - -Example JSON config file: - -```json -{ - "log-level": "debug" -} -``` - -:::tip -[Install Script](/nodes/run/with-installer/installing-avalanchego.md) creates the -node config file at `~/.avalanchego/configs/node.json`. No default file is -created if [AvalancheGo is built from source](/nodes/run/node-manually.md), you -would need to create it manually if needed. -::: - -#### `--config-file-content` (string) - -As an alternative to `--config-file`, it allows specifying base64 encoded config -content. - -#### `--config-file-content-type` (string) - -Specifies the format of the base64 encoded config content. JSON, TOML, YAML are -among currently supported file format (see -[here](https://github.com/spf13/viper#reading-config-files) for full list). Defaults to `JSON`. - -## Avalanche Community Proposals - -#### `--acp-support` (array of integers) - -The `--acp-support` flag allows an AvalancheGo node to indicate support for a -set of [Avalanche Community Proposals](https://github.com/avalanche-foundation/ACPs). - -#### `--acp-object` (array of integers) - -The `--acp-object` flag allows an AvalancheGo node to indicate objection for a -set of [Avalanche Community Proposals](https://github.com/avalanche-foundation/ACPs). - -## APIs - -#### `--api-admin-enabled` (boolean) - -If set to `true`, this node will expose the Admin API. Defaults to `false`. -See [here](/reference/avalanchego/admin-api.md) for more information. - -#### `--api-health-enabled` (boolean) - -If set to `false`, this node will not expose the Health API. Defaults to `true`. See -[here](/reference/avalanchego/health-api.md) for more information. - -#### `--index-enabled` (boolean) - -If set to `true`, this node will enable the indexer and the Index API will be -available. Defaults to `false`. See -[here](/reference/avalanchego/index-api.md) for more information. - -#### `--api-info-enabled` (boolean) - -If set to `false`, this node will not expose the Info API. Defaults to `true`. See -[here](/reference/avalanchego/info-api.md) for more information. - -#### `--api-keystore-enabled` (boolean) - -If set to `true`, this node will expose the Keystore API. Defaults to `false`. -See [here](/reference/avalanchego/keystore-api.md) for more information. - -#### `--api-metrics-enabled` (boolean) - -If set to `false`, this node will not expose the Metrics API. Defaults to -`true`. See [here](/reference/avalanchego/metrics-api.md) for more information. - -#### `--http-shutdown-wait` (duration) - -Duration to wait after receiving SIGTERM or SIGINT before initiating shutdown. -The `/health` endpoint will return unhealthy during this duration (if the Health -API is enabled.) Defaults to `0s`. - -#### `--http-shutdown-timeout` (duration) - -Maximum duration to wait for existing connections to complete during node -shutdown. Defaults to `10s`. - -## Bootstrapping - -#### `--bootstrap-beacon-connection-timeout` (duration) - -Timeout when attempting to connect to bootstrapping beacons. Defaults to `1m`. - -#### `--bootstrap-ids` (string) - -Bootstrap IDs is a comma-separated list of validator IDs. These IDs will be used -to authenticate bootstrapping peers. An example setting of this field would be -`--bootstrap-ids="NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg,NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ"`. -The number of given IDs here must be same with number of given -`--bootstrap-ips`. The default value depends on the network ID. - -#### `--bootstrap-ips` (string) - -Bootstrap IPs is a comma-separated list of IP:port pairs. These IP Addresses -will be used to bootstrap the current Avalanche state. An example setting of -this field would be `--bootstrap-ips="127.0.0.1:12345,1.2.3.4:5678"`. The number -of given IPs here must be same with number of given `--bootstrap-ids`. The -default value depends on the network ID. - -#### `--bootstrap-retry-enabled` (boolean) - -If set to `false`, will not retry bootstrapping if it fails. Defaults to `true`. - -#### `--bootstrap-retry-warn-frequency` (uint) - -Specifies how many times bootstrap should be retried before warning the operator. Defaults to `50`. - -#### `--bootstrap-ancestors-max-containers-sent` (uint) - -Max number of containers in an `Ancestors` message sent by this node. Defaults to `2000`. - -#### `--bootstrap-ancestors-max-containers-received` (unit) - -This node reads at most this many containers from an incoming `Ancestors` message. Defaults to `2000`. - -#### `--bootstrap-max-time-get-ancestors` (duration) - -Max Time to spend fetching a container and its ancestors when responding to a GetAncestors message. -Defaults to `50ms`. - -## State Syncing - -#### `--state-sync-ids` (string) - -State sync IDs is a comma-separated list of validator IDs. The specified -validators will be contacted to get and authenticate the starting point (state -summary) for state sync. An example setting of this field would be -`--state-sync-ids="NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg,NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ"`. -The number of given IDs here must be same with number of given -`--state-sync-ips`. The default value is empty, which results in all validators -being sampled. - -#### `--state-sync-ips` (string) - -State sync IPs is a comma-separated list of IP:port pairs. These IP Addresses -will be contacted to get and authenticate the starting point (state summary) for -state sync. An example setting of this field would be -`--state-sync-ips="127.0.0.1:12345,1.2.3.4:5678"`. The number of given IPs here -must be the same with the number of given `--state-sync-ids`. - -## Partial Sync Primary Network - -#### `--partial-sync-primary-network` (string) - -Partial sync enables non-validators to optionally sync only the P-chain on the primary network. - -## Chain Configs - -Some blockchains allow the node operator to provide custom configurations for -individual blockchains. These custom configurations are broken down into two -categories: network upgrades and optional chain configurations. AvalancheGo -reads in these configurations from the chain configuration directory and passes -them into the VM on initialization. - -#### `--chain-config-dir` (string) - -Specifies the directory that contains chain configs, as described -[here](chain-config-flags.md). Defaults to `$HOME/.avalanchego/configs/chains`. -If this flag is not provided and the default directory does not exist, -AvalancheGo will not exit since custom configs are optional. However, if the -flag is set, the specified folder must exist, or AvalancheGo will exit with an -error. This flag is ignored if `--chain-config-content` is specified. - -:::note -Please replace `chain-config-dir` and `blockchainID` with their actual values. -::: - -Network upgrades are passed in from the location: -`chain-config-dir`/`blockchainID`/`upgrade.*`. -Upgrade files are typically json encoded and therefore named `upgrade.json`. -However, the format of the file is VM dependent. -After a blockchain has activated a network upgrade, the same upgrade -configuration must always be passed in to ensure that the network upgrades -activate at the correct time. - -The chain configs are passed in from the location -`chain-config-dir`/`blockchainID`/`config.*`. -Upgrade files are typically json encoded and therefore named `upgrade.json`. -However, the format of the file is VM dependent. -This configuration is used by the VM to handle optional configuration flags such -as enabling/disabling APIs, updating log level, etc. -The chain configuration is intended to provide optional configuration parameters -and the VM will use default values if nothing is passed in. - -Full reference for all configuration options for some standard chains can be -found in a separate [chain config flags](chain-config-flags.md) document. - -Full reference for `subnet-evm` upgrade configuration can be found in a separate -[Customize a Subnet](/build/subnet/upgrade/customize-a-subnet.md) document. - -#### `--chain-config-content` (string) - -As an alternative to `--chain-config-dir`, chains custom configurations can be -loaded altogether from command line via `--chain-config-content` flag. Content -must be base64 encoded. - -Example: - -```bash -cchainconfig="$(echo -n '{"log-level":"trace"}' | base64)" -chainconfig="$(echo -n "{\"C\":{\"Config\":\"${cchainconfig}\",\"Upgrade\":null}}" | base64)" -avalanchego --chain-config-content "${chainconfig}" -``` - -#### `--chain-aliases-file` (string) - -Path to JSON file that defines aliases for Blockchain IDs. Defaults to -`~/.avalanchego/configs/chains/aliases.json`. This flag is ignored if -`--chain-aliases-file-content` is specified. Example content: - -```json -{ - "q2aTwKuyzgs8pynF7UXBZCU7DejbZbZ6EUyHr3JQzYgwNPUPi": ["DFK"] -} -``` - -The above example aliases the Blockchain whose ID is -`"q2aTwKuyzgs8pynF7UXBZCU7DejbZbZ6EUyHr3JQzYgwNPUPi"` to `"DFK"`. Chain -aliases are added after adding primary network aliases and before any changes to -the aliases via the admin API. This means that the first alias included for a -Blockchain on a Subnet will be treated as the `"Primary Alias"` instead of the -full blockchainID. The Primary Alias is used in all metrics and logs. - -#### `--chain-aliases-file-content` (string) - -As an alternative to `--chain-aliases-file`, it allows specifying base64 encoded -aliases for Blockchains. - -#### `--chain-data-dir` (string) - -Chain specific data directory. Defaults to `$HOME/.avalanchego/chainData`. - -## Database - -##### `--db-dir` (string, file path) - -Specifies the directory to which the database is persisted. Defaults to `"$HOME/.avalanchego/db"`. - -##### `--db-type` (string) - -Specifies the type of database to use. Must be one of `LevelDB` or `memdb`. -`memdb` is an in-memory, non-persisted database. - -:::note - -`memdb` stores everything in memory. So if you have a 900 GiB LevelDB instance, then using `memdb` -you’d need 900 GiB of RAM. -`memdb` is useful for fast one-off testing, not for running an actual node (on Fuji or Mainnet). -Also note that `memdb` doesn’t persist after restart. So any time you restart the node it would -start syncing from scratch. - -::: - -### Database Config - -#### `--db-config-file` (string) - -Path to the database config file. Ignored if `--config-file-content` is specified. - -#### `--db-config-file-content` (string) - -As an alternative to `--db-config-file`, it allows specifying base64 encoded database config content. - -#### LevelDB Config - -A LevelDB config file must be JSON and may have these keys. -Any keys not given will receive the default value. - -```go -{ - // BlockCacheCapacity defines the capacity of the 'sorted table' block caching. - // Use -1 for zero. - // - // The default value is 12MiB. - "blockCacheCapacity": int - - // BlockSize is the minimum uncompressed size in bytes of each 'sorted table' - // block. - // - // The default value is 4KiB. - "blockSize": int - - // CompactionExpandLimitFactor limits compaction size after expanded. - // This will be multiplied by table size limit at compaction target level. - // - // The default value is 25. - "compactionExpandLimitFactor": int - - // CompactionGPOverlapsFactor limits overlaps in grandparent (Level + 2) - // that a single 'sorted table' generates. This will be multiplied by - // table size limit at grandparent level. - // - // The default value is 10. - "compactionGPOverlapsFactor": int - - // CompactionL0Trigger defines number of 'sorted table' at level-0 that will - // trigger compaction. - // - // The default value is 4. - "compactionL0Trigger": int - - // CompactionSourceLimitFactor limits compaction source size. This doesn't apply to - // level-0. - // This will be multiplied by table size limit at compaction target level. - // - // The default value is 1. - "compactionSourceLimitFactor": int - - // CompactionTableSize limits size of 'sorted table' that compaction generates. - // The limits for each level will be calculated as: - // CompactionTableSize * (CompactionTableSizeMultiplier ^ Level) - // The multiplier for each level can also fine-tuned using CompactionTableSizeMultiplierPerLevel. - // - // The default value is 2MiB. - "compactionTableSize": int - - // CompactionTableSizeMultiplier defines multiplier for CompactionTableSize. - // - // The default value is 1. - "compactionTableSizeMultiplier": float - - // CompactionTableSizeMultiplierPerLevel defines per-level multiplier for - // CompactionTableSize. - // Use zero to skip a level. - // - // The default value is nil. - "compactionTableSizeMultiplierPerLevel": []float - - // CompactionTotalSize limits total size of 'sorted table' for each level. - // The limits for each level will be calculated as: - // CompactionTotalSize * (CompactionTotalSizeMultiplier ^ Level) - // The multiplier for each level can also fine-tuned using - // CompactionTotalSizeMultiplierPerLevel. - // - // The default value is 10MiB. - "compactionTotalSize": int - - // CompactionTotalSizeMultiplier defines multiplier for CompactionTotalSize. - // - // The default value is 10. - "compactionTotalSizeMultiplier": float - - // DisableSeeksCompaction allows disabling 'seeks triggered compaction'. - // The purpose of 'seeks triggered compaction' is to optimize database so - // that 'level seeks' can be minimized, however this might generate many - // small compaction which may not preferable. - // - // The default is true. - "disableSeeksCompaction": bool - - // OpenFilesCacheCapacity defines the capacity of the open files caching. - // Use -1 for zero, this has same effect as specifying NoCacher to OpenFilesCacher. - // - // The default value is 1024. - "openFilesCacheCapacity": int - - // WriteBuffer defines maximum size of a 'memdb' before flushed to - // 'sorted table'. 'memdb' is an in-memory DB backed by an on-disk - // unsorted journal. - // - // LevelDB may held up to two 'memdb' at the same time. - // - // The default value is 6MiB. - "writeBuffer": int - - // FilterBitsPerKey is the number of bits to add to the bloom filter per - // key. - // - // The default value is 10. - "filterBitsPerKey": int - - // MaxManifestFileSize is the maximum size limit of the MANIFEST-****** file. - // When the MANIFEST-****** file grows beyond this size, LevelDB will create - // a new MANIFEST file. - // - // The default value is infinity. - "maxManifestFileSize": int - - // MetricUpdateFrequency is the frequency to poll LevelDB metrics in - // nanoseconds. - // If <= 0, LevelDB metrics aren't polled. - // - // The default value is 10s. - "metricUpdateFrequency": int -} -``` - -## Genesis - -#### `--genesis-file` (string) - -Path to a JSON file containing the genesis data to use. Ignored when running -standard networks (Mainnet, Fuji Testnet), or when `--genesis-content` is -specified. If not given, uses default genesis data. - -These are the main properties in the JSON file: - -- `networkID`: A unique identifier for the blockchain, must be a number in the range [0, 2^32). -- `allocations`: The list of initial addresses, their initial balances and the unlock schedule for each. -- `startTime`: The time of the beginning of the blockchain, it must be a Unix - timestamp and it can't be a time in the future. -- `initialStakeDuration`: The stake duration, in seconds, of the validators that exist at network genesis. -- `initialStakeDurationOffset`: The offset, in seconds, between the start times - of the validators that exist at genesis. -- `initialStakedFunds`: A list of addresses that own the funds staked at genesis - (each address must be present in `allocations` as well) -- `initialStakers`: The validators that exist at genesis. Each element contains - the `rewardAddress`, NodeID and the `delegationFee` of the validator. -- `cChainGenesis`: The genesis info to be passed to the C-Chain. -- `message`: A message to include in the genesis. Not required. - -For an example of a JSON representation of genesis data, see [genesis_local.json](https://github.com/ava-labs/avalanchego/blob/master/genesis/genesis_local.json). - -#### `--genesis-file-content` (string) - -As an alternative to `--genesis-file`, it allows specifying base64 encoded genesis data to use. - -## HTTP Server - -#### `--http-host` (string) - -The address that HTTP APIs listen on. Defaults to `127.0.0.1`. This means that -by default, your node can only handle API calls made from the same machine. To -allow API calls from other machines, use `--http-host=`. You can also enter -domain names as parameter. - -#### `--http-port` (int) - -Each node runs an HTTP server that provides the APIs for interacting with the -node and the Avalanche network. This argument specifies the port that the HTTP -server will listen on. The default value is `9650`. - -#### `--http-tls-cert-file` (string, file path) - -This argument specifies the location of the TLS certificate used by the node for -the HTTPS server. This must be specified when `--http-tls-enabled=true`. There -is no default value. This flag is ignored if `--http-tls-cert-file-content` is -specified. - -#### `--http-tls-cert-file-content` (string) - -As an alternative to `--http-tls-cert-file`, it allows specifying base64 encoded -content of the TLS certificate used by the node for the HTTPS server. Note that -full certificate content, with the leading and trailing header, must be base64 -encoded. This must be specified when `--http-tls-enabled=true`. - -#### `--http-tls-enabled` (boolean) - -If set to `true`, this flag will attempt to upgrade the server to use HTTPS. Defaults to `false`. - -#### `--http-tls-key-file` (string, file path) - -This argument specifies the location of the TLS private key used by the node for -the HTTPS server. This must be specified when `--http-tls-enabled=true`. There -is no default value. This flag is ignored if `--http-tls-key-file-content` is -specified. - -#### `--http-tls-key-file-content` (string) - -As an alternative to `--http-tls-key-file`, it allows specifying base64 encoded -content of the TLS private key used by the node for the HTTPS server. Note that -full private key content, with the leading and trailing header, must be base64 -encoded. This must be specified when `--http-tls-enabled=true`. - -#### `--http-read-timeout` (string) - -Maximum duration for reading the entire request, including the body. A zero or -negative value means there will be no timeout. - -#### `--http-read-header-timeout` (string) - -Maximum duration to read request headers. The connection’s read deadline is -reset after reading the headers. If `--http-read-header-timeout` is zero, the -value of `--http-read-timeout` is used. If both are zero, there is no timeout. - -#### `--http-write-timeout` (string) - -Maximum duration before timing out writes of the response. It is reset whenever -a new request’s header is read. A zero or negative value means there will be no -timeout. - -#### `--http-idle-timeout` (string) - -Maximum duration to wait for the next request when keep-alives are enabled. If -`--http-idle-timeout` is zero, the value of `--http-read-timeout` is used. If both are zero, -there is no timeout. - -#### `--http-allowed-origins` (string) - -Origins to allow on the HTTP port. Defaults to `*` which allows all origins. Example: -`"https://*.avax.network https://*.avax-test.network"` - -#### `--http-allowed-hosts` (string) - -List of acceptable host names in API requests. Provide the wildcard (`'*'`) to accept -requests from all hosts. API requests where the `Host` field is empty or an IP address -will always be accepted. An API call whose HTTP `Host` field isn't acceptable will -receive a 403 error code. Defaults to `localhost`. - -## File Descriptor Limit - -#### `--fd-limit` (int) - -Attempts to raise the process file descriptor limit to at least this value and -error if the value is above the system max. Linux default `32768`. - -## Logging - -#### `--log-level` (string, `{verbo, debug, trace, info, warn, error, fatal, off}`) - -The log level determines which events to log. There are 8 different levels, in -order from highest priority to lowest. - -- `off`: No logs have this level of logging. Turns off logging. -- `fatal`: Fatal errors that are not recoverable. -- `error`: Errors that the node encounters, these errors were able to be recovered. -- `warn`: A Warning that might be indicative of a spurious byzantine node, or potential future error. -- `info`: Useful descriptions of node status updates. -- `trace`: Traces container (block, vertex, transaction) job results. Useful for - tracing container IDs and their outcomes. -- `debug`: Debug logging is useful when attempting to understand possible bugs - in the code. More information that would be typically desired for normal usage - will be displayed. -- `verbo`: Tracks extensive amounts of information the node is processing. This - includes message contents and binary dumps of data for extremely low level - protocol analysis. - -When specifying a log level note that all logs with the specified priority or -higher will be tracked. Defaults to `info`. - -#### `--log-display-level` (string, `{verbo, debug, trace, info, warn, error, fatal, off}`) - -The log level determines which events to display to stdout. If left blank, -will default to the value provided to `--log-level`. - -#### `--log-format` (string, `{auto, plain, colors, json}`) - -The structure of log format. Defaults to `auto` which formats terminal-like -logs, when the output is a terminal. Otherwise, should be one of `{auto, plain, colors, json}` - -#### `--log-dir` (string, file path) - -Specifies the directory in which system logs are kept. Defaults to `"$HOME/.avalanchego/logs"`. -If you are running the node as a system service (ex. using the installer script) logs will also be -stored in `$HOME/var/log/syslog`. - -#### `--log-disable-display-plugin-logs` (boolean) - -Disables displaying plugin logs in stdout. Defaults to `false`. - -#### `--log-rotater-max-size` (uint) - -The maximum file size in megabytes of the log file before it gets rotated. Defaults to `8`. - -#### `--log-rotater-max-files` (uint) - -The maximum number of old log files to retain. 0 means retain all old log files. Defaults to `7`. - -#### `--log-rotater-max-age` (uint) - -The maximum number of days to retain old log files based on the timestamp -encoded in their filename. 0 means retain all old log files. Defaults to `0`. - -#### `--log-rotater-compress-enabled` (boolean) - -Enables the compression of rotated log files through gzip. Defaults to `false`. - -## Network ID - -#### `--network-id` (string) - -The identity of the network the node should connect to. Can be one of: - -- `--network-id=mainnet` -> Connect to Mainnet (default). -- `--network-id=fuji` -> Connect to the Fuji test-network. -- `--network-id=testnet` -> Connect to the current test-network. (Right now, this is Fuji.) -- `--network-id=local` -> Connect to a local test-network. -- `--network-id=network-{id}` -> Connect to the network with the given ID. - `id` must be in the range `[0, 2^32)`. - -## OpenTelemetry - -AvalancheGo supports collecting and exporting [OpenTelemetry](https://opentelemetry.io/) traces. -This might be useful for debugging, performance analysis, or monitoring. - -#### `--tracing-enabled` (boolean) - -If true, enable OpenTelemetry tracing. Defaults to `false`. - -#### `--tracing-endpoint` (string) - -The endpoint to export trace data to. Defaults to `localhost:4317`. - -#### `--tracing-insecure` (string) - -If true, don't use TLS when exporting trace data. Defaults to `true`. - -#### `--tracing-sample-rate` (float) - -The fraction of traces to sample. If >= 1, always sample. If `<= 0`, never sample. -Defaults to `0.1`. - -#### `--tracing-exporter-type`(string) - -Type of exporter to use for tracing. Options are [`grpc`,`http`]. Defaults to `grpc`. - -## Public IP - -Validators must know one of their public facing IP addresses so they can enable -other nodes to connect to them. - -By default, the node will attempt to perform NAT traversal to get the node's IP -according to its router. - -#### `--public-ip` (string) - -If this argument is provided, the node assume this is its public IP. - -:::tip -When running a local network it may be easiest to set this value to `127.0.0.1`. -::: - -#### `--public-ip-resolution-frequency` (duration) - -Frequency at which this node resolves/updates its public IP and renew NAT -mappings, if applicable. Default to 5 minutes. - -#### `--public-ip-resolution-service` (string) - -When provided, the node will use that service to periodically resolve/update its -public IP. Only acceptable values are `ifconfigCo`, `opendns` or `ifconfigMe`. - -## Staking - -#### `--staking-port` (int) - -The port through which the network peers will connect to this node externally. -Having this port accessible from the internet is required for correct node -operation. Defaults to `9651`. - -#### `--sybil-protection-enabled` (boolean) - -Avalanche uses Proof of Stake (PoS) as sybil resistance to make it prohibitively -expensive to attack the network. If false, sybil resistance is disabled and all -peers will be sampled during consensus. Defaults to `true`. Note that this can -not be disabled on public networks (`Fuji` and `Mainnet`). - -Setting this flag to `false` **does not** mean "this node is not a validator." -It means that this node will sample all nodes, not just validators. -**You should not set this flag to false unless you understand what you are doing.** - -#### `--sybil-protection-disabled-weight` (uint) - -Weight to provide to each peer when staking is disabled. Defaults to `100`. - -#### `--staking-tls-cert-file` (string, file path) - -Avalanche uses two-way authenticated TLS connections to securely connect nodes. -This argument specifies the location of the TLS certificate used by the node. By -default, the node expects the TLS certificate to be at -`$HOME/.avalanchego/staking/staker.crt`. This flag is ignored if -`--staking-tls-cert-file-content` is specified. - -#### `--staking-tls-cert-file-content` (string) - -As an alternative to `--staking-tls-cert-file`, it allows specifying base64 -encoded content of the TLS certificate used by the node. Note that full -certificate content, with the leading and trailing header, must be base64 -encoded. - -#### `--staking-tls-key-file` (string, file path) - -Avalanche uses two-way authenticated TLS connections to securely connect nodes. -This argument specifies the location of the TLS private key used by the node. By -default, the node expects the TLS private key to be at -`$HOME/.avalanchego/staking/staker.key`. This flag is ignored if -`--staking-tls-key-file-content` is specified. - -#### `--staking-tls-key-file-content` (string) - -As an alternative to `--staking-tls-key-file`, it allows specifying base64 -encoded content of the TLS private key used by the node. Note that full private -key content, with the leading and trailing header, must be base64 encoded. - -## Subnets - -### Subnet Tracking - -#### `--track-subnets` (string) - -Comma separated list of Subnet IDs that this node would track if added to. -Defaults to empty (will only validate the Primary Network). - -### Subnet Configs - -It is possible to provide parameters for Subnets. Parameters here apply to all -chains in the specified Subnets. Parameters must be specified with a -`{subnetID}.json` config file under `--subnet-config-dir`. AvalancheGo loads -configs for Subnets specified in -`--track-subnets` parameter. - -Full reference for all configuration options for a Subnet can be found in a -separate [Subnet Configs](./subnet-configs) document. - -#### `--subnet-config-dir` (`string`) - -Specifies the directory that contains Subnet configs, as described above. -Defaults to `$HOME/.avalanchego/configs/subnets`. If the flag is set explicitly, -the specified folder must exist, or AvalancheGo will exit with an error. This -flag is ignored if `--subnet-config-content` is specified. - -Example: Let's say we have a Subnet with ID -`p4jUwqZsA2LuSftroCd3zb4ytH8W99oXKuKVZdsty7eQ3rXD6`. We can create a config file -under the default `subnet-config-dir` at -`$HOME/.avalanchego/configs/subnets/p4jUwqZsA2LuSftroCd3zb4ytH8W99oXKuKVZdsty7eQ3rXD6.json`. -An example config file is: - -```json -{ - "validatorOnly": false, - "consensusParameters": { - "k": 25, - "alpha": 18 - } -} -``` - -:::tip -By default, none of these directories and/or files exist. You would need to create them manually if needed. -::: - -#### `--subnet-config-content` (string) - -As an alternative to `--subnet-config-dir`, it allows specifying base64 encoded parameters for a Subnet. - -## Version - -#### `--version` (boolean) - -If this is `true`, print the version and quit. Defaults to `false`. - -## Advanced Options - -The following options may affect the correctness of a node. Only power users should change these. - -### Gossiping - -#### `--consensus-accepted-frontier-gossip-validator-size` (uint) - -Number of validators to gossip to when gossiping accepted frontier. Defaults to `0`. - -#### `--consensus-accepted-frontier-gossip-non-validator-size` (uint) - -Number of non-validators to gossip to when gossiping accepted frontier. Defaults to `0`. - -#### `--consensus-accepted-frontier-gossip-peer-size` (uint) - -Number of peers to gossip to when gossiping accepted frontier. Defaults to `15`. - -#### `--consensus-accepted-frontier-gossip-frequency` (duration) - -Time between gossiping accepted frontiers. Defaults to `10s`. - -#### `--consensus-on-accept-gossip-validator-size` (uint) - -Number of validators to gossip to each accepted container to. Defaults to `0`. - -#### `--consensus-on-accept-gossip-non-validator-size` (uint) - -Number of non-validators to gossip to each accepted container to. Defaults to `0`. - -#### `--consensus-on-accept-gossip-peer-size` (uint) - -Number of peers to gossip to each accepted container to. Defaults to `10`. - -### Benchlist - -#### `--benchlist-duration` (duration) - -Maximum amount of time a peer is benchlisted after surpassing -`--benchlist-fail-threshold`. Defaults to `15m`. - -#### `--benchlist-fail-threshold` (int) - -Number of consecutive failed queries to a node before benching it (assuming all -queries to it will fail). Defaults to `10`. - -#### `--benchlist-min-failing-duration` (duration) - -Minimum amount of time queries to a peer must be failing before the peer is benched. Defaults to `150s`. - -### Consensus Parameters - -:::note -Some of these parameters can only be set on a local or private network, not on Fuji Testnet or Mainnet -::: - -#### `--consensus-shutdown-timeout` (duration) - -Timeout before killing an unresponsive chain. Defaults to `5s`. - -#### `--create-asset-tx-fee` (int) - -Transaction fee, in nAVAX, for transactions that create new assets. Defaults to -`10000000` nAVAX (.01 AVAX) per transaction. This can only be changed on a local -network. - -#### `--create-subnet-tx-fee` (int) - -Transaction fee, in nAVAX, for transactions that create new Subnets. Defaults to -`1000000000` nAVAX (1 AVAX) per transaction. This can only be changed on a local -network. - -#### `--create-blockchain-tx-fee` (int) - -Transaction fee, in nAVAX, for transactions that create new blockchains. -Defaults to `1000000000` nAVAX (1 AVAX) per transaction. This can only be -changed on a local network. - -#### `--transform-subnet-tx-fee` (int) - -Transaction fee, in nAVAX, for transactions that transform Subnets. Defaults to -`1000000000` nAVAX (1 AVAX) per transaction. This can only be changed on a local network. - -#### `--add-primary-network-validator-fee` (int) - -Transaction fee, in nAVAX, for transactions that add new primary network validators. Defaults to 0. -This can only be changed on a local network. - -#### `--add-primary-network-delegator-fee` (int) - -Transaction fee, in nAVAX, for transactions that add new primary network delegators. Defaults to 0. -This can only be changed on a local network. - -#### `--add-subnet-validator-fee` (int) - -Transaction fee, in nAVAX, for transactions that add new Subnet validators. -Defaults to `10000000` nAVAX (.01 AVAX). - -#### `--add-subnet-delegator-fee` (int) - -Transaction fee, in nAVAX, for transactions that add new Subnet delegators. -Defaults to `10000000` nAVAX (.01 AVAX). - -#### `--min-delegator-stake` (int) - -The minimum stake, in nAVAX, that can be delegated to a validator of the Primary Network. - -Defaults to `25000000000` (25 AVAX) on Mainnet. Defaults to `5000000` (.005 -AVAX) on Test Net. This can only be changed on a local network. - -#### `--min-delegation-fee` (int) - -The minimum delegation fee that can be charged for delegation on the Primary -Network, multiplied by `10,000` . Must be in the range `[0, 1000000]`. Defaults -to `20000` (2%) on Mainnet. This can only be changed on a local network. - -#### `--min-stake-duration` (duration) - -Minimum staking duration. The Default on Mainnet is `336h` (two weeks). This can only be changed on -a local network. This applies to both delegation and validation periods. - -#### `--min-validator-stake` (int) - -The minimum stake, in nAVAX, required to validate the Primary Network. This can -only be changed on a local network. - -Defaults to `2000000000000` (2,000 AVAX) on Mainnet. Defaults to `5000000` (.005 AVAX) on Test Net. - -#### `--max-stake-duration` (duration) - -The maximum staking duration, in hours. Defaults to `8760h` (365 days) on -Mainnet. This can only be changed on a local network. - -#### `--max-validator-stake` (int) - -The maximum stake, in nAVAX, that can be placed on a validator on the primary -network. Defaults to `3000000000000000` (3,000,000 AVAX) on Mainnet. This -includes stake provided by both the validator and by delegators to the -validator. This can only be changed on a local network. - -#### `--stake-minting-period` (duration) - -Consumption period of the staking function, in hours. The Default on Mainnet is -`8760h` (365 days). This can only be changed on a local network. - -#### `--stake-max-consumption-rate` (uint) - -The maximum percentage of the consumption rate for the remaining token supply in -the minting period, which is 1 year on Mainnet. Defaults to `120,000` which is -12% per years. This can only be changed on a local network. - -#### `--stake-min-consumption-rate` (uint) - -The minimum percentage of the consumption rate for the remaining token supply in -the minting period, which is 1 year on Mainnet. Defaults to `100,000` which is -10% per years. This can only be changed on a local network. - -#### `--stake-supply-cap` (uint) - -The maximum stake supply, in nAVAX, that can be placed on a validator. Defaults -to `720,000,000,000,000,000` nAVAX. This can only be changed on a local network. - -#### `--tx-fee` (int) - -The required amount of nAVAX to be burned for a transaction to be valid on the -X-Chain, and for import/export transactions on the P-Chain. This parameter -requires network agreement in its current form. Changing this value from the -default should only be done on private networks or local network. Defaults to -`1,000,000` nAVAX per transaction. - -#### `--uptime-requirement` (float) - -Fraction of time a validator must be online to receive rewards. Defaults to -`0.8`. This can only be changed on a local network. - -#### `--uptime-metric-freq` (duration) - -Frequency of renewing this node's average uptime metric. Defaults to `30s`. - -#### Snow Parameters - -##### `--snow-concurrent-repolls` (int) - -Snow consensus requires repolling transactions that are issued during low time -of network usage. This parameter lets one define how aggressive the client will -be in finalizing these pending transactions. This should only be changed after -careful consideration of the tradeoffs of Snow consensus. The value must be at -least `1` and at most `--snow-rogue-commit-threshold`. Defaults to `4`. - -##### `--snow-sample-size` (int) - -Snow consensus defines `k` as the number of validators that are sampled during -each network poll. This parameter lets one define the `k` value used for -consensus. This should only be changed after careful consideration of the -tradeoffs of Snow consensus. The value must be at least `1`. Defaults to `20`. - -##### `--snow-quorum-size` (int) - -Snow consensus defines `alpha` as the number of validators that must prefer a -transaction during each network poll to increase the confidence in the -transaction. This parameter lets us define the `alpha` value used for consensus. -This should only be changed after careful consideration of the tradeoffs of Snow -consensus. The value must be at greater than `k/2`. Defaults to `15`. - -##### `--snow-virtuous-commit-threshold` (int) - -Snow consensus defines `beta1` as the number of consecutive polls that a -virtuous transaction must increase its confidence for it to be accepted. This -parameter lets us define the `beta1` value used for consensus. This should only -be changed after careful consideration of the tradeoffs of Snow consensus. The -value must be at least `1`. Defaults to `15`. - -##### `--snow-rogue-commit-threshold` (int) - -Snow consensus defines `beta2` as the number of consecutive polls that a rogue -transaction must increase its confidence for it to be accepted. This parameter -lets us define the `beta2` value used for consensus. This should only be changed -after careful consideration of the tradeoffs of Snow consensus. The value must -be at least `beta1`. Defaults to `20`. - -##### `--snow-optimal-processing` (int) - -Optimal number of processing items in consensus. The value must be at least `1`. Defaults to `50`. - -##### `--snow-max-processing` (int) - -Maximum number of processing items to be considered healthy. Reports unhealthy -if more than this number of items are outstanding. The value must be at least -`1`. Defaults to `1024`. - -##### `--snow-max-time-processing` (duration) - -Maximum amount of time an item should be processing and still be healthy. -Reports unhealthy if there is an item processing for longer than this duration. -The value must be greater than `0`. Defaults to `2m`. - -### ProposerVM Parameters - -#### `--proposervm-use-current-height` (bool) - -Have the ProposerVM always report the last accepted P-chain block height. Defaults to `false`. - -### Continuous Profiling - -You can configure your node to continuously run memory/CPU profiles and save the -most recent ones. Continuous memory/CPU profiling is enabled if -`--profile-continuous-enabled` is set. - -#### `--profile-continuous-enabled` (boolean) - -Whether the app should continuously produce performance profiles. Defaults to the false (not enabled). - -#### `--profile-dir` (string) - -If profiling enabled, node continuously runs memory/CPU profiles and puts them -at this directory. Defaults to the `$HOME/.avalanchego/profiles/`. - -#### `--profile-continuous-freq` (duration) - -How often a new CPU/memory profile is created. Defaults to `15m`. - -#### `--profile-continuous-max-files` (int) - -Maximum number of CPU/memory profiles files to keep. Defaults to 5. - -### Health - -#### `--health-check-frequency` (duration) - -Health check runs with this frequency. Defaults to `30s`. - -#### `--health-check-averager-halflife` (duration) - -Half life of averagers used in health checks (to measure the rate of message -failures, for example.) Larger value --> less volatile calculation of -averages. Defaults to `10s`. - -### Network - -#### `--network-allow-private-ips` (bool) - -Allows the node to connect peers with private IPs. Defaults to `true`. - -#### `--network-compression-type` (string) - -The type of compression to use when sending messages to peers. Defaults to `gzip`. -Must be one of [`gzip`, `zstd`, `none`]. - -Nodes can handle inbound `gzip` compressed messages but by default send `zstd` compressed messages. - -#### `--network-initial-timeout` (duration) - -Initial timeout value of the adaptive timeout manager. Defaults to `5s`. - -#### `--network-initial-reconnect-delay` (duration) - -Initial delay duration must be waited before attempting to reconnect a peer. Defaults to `1s`. - -#### `--network-max-reconnect-delay` (duration) - -Maximum delay duration must be waited before attempting to reconnect a peer. Defaults to `1h`. - -#### `--network-minimum-timeout` (duration) - -Minimum timeout value of the adaptive timeout manager. Defaults to `2s`. - -#### `--network-maximum-timeout` (duration) - -Maximum timeout value of the adaptive timeout manager. Defaults to `10s`. - -#### `--network-maximum-inbound-timeout` (duration) - -Maximum timeout value of an inbound message. Defines duration within which an -incoming message must be fulfilled. Incoming messages containing deadline higher -than this value will be overridden with this value. Defaults to `10s`. - -#### `--network-timeout-halflife` (duration) - -Half life used when calculating average network latency. Larger value --> less -volatile network latency calculation. Defaults to `5m`. - -#### `--network-timeout-coefficient` (duration) - -Requests to peers will time out after \[`network-timeout-coefficient`\] \* -\[average request latency\]. Defaults to `2`. - -#### `--network-read-handshake-timeout` (duration) - -Timeout value for reading handshake messages. Defaults to `15s`. - -#### `--network-ping-timeout` (duration) - -Timeout value for Ping-Pong with a peer. Defaults to `30s`. - -#### `--network-ping-frequency` (duration) - -Frequency of pinging other peers. Defaults to `22.5s`. - -#### `--network-health-min-conn-peers` (uint) - -Node will report unhealthy if connected to less than this many peers. Defaults to `1`. - -#### `--network-health-max-time-since-msg-received` (duration) - -Node will report unhealthy if it hasn't received a message for this amount of time. Defaults to `1m`. - -#### `--network-health-max-time-since-msg-sent` (duration) - -Network layer returns unhealthy if haven't sent a message for at least this much time. Defaults to `1m`. - -#### `--network-health-max-portion-send-queue-full` (float) - -Node will report unhealthy if its send queue is more than this portion full. -Must be in \[0,1\]. Defaults to `0.9`. - -#### `--network-health-max-send-fail-rate` (float) - -Node will report unhealthy if more than this portion of message sends fail. Must -be in \[0,1\]. Defaults to `0.25`. - -#### `--network-health-max-outstanding-request-duration` (duration) - -Node reports unhealthy if there has been a request outstanding for this duration. Defaults to `5m`. - -#### `--network-max-clock-difference` (duration) - -Max allowed clock difference value between this node and peers. Defaults to `1m`. - -#### `--network-require-validator-to-connect` (bool) - -If true, this node will only maintain a connection with another node if this -node is a validator, the other node is a validator, or the other node is a -beacon. - -#### `--network-tcp-proxy-enabled` (bool) - -Require all P2P connections to be initiated with a TCP proxy header. Defaults to `false`. - -#### `--network-tcp-proxy-read-timeout` (duration) - -Maximum duration to wait for a TCP proxy header. Defaults to `3s`. - -#### `--network-outbound-connection-timeout` (duration) - -Timeout while dialing a peer. Defaults to `30s`. - -### Message Rate-Limiting - -These flags govern rate-limiting of inbound and outbound messages. For more -information on rate-limiting and the flags below, see package `throttling` in -AvalancheGo. - -#### CPU Based - -Rate-limiting based on how much CPU usage a peer causes. - -##### `--throttler-inbound-cpu-validator-alloc` (float) - -Number of CPU allocated for use by validators. Value should be in range (0, total core count]. -Defaults to half of the number of CPUs on the machine. - -##### `--throttler-inbound-cpu-max-recheck-delay` (duration) - -In the CPU rate-limiter, check at least this often whether the node's CPU usage -has fallen to an acceptable level. Defaults to `5s`. - -##### `--throttler-inbound-disk-max-recheck-delay` (duration) - -In the disk-based network throttler, check at least this often whether the node's disk usage has -fallen to an acceptable level. Defaults to `5s`. - -##### `--throttler-inbound-cpu-max-non-validator-usage` (float) - -Number of CPUs that if fully utilized, will rate limit all non-validators. Value should be in range -[0, total core count]. -Defaults to %80 of the number of CPUs on the machine. - -##### `--throttler-inbound-cpu-max-non-validator-node-usage` (float) - -Maximum number of CPUs that a non-validator can utilize. Value should be in range [0, total core count]. -Defaults to the number of CPUs / 8. - -##### `--throttler-inbound-disk-validator-alloc` (float) - -Maximum number of disk reads/writes per second to allocate for use by validators. Must be > 0. -Defaults to `1000 GiB/s`. - -##### `--throttler-inbound-disk-max-non-validator-usage` (float) - -Number of disk reads/writes per second that, if fully utilized, will rate limit all non-validators. -Must be >= 0. -Defaults to `1000 GiB/s`. - -##### `--throttler-inbound-disk-max-non-validator-node-usage` (float) - -Maximum number of disk reads/writes per second that a non-validator can utilize. Must be >= 0. -Defaults to `1000 GiB/s`. - -#### Bandwidth Based - -Rate-limiting based on the bandwidth a peer uses. - -##### `--throttler-inbound-bandwidth-refill-rate` (uint) - -Max average inbound bandwidth usage of a peer, in bytes per second. See -interface `throttling.BandwidthThrottler`. Defaults to `512`. - -##### `--throttler-inbound-bandwidth-max-burst-size` (uint) - -Max inbound bandwidth a node can use at once. See interface -`throttling.BandwidthThrottler`. Defaults to `2 MiB`. - -#### Message Size Based - -Rate-limiting based on the total size, in bytes, of unprocessed messages. - -##### `--throttler-inbound-at-large-alloc-size` (uint) - -Size, in bytes, of at-large allocation in the inbound message throttler. Defaults to `6291456` (6 MiB). - -##### `--throttler-inbound-validator-alloc-size` (uint) - -Size, in bytes, of validator allocation in the inbound message throttler. -Defaults to `33554432` (32 MiB). - -##### `--throttler-inbound-node-max-at-large-bytes` (uint) - -Maximum number of bytes a node can take from the at-large allocation of the -inbound message throttler. Defaults to `2097152` (2 MiB). - -#### Message Based - -Rate-limiting based on the number of unprocessed messages. - -##### `--throttler-inbound-node-max-processing-msgs` (uint) - -Node will stop reading messages from a peer when it is processing this many messages from the peer. -Will resume reading messages from the peer when it is processing less than this many messages. -Defaults to `1024`. - -#### Outbound - -Rate-limiting for outbound messages. - -##### `--throttler-outbound-at-large-alloc-size` (uint) - -Size, in bytes, of at-large allocation in the outbound message throttler. -Defaults to `33554432` (32 MiB). - -##### `--throttler-outbound-validator-alloc-size` (uint) - -Size, in bytes, of validator allocation in the outbound message throttler. -Defaults to `33554432` (32 MiB). - -##### `--throttler-outbound-node-max-at-large-bytes` (uint) - -Maximum number of bytes a node can take from the at-large allocation of the -outbound message throttler. Defaults to `2097152` (2 MiB). - -### Connection Rate-Limiting - -#### `--network-inbound-connection-throttling-cooldown` (duration) - -Node will upgrade an inbound connection from a given IP at most once within this -duration. Defaults to `10s`. If 0 or negative, will not consider recency of last -upgrade when deciding whether to upgrade. - -#### `--network-inbound-connection-throttling-max-conns-per-sec` (uint) - -Node will accept at most this many inbound connections per second. Defaults to `512`. - -#### `--network-outbound-connection-throttling-rps` (uint) - -Node makes at most this many outgoing peer connection attempts per second. Defaults to `50`. - -### Peer List Gossiping - -Nodes gossip peers to each other so that each node can have an up-to-date peer -list. A node gossips `--network-peer-list-num-validator-ips` validator IPs to -`--network-peer-list-validator-gossip-size` validators, -`--network-peer-list-non-validator-gossip-size` non-validators and -`--network-peer-list-peers-gossip-size` peers every -`--network-peer-list-gossip-frequency`. - -#### `--network-peer-list-num-validator-ips` (int) - -Number of validator IPs to gossip to other nodes Defaults to `15`. - -#### `--network-peer-list-validator-gossip-size` (int) - -Number of validators that the node will gossip peer list to. Defaults to `20`. - -#### `--network-peer-list-non-validator-gossip-size` (int) - -Number of non-validators that the node will gossip peer list to. Defaults to `0`. - -#### `--network-peer-list-peers-gossip-size` (int) - -Number of total peers (including non-validator or validator) that the node will gossip peer list to -Defaults to `0`. - -#### `--network-peer-list-gossip-frequency` (duration) - -Frequency to gossip peers to other nodes. Defaults to `1m`. - -#### ` --network-peer-read-buffer-size` (int) - -Size of the buffer that peer messages are read into (there is one buffer per -peer), defaults to `8` KiB (8192 Bytes). - -#### `--network-peer-write-buffer-size` (int) - -Size of the buffer that peer messages are written into (there is one buffer per -peer), defaults to `8` KiB (8192 Bytes). - -### Resource Usage Tracking - -#### `--meter-vm-enabled` (bool) - -Enable Meter VMs to track VM performance with more granularity. Defaults to `true`. - -#### `--system-tracker-frequency` (duration) - -Frequency to check the real system usage of tracked processes. More frequent -checks --> usage metrics are more accurate, but more expensive to track. -Defaults to `500ms`. - -#### `--system-tracker-processing-halflife` (duration) - -Half life to use for the processing requests tracker. Larger half life --> usage -metrics change more slowly. Defaults to `15s`. - -#### `--system-tracker-cpu-halflife` (duration) - -Half life to use for the CPU tracker. Larger half life --> CPU usage metrics -change more slowly. Defaults to `15s`. - -#### `--system-tracker-disk-halflife` (duration) - -Half life to use for the disk tracker. Larger half life --> disk usage metrics -change more slowly. Defaults to `1m`. - -#### `--system-tracker-disk-required-available-space` (uint) - -"Minimum number of available bytes on disk, under which the node will shutdown. -Defaults to `536870912` (512 MiB). - -#### `--system-tracker-disk-warning-threshold-available-space` (uint) - -Warning threshold for the number of available bytes on disk, under which the -node will be considered unhealthy. Must be >= -`--system-tracker-disk-required-available-space`. Defaults to `1073741824` (1 -GiB). - -### Plugins - -#### `--plugin-dir` (string) - -Sets the directory for [VM plugins](/build/vm/intro.md). The default value is `$HOME/.avalanchego/plugins`. - -### Virtual Machine (VM) Configs - -#### `--vm-aliases-file (string)` - -Path to JSON file that defines aliases for Virtual Machine IDs. Defaults to -`~/.avalanchego/configs/vms/aliases.json`. This flag is ignored if -`--vm-aliases-file-content` is specified. Example content: - -```json -{ - "tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH": [ - "timestampvm", - "timerpc" - ] -} -``` - -The above example aliases the VM whose ID is -`"tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH"` to `"timestampvm"` and -`"timerpc"`. - -`--vm-aliases-file-content` (string) - -As an alternative to `--vm-aliases-file`, it allows specifying base64 encoded -aliases for Virtual Machine IDs. - -### Indexing - -#### `--index-allow-incomplete` (boolean) - -If true, allow running the node in such a way that could cause an index to miss transactions. -Ignored if index is disabled. Defaults to `false`. - -### Router - -#### `--router-health-max-drop-rate` (float) - -Node reports unhealthy if the router drops more than this portion of messages. Defaults to `1`. - -#### `--router-health-max-outstanding-requests` (uint) - -Node reports unhealthy if there are more than this many outstanding consensus requests -(Get, PullQuery, etc.) over all chains. Defaults to `1024`. diff --git a/docs/nodes/configure/subnet-configs.md b/docs/nodes/configure/subnet-configs.md deleted file mode 100644 index fab5e0e425f..00000000000 --- a/docs/nodes/configure/subnet-configs.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -tags: [Nodes] -description: Reference for all available Subnet config options and flags. -sidebar_label: Subnet Configs -pagination_label: Subnet Configs -sidebar_position: 2 ---- - -# Subnet Configs - -It is possible to provide parameters for a Subnet. Parameters here apply to all -chains in the specified Subnet. - -AvalancheGo looks for files specified with `{subnetID}.json` under -`--subnet-config-dir` as documented -[here](/nodes/configure/avalanchego-config-flags.md#subnet-configs). - -Here is an example of Subnet config file: - -```json -{ - "validatorOnly": false, - "consensusParameters": { - "k": 25, - "alpha": 18 - } -} -``` - -## Parameters - -### Private Subnet - -#### `validatorOnly` (bool) - -If `true` this node does not expose Subnet blockchain contents to non-validators -via P2P messages. Defaults to `false`. - -Avalanche Subnets are public by default. It means that every node can sync and -listen ongoing transactions/blocks in Subnets, even they're not validating the -listened Subnet. - -Subnet validators can choose not to publish contents of blockchains via this -configuration. If a node sets `validatorOnly` to true, the node exchanges -messages only with this Subnet's validators. Other peers will not be able to -learn contents of this Subnet from this node. - -:::tip - -This is a node-specific configuration. Every validator of this Subnet has to use -this configuration in order to create a full private Subnet. - -::: - -#### `allowedNodes` (string list) - -If `validatorOnly=true` this allows explicitly specified NodeIDs to be allowed -to sync the Subnet regardless of validator status. Defaults to be empty. - -:::tip - -This is a node-specific configuration. Every validator of this Subnet has to use -this configuration in order to properly allow a node in the private Subnet. - -::: - -#### `proposerMinBlockDelay` (duration) - -The minimum delay performed when building snowman++ blocks. Default is set to 1 second. - -As one of the ways to control network congestion, Snowman++ will only build a -block `proposerMinBlockDelay` after the parent block's timestamp. Some -high-performance custom VM may find this too strict. This flag allows tuning the -frequency at which blocks are built. - -### Consensus Parameters - -Subnet configs supports loading new consensus parameters. JSON keys are -different from their matching `CLI` keys. These parameters must be grouped under -`consensusParameters` key. The consensus parameters of a Subnet default to the -same values used for the Primary Network, which are given [CLI Snow Parameters](/nodes/configure/avalanchego-config-flags.md#snow-parameters). - -| CLI Key | JSON Key | -| :------------------------------- | :-------------------- | -| --snow-sample-size | k | -| --snow-quorum-size | alpha | -| --snow-virtuous-commit-threshold | `betaVirtuous` | -| --snow-rogue-commit-threshold | `betaRogue` | -| --snow-concurrent-repolls | concurrentRepolls | -| --snow-optimal-processing | `optimalProcessing` | -| --snow-max-processing | maxOutstandingItems | -| --snow-max-time-processing | maxItemProcessingTime | -| --snow-avalanche-batch-size | `batchSize` | -| --snow-avalanche-num-parents | `parentSize` | - -### Gossip Configs - -It's possible to define different Gossip configurations for each Subnet without -changing values for Primary Network. JSON keys of these -parameters are different from their matching `CLI` keys. These parameters -default to the same values used for the Primary Network. For more information -see [CLI Gossip Configs](/nodes/configure/avalanchego-config-flags.md#gossiping). - -| CLI Key | JSON Key | -| :------------------------------------------------------ | :------------------------------------- | -| --consensus-accepted-frontier-gossip-validator-size | gossipAcceptedFrontierValidatorSize | -| --consensus-accepted-frontier-gossip-non-validator-size | gossipAcceptedFrontierNonValidatorSize | -| --consensus-accepted-frontier-gossip-peer-size | gossipAcceptedFrontierPeerSize | -| --consensus-on-accept-gossip-validator-size | gossipOnAcceptValidatorSize | -| --consensus-on-accept-gossip-non-validator-size | gossipOnAcceptNonValidatorSize | -| --consensus-on-accept-gossip-peer-size | gossipOnAcceptPeerSize | From afe2e50796d70b7a30dfa6be50b28d321e9262ca Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 25 Mar 2024 11:57:00 -0400 Subject: [PATCH 11/18] fix --- configs/remoteContent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/remoteContent.js b/configs/remoteContent.js index 0106fb2391c..fb90bd469db 100644 --- a/configs/remoteContent.js +++ b/configs/remoteContent.js @@ -620,7 +620,7 @@ ${updatedContent}`, outDir: "docs/nodes/configure/", // change filename and correct links modifyContent(filename, content) { - if (filename.includes("service")) { + if (filename.includes("config")) { const newContent = insertSourceDocLink( content, "https://github.com/ava-labs/avalanchego/tree/master/config/config.md" @@ -645,7 +645,7 @@ ${updatedContent}`, outDir: "docs/nodes/configure/", // change filename and correct links modifyContent(filename, content) { - if (filename.includes("service")) { + if (filename.includes("config")) { const newContent = insertSourceDocLink( content, "https://github.com/ava-labs/avalanchego/tree/master/subnets/config.md" From 1d9dae3fdb4781971694dfea386799659bc7142e Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 25 Mar 2024 12:25:29 -0400 Subject: [PATCH 12/18] x-chain configs --- docs/nodes/configure/c-chain-configs.md | 0 docs/nodes/configure/chain-config-flags.md | 46 ---------------- docs/nodes/configure/p-chain-configs.md | 0 docs/nodes/configure/x-chain-configs.md | 62 ++++++++++++++++++++++ 4 files changed, 62 insertions(+), 46 deletions(-) create mode 100644 docs/nodes/configure/c-chain-configs.md create mode 100644 docs/nodes/configure/p-chain-configs.md create mode 100644 docs/nodes/configure/x-chain-configs.md diff --git a/docs/nodes/configure/c-chain-configs.md b/docs/nodes/configure/c-chain-configs.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/nodes/configure/chain-config-flags.md b/docs/nodes/configure/chain-config-flags.md index fa14b55bf7f..148637d5d33 100644 --- a/docs/nodes/configure/chain-config-flags.md +++ b/docs/nodes/configure/chain-config-flags.md @@ -772,52 +772,6 @@ upgrades have taken place before the last accepted block on startup. This allows node operators to recover if their node has accepted blocks after a network upgrade with a version of the code prior to the upgrade. Defaults to `false`. -## X-Chain Configs - -In order to specify a config for the X-Chain, a JSON config file should be -placed at `{chain-config-dir}/X/config.json`. - -For example if `chain-config-dir` has the default value which is -`$HOME/.avalanchego/configs/chains`, then `config.json` can be placed at -`$HOME/.avalanchego/configs/chains/X/config.json`. - -This allows you to specify a config to be passed into the X-Chain. The default -values for this config are: - -```json -{ - "index-transactions": false, - "index-allow-incomplete": false -} -``` - -Default values are overridden only if explicitly specified in the config. - -The parameters are as follows: - -**Transaction Indexing** - -### `index-transactions` (boolean) - -Enables AVM transaction indexing if set to `true`. Default value is `false`. -When set to `true`, AVM transactions are indexed against the `address` and -`assetID` involved. This data is available via `avm.getAddressTxs` -[API](/reference/avalanchego/x-chain/api.md#avmgetaddresstxs). - -:::note -If `index-transactions` is set to true, it must always be set to true -for the node's lifetime. If set to `false` after having been set to `true`, the -node will refuse to start unless `index-allow-incomplete` is also set to `true` -(see below). -::: - -### `index-allow-incomplete` (boolean) - -Allows incomplete indices. Default value is `false`. - -This config value is ignored if there is no X-Chain indexed data in the DB and -`index-transactions` is set to `false`. - ## Subnet Chain Configs As mentioned above, if a Subnet's chain id is diff --git a/docs/nodes/configure/p-chain-configs.md b/docs/nodes/configure/p-chain-configs.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/nodes/configure/x-chain-configs.md b/docs/nodes/configure/x-chain-configs.md new file mode 100644 index 00000000000..3d328a4a647 --- /dev/null +++ b/docs/nodes/configure/x-chain-configs.md @@ -0,0 +1,62 @@ +--- +tags: [Nodes, AvalancheGo] +description: Reference for all available X-chain config options and flags. +sidebar_label: X-Chain +pagination_label: X-Chain Configs +sidebar_position: 1 +--- + +# X-Chain Configs + +In order to specify a config for the X-Chain, a JSON config file should be +placed at `{chain-config-dir}/X/config.json`. + +For example if `chain-config-dir` has the default value which is +`$HOME/.avalanchego/configs/chains`, then `config.json` can be placed at +`$HOME/.avalanchego/configs/chains/X/config.json`. + +This allows you to specify a config to be passed into the X-Chain. The default +values for this config are: + +```json +{ + "index-transactions": false, + "index-allow-incomplete": false, + "checksums-enabled": false +} +``` + +Default values are overridden only if explicitly specified in the config. + +The parameters are as follows: + +## Transaction Indexing + +### `index-transactions` + +_Boolean_ + +Enables AVM transaction indexing if set to `true`. +When set to `true`, AVM transactions are indexed against the `address` and +`assetID` involved. This data is available via `avm.getAddressTxs` +[API](/reference/avalanchego/x-chain/api.md#avmgetaddresstxs). + +:::note +If `index-transactions` is set to true, it must always be set to true +for the node's lifetime. If set to `false` after having been set to `true`, the +node will refuse to start unless `index-allow-incomplete` is also set to `true` +(see below). +::: + +### `index-allow-incomplete` + +_Boolean_ + +Allows incomplete indices. This config value is ignored if there is no X-Chain indexed data in the DB and +`index-transactions` is set to `false`. + +### `checksums-enabled` + +_Boolean_ + +Enables checksums if set to `true`. From fe4974c530cc2c989a8a34eb58537f63b3299666 Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 25 Mar 2024 13:12:51 -0400 Subject: [PATCH 13/18] redirects --- .../build/dapp/advanced/integrate-exchange.md | 2 +- docs/build/dapp/launch-dapp.md | 10 +- .../subnet/deploy/fuji-testnet-subnet.md | 2 +- docs/build/subnet/deploy/on-prod-infra.md | 2 +- .../subnet/upgrade/customize-a-subnet.md | 10 +- .../subnet/upgrade/upgrade-precompile.md | 2 +- docs/deprecated/truffle.md | 2 +- docs/nodes/README.md | 74 ++-- .../C.md} | 386 ++++++++++-------- .../P.md} | 0 .../X.md} | 2 +- .../chain-configs/chain-config-flags.md | 77 ++++ docs/nodes/configure/p-chain-configs.md | 0 docs/nodes/maintain/run-offline-pruning.md | 2 +- .../advance-config-maintenance.md | 2 +- docs/reference/avalanchego/c-chain/api.md | 2 +- docs/tooling/avalanche-cli.md | 44 +- .../deploy-fuji-testnet-subnet.md | 2 +- docs/tooling/rpc-providers.md | 99 +++-- .../build/dapp/advanced/integrate-exchange.md | 2 +- .../current/build/dapp/launch-dapp.md | 4 +- .../smart-contracts/toolchains/truffle.md | 2 +- .../subnet/deploy/fuji-testnet-subnet.md | 2 +- .../build/subnet/deploy/on-prod-infra.md | 2 +- .../subnet/upgrade/customize-a-subnet.md | 4 +- .../subnet/upgrade/upgrade-precompile.md | 2 +- .../current/nodes/README.md | 12 +- .../nodes/maintain/run-offline-pruning.md | 2 +- .../advance-config-maintenance.md | 2 +- static/_redirects | 5 +- 30 files changed, 447 insertions(+), 312 deletions(-) rename docs/nodes/configure/{chain-config-flags.md => chain-configs/C.md} (76%) rename docs/nodes/configure/{c-chain-configs.md => chain-configs/P.md} (100%) rename docs/nodes/configure/{x-chain-configs.md => chain-configs/X.md} (98%) create mode 100644 docs/nodes/configure/chain-configs/chain-config-flags.md delete mode 100644 docs/nodes/configure/p-chain-configs.md diff --git a/docs/build/dapp/advanced/integrate-exchange.md b/docs/build/dapp/advanced/integrate-exchange.md index 580ae6495e9..f1b041046e5 100644 --- a/docs/build/dapp/advanced/integrate-exchange.md +++ b/docs/build/dapp/advanced/integrate-exchange.md @@ -46,7 +46,7 @@ a JSON file whose keys and values are option names and values. Individual chains, including the C-Chain, have their own configuration options which are separate from the node-level options. These can also be specified in a config file. For more details, see -[here](/nodes/configure/chain-config-flags.md#c-chain-configs). +[here](/nodes/configure/chain-configs/C.md). The C-Chain config file should be at `$HOME/.avalanchego/configs/chains/C/config.json`. You can also tell AvalancheGo diff --git a/docs/build/dapp/launch-dapp.md b/docs/build/dapp/launch-dapp.md index f310338d579..6cfc9c0f351 100644 --- a/docs/build/dapp/launch-dapp.md +++ b/docs/build/dapp/launch-dapp.md @@ -107,7 +107,7 @@ default values. On the other hand, you will most likely need to adjust C-Chain configuration to suit your intended use. You can look up complete configuration options for -C-Chain [here](/nodes/configure/chain-config-flags.md#c-chain-configs) as well +C-Chain [here](/nodes/configure/chain-configs/C.md) as well as the default configuration. Note that only the options that are different from their default values need to be included in the config file. @@ -169,7 +169,7 @@ APIs as well as default EVM APIs: } ``` -Default config values for the C-Chain can be seen [here](/nodes/configure/chain-config-flags.md#c-chain-configs). +Default config values for the C-Chain can be seen [here](/nodes/configure/chain-configs/C.md). ### Running a Local Test Network @@ -217,9 +217,9 @@ API](https://eth.wiki/json-rpc/API). For development purposes, you will need test tokens. Avalanche has a [Faucet](https://faucet.avax.network/) that drips test tokens to the address of -your choice. If you already have an AVAX balance greater than zero on Mainnet, -paste your C-Chain address there, and request test tokens. Otherwise, -please request a faucet coupon on +your choice. If you already have an AVAX balance greater than zero on Mainnet, +paste your C-Chain address there, and request test tokens. Otherwise, +please request a faucet coupon on [Guild](https://guild.xyz/avalanche). Admins and mods on the official [Discord](https://discord.com/invite/RwXY7P6) can provide testnet AVAX if developers are unable to obtain it from the other two options. diff --git a/docs/build/subnet/deploy/fuji-testnet-subnet.md b/docs/build/subnet/deploy/fuji-testnet-subnet.md index 6271ed394ad..9d59f5b82e3 100644 --- a/docs/build/subnet/deploy/fuji-testnet-subnet.md +++ b/docs/build/subnet/deploy/fuji-testnet-subnet.md @@ -90,7 +90,7 @@ The user is going to need this ID in the later section when calling [addValidato :::info With more data on `Fuji`, it may take a while to bootstrap `Fuji` Testnet from scratch. -You can use [State-Sync](/nodes/configure/chain-config-flags.md#state-sync-enabled-boolean) +You can use [State-Sync](/nodes/configure/chain-configs/C.md#state-sync-enabled-boolean) to shorten the time for bootstrapping. ::: diff --git a/docs/build/subnet/deploy/on-prod-infra.md b/docs/build/subnet/deploy/on-prod-infra.md index 8de4ff45b11..887d2619660 100755 --- a/docs/build/subnet/deploy/on-prod-infra.md +++ b/docs/build/subnet/deploy/on-prod-infra.md @@ -121,7 +121,7 @@ week, but there are ways to shorten that process, depending on your circumstance #### State Sync If the nodes you will be running as validators don't need to have the full transaction history, then -you can use [state sync](/nodes/configure/chain-config-flags.md#state-sync-enabled-boolean). With +you can use [state sync](/nodes/configure/chain-configs/C.md#state-sync-enabled-boolean). With this flag enabled, instead of replaying the whole history to get to the current state, nodes simply download only the current state from other network peers, shortening the bootstrap process from multiple days to a couple of hours. If the nodes will be used for Subnet validation exclusively, you diff --git a/docs/build/subnet/upgrade/customize-a-subnet.md b/docs/build/subnet/upgrade/customize-a-subnet.md index 3c4524ca9d2..cecdd340ce8 100644 --- a/docs/build/subnet/upgrade/customize-a-subnet.md +++ b/docs/build/subnet/upgrade/customize-a-subnet.md @@ -12,7 +12,7 @@ All Subnets can be customized by utilizing [`Subnet Configs`](#subnet-configs). A Subnet can have one or more blockchains. For example, the Primary Network, which is a Subnet, a special one nonetheless, has 3 blockchains. Each chain can be further customized using chain specific -configuration file. See [here](/nodes/configure/chain-config-flags.md) for detailed explanation. +configuration file. See [here](/nodes/configure/chain-configs/chain-config-flags.md) for detailed explanation. A blockchain created by or forked from [Subnet-EVM](https://github.com/ava-labs/subnet-evm) can be customized by utilizing one or more of the following methods: @@ -1140,14 +1140,14 @@ See every precompile initial configuration in their relevant `Initial Configurat ## AvalancheGo Chain Configs -As described in [this doc](/nodes/configure/chain-config-flags.md#subnet-chain-configs), each blockchain +As described in [this doc](/nodes/configure/chain-configs/chain-config-flags.md#subnet-chain-configs), each blockchain of Subnets can have its own custom configuration. If a Subnet's ChainID is `2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt`, the config file for this chain is located at `{chain-config-dir}/2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt/config.json`. For blockchains created by or forked from Subnet-EVM, most -[C-Chain configs](/nodes/configure/chain-config-flags.md#c-chain-configs) are applicable except -[Avalanche Specific APIs](/nodes/configure/chain-config-flags.md#enabling-avalanche-specific-apis). +[C-Chain configs](/nodes/configure/chain-configs/C.md) are applicable except +[Avalanche Specific APIs](/nodes/configure/chain-configs/C.md#enabling-avalanche-specific-apis). ### Priority Regossip @@ -1157,7 +1157,7 @@ a block after `priority-regossip-frequency` (defaults to `1m`). By default, up t Operators can use "priority regossip" to more aggressively "regossip" transactions for a set of important addresses (like bridge relayers). To do so, you'll need to update your -[chain config](/nodes/configure/chain-config-flags.md#subnet-chain-configs) with the following: +[chain config](/nodes/configure/chain-configs/chain-config-flags.md#subnet-chain-configs) with the following: ```json { diff --git a/docs/build/subnet/upgrade/upgrade-precompile.md b/docs/build/subnet/upgrade/upgrade-precompile.md index 2149b8bcbfe..1607d62a20e 100644 --- a/docs/build/subnet/upgrade/upgrade-precompile.md +++ b/docs/build/subnet/upgrade/upgrade-precompile.md @@ -427,7 +427,7 @@ To install the upgrade file on your validator: ****************************************************************************************************************** * Upgrades are tricky. The syntactic correctness of the upgrade file is important. * * The sequence of upgrades must be strictly observed. * - * Make sure you understand https://docs.avax.network/nodes/configure/chain-config-flags.md#subnet-chain-configs * + * Make sure you understand https://docs.avax.network/nodes/configure/chain-configs/chain-config-flags.md#subnet-chain-configs * * before applying upgrades manually. * ****************************************************************************************************************** ``` diff --git a/docs/deprecated/truffle.md b/docs/deprecated/truffle.md index 89653c78781..78294096e1b 100644 --- a/docs/deprecated/truffle.md +++ b/docs/deprecated/truffle.md @@ -308,7 +308,7 @@ etc... However this API is disabled by default. It can be activated with support activating this API. So if you want to use these features you need to run your own network manually with `internal-private-personal` API enabled via the `eth-apis` flag. See and -[C-Chain Configs](/nodes/configure/chain-config-flags.md#c-chain-configs). +[C-Chain Configs](/nodes/configure/chain-configs/C.md). ## Run Migrations diff --git a/docs/nodes/README.md b/docs/nodes/README.md index e5437438acc..5b59f2fee44 100644 --- a/docs/nodes/README.md +++ b/docs/nodes/README.md @@ -10,41 +10,39 @@ pagination_label: 🔗 Nodes Quick Links This section provides documents on how to build and maintain an AvalancheGo node, and then validate the Avalanche network using an AvalancheGo node. -| Run a Node | | -| :------------------------------------------------------- | :------------------------------------------ | -| [**Manually**](/nodes/run/node-manually.md) | Compile an Avalanche node from source and run it manually | -| [**Using the Install Script**](/nodes/run/with-installer/installing-avalanchego.md) | How to install and run AvalancheGo with the installer script | -| [**Run a Subnet Node**](/nodes/run/subnet-node.md) | How to run a Subnet node | -| [**Common Errors**](nodes/run/FAQ.md) | Learn about common errors when building your node | -| **Using a Third-Party Cloud Service** | | -| [**Amazon Web Services**](/nodes/run/third-party/aws-node.md) | Create a node that runs on AWS | -| [**AWS Marketplace: One Click Deployment**](nodes/run/third-party/aws-marketplace-one-click.md) | Deploy a node that runs on AWS via a one-click install | -| [**Microsoft Azure**](/nodes/run/third-party/microsoft-azure-node.md) | Create a node that runs on Microsoft Azure | -| [**Google Cloud Platform**](/nodes/run/third-party/google-cloud-node.md) | Create a node that runs on Google GCP | -| [**Alibaba Cloud**](/nodes/run/third-party/alibaba-cloud-node.md) | Create a node that runs on Alibaba Cloud | -| [**Tencent Cloud**](/nodes/run/third-party/tencent-cloud-node.md) | Create a node that runs on Tencent Cloud | -| [**Latitude**](/nodes/run/third-party/latitude-node.md) | Create a node that runs on Latitude.sh | - - -| Configure | | -| :------------------------------------------------------------------------------- | :---------------------------------------------------------- | -| [**AvalancheGo Configs and Flags**](/nodes/configure/avalanchego-config-flags.md) | This documents list all available configuration and flags for AvalancheGo | -| [**Chain Configs and Flags**](/nodes/configure/chain-config-flags.md) | Reference for all available chain config options and flags | -| [**Subnet Configs**](/nodes/configure/subnet-configs.md) | Reference for all available Subnet config options and flags | - - -| Validate | | -| :--------------------------------------------------- | :------------------------------------------------------------------------------------- | -| [**What is Staking?**](/nodes/validate/what-is-staking.md) | Explains the concept of staking | -| [**Key Differences Between Validation and Delegation**](/nodes/validate/validate-or-delegate.md) | This section details the difference between staking and delegating on Avalanche | -| [**How to Stake AVAX**](/nodes/validate/how-to-stake.md) | This section provides documents on how to stake AVAX on the Avalanche Network -| [**Add a Node as a Validator**](nodes/validate/add-a-validator.md) | Add a node as a validator to the [Primary Network](/learn/avalanche/avalanche-platform.md) | - -| Maintain | | -| :------------------------------------------------------------------------------- | :---------------------------------------------------------- | -| [**Node Bootstrapping: What to Expect**](/nodes/maintain/node-bootstrap.md) | Understand how a node bootstraps | -| [**Node Backup and Restore**](/nodes/maintain/node-backup-and-restore.md) | Back up important files to be able to restore your node | -| [**Monitor an Avalanche Node**](/nodes/maintain/setting-up-node-monitoring.md) | Set up infrastructure to monitor an instance of AvalancheGo | -| [**Upgrade Your AvalancheGo Node**](/nodes/maintain/upgrade-your-avalanchego-node.md) | How to upgrade your Avalanche node | -| [**Reduce Disk Usage by running C-Chain Offline Pruning**](/nodes/maintain/run-offline-pruning.md) | How to reduce the disk space used by AvalancheGo | -| [**Enroll A Node in Avalanche Notify**](/nodes/maintain/avalanche-notify.md) | To receive email alerts if a validator becomes unresponsive or out-of-date, sign up with the Avalanche Notify tool | +| Run a Node | | +| :---------------------------------------------------------------------------------------------- | :----------------------------------------------------------- | +| [**Manually**](/nodes/run/node-manually.md) | Compile an Avalanche node from source and run it manually | +| [**Using the Install Script**](/nodes/run/with-installer/installing-avalanchego.md) | How to install and run AvalancheGo with the installer script | +| [**Run a Subnet Node**](/nodes/run/subnet-node.md) | How to run a Subnet node | +| [**Common Errors**](nodes/run/FAQ.md) | Learn about common errors when building your node | +| **Using a Third-Party Cloud Service** | | +| [**Amazon Web Services**](/nodes/run/third-party/aws-node.md) | Create a node that runs on AWS | +| [**AWS Marketplace: One Click Deployment**](nodes/run/third-party/aws-marketplace-one-click.md) | Deploy a node that runs on AWS via a one-click install | +| [**Microsoft Azure**](/nodes/run/third-party/microsoft-azure-node.md) | Create a node that runs on Microsoft Azure | +| [**Google Cloud Platform**](/nodes/run/third-party/google-cloud-node.md) | Create a node that runs on Google GCP | +| [**Alibaba Cloud**](/nodes/run/third-party/alibaba-cloud-node.md) | Create a node that runs on Alibaba Cloud | +| [**Tencent Cloud**](/nodes/run/third-party/tencent-cloud-node.md) | Create a node that runs on Tencent Cloud | +| [**Latitude**](/nodes/run/third-party/latitude-node.md) | Create a node that runs on Latitude.sh | + +| Configure | | +| :---------------------------------------------------------------------------------- | :------------------------------------------------------------------------ | +| [**AvalancheGo Configs and Flags**](/nodes/configure/avalanchego-config-flags.md) | This documents list all available configuration and flags for AvalancheGo | +| [**Chain Configs and Flags**](/nodes/configure/chain-configs/chain-config-flags.md) | Reference for all available chain config options and flags | +| [**Subnet Configs**](/nodes/configure/subnet-configs.md) | Reference for all available Subnet config options and flags | + +| Validate | | +| :----------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------- | +| [**What is Staking?**](/nodes/validate/what-is-staking.md) | Explains the concept of staking | +| [**Key Differences Between Validation and Delegation**](/nodes/validate/validate-or-delegate.md) | This section details the difference between staking and delegating on Avalanche | +| [**How to Stake AVAX**](/nodes/validate/how-to-stake.md) | This section provides documents on how to stake AVAX on the Avalanche Network | +| [**Add a Node as a Validator**](nodes/validate/add-a-validator.md) | Add a node as a validator to the [Primary Network](/learn/avalanche/avalanche-platform.md) | + +| Maintain | | +| :------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------- | +| [**Node Bootstrapping: What to Expect**](/nodes/maintain/node-bootstrap.md) | Understand how a node bootstraps | +| [**Node Backup and Restore**](/nodes/maintain/node-backup-and-restore.md) | Back up important files to be able to restore your node | +| [**Monitor an Avalanche Node**](/nodes/maintain/setting-up-node-monitoring.md) | Set up infrastructure to monitor an instance of AvalancheGo | +| [**Upgrade Your AvalancheGo Node**](/nodes/maintain/upgrade-your-avalanchego-node.md) | How to upgrade your Avalanche node | +| [**Reduce Disk Usage by running C-Chain Offline Pruning**](/nodes/maintain/run-offline-pruning.md) | How to reduce the disk space used by AvalancheGo | +| [**Enroll A Node in Avalanche Notify**](/nodes/maintain/avalanche-notify.md) | To receive email alerts if a validator becomes unresponsive or out-of-date, sign up with the Avalanche Notify tool | diff --git a/docs/nodes/configure/chain-config-flags.md b/docs/nodes/configure/chain-configs/C.md similarity index 76% rename from docs/nodes/configure/chain-config-flags.md rename to docs/nodes/configure/chain-configs/C.md index 148637d5d33..6fe3120227e 100644 --- a/docs/nodes/configure/chain-config-flags.md +++ b/docs/nodes/configure/chain-configs/C.md @@ -1,64 +1,12 @@ --- tags: [Nodes] -description: Reference for all available chain config options and flags. -sidebar_label: Chain Configs -pagination_label: Chain Configs -sidebar_position: 1 +description: Reference for all available C-Chain config options and flags. +sidebar_label: C-Chain +pagination_label: C-Chain Configs +sidebar_position: 3 --- -# Chain Configs - -Some chains allow the node operator to provide a custom configuration. -AvalancheGo can read chain configurations from files and pass them to the -corresponding chains on initialization. - -AvalancheGo looks for these files in the directory specified by -`--chain-config-dir` AvalancheGo flag, as documented -[here](/nodes/configure/avalanchego-config-flags.md#--chain-config-dir-string). If omitted, value -defaults to `$HOME/.avalanchego/configs/chains`. This directory can have -sub-directories whose names are chain IDs or chain aliases. Each sub-directory -contains the configuration for the chain specified in the directory name. Each -sub-directory should contain a file named `config`, whose value is passed in -when the corresponding chain is initialized (see below for extension). For -example, config for the C-Chain should be at: -`{chain-config-dir}/C/config.json`. - -This also applies to Subnets, for example, if a Subnet's chain id is -`2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt`, the config for this chain -should be at -`{chain-config-dir}/2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt/config.json` - -:::tip - -By default, none of these directories and/or files exist. You would need to -create them manually if needed. - -::: - -The filename extension that these files should have, and the contents of these -files, is VM-dependent. For example, some chains may expect `config.txt` while -others expect `config.json`. If multiple files are provided with the same name -but different extensions (for example `config.json` and `config.txt`) in the same -sub-directory, AvalancheGo will exit with an error. - -For a given chain, AvalancheGo will follow the sequence below to look for its -config file, where all folder and file names are case sensitive: - -- First it looks for a config sub-directory whose name is the chain ID - If it - isn't found, it looks for a config sub-directory whose name is the chain's - primary alias - If it's not found, it looks for a config sub-directory whose - name is another alias for the chain - -Alternatively, for some setups it might be more convenient to provide config -entirely via the command line. For that, you can use AvalancheGo -`--chain-config-content` flag, as documented -[here](/nodes/configure/avalanchego-config-flags.md#--chain-config-content-string). - -It is not required to provide these custom configurations. If they are not -provided, a VM-specific default config will be used. And the values of these -default config are printed when the node starts. - -## C-Chain Configs +# C-Chain Configs In order to specify a config for the C-Chain, a JSON config file should be placed at `{chain-config-dir}/C/config.json`. This file does not exist by @@ -77,9 +25,11 @@ makes the config more resilient to future default changes. Otherwise, if defaults change, your node will remain with the old values, which might adversely affect your node operation. -### State Sync +## State Sync + +### `state-sync-enabled` -#### `state-sync-enabled` (boolean) +_Boolean_ Set to `true` to start the chain with state sync enabled. The peer will download chain state from peers up to a recent block near tip, then proceed with @@ -92,19 +42,25 @@ sync on subsequent runs. Please note that if you need historical data, state sync isn't the right option. However, it is sufficient if you are just running a validator. -#### `state-sync-skip-resume` (boolean) +### `state-sync-skip-resume` + +_Boolean_ If set to `true`, the chain will not resume a previously started state sync operation that did not complete. Normally, the chain should be able to resume state syncing without any issue. Defaults to `false`. -#### `state-sync-min-blocks` (int) +### `state-sync-min-blocks` + +_Integer_ Minimum number of blocks the chain should be ahead of the local node to prefer state syncing over bootstrapping. If the node's database is already close to the chain's tip, bootstrapping is more efficient. Defaults to `300000`. -#### `state-sync-ids` (string) +### `state-sync-ids` + +_String_ Comma separated list of node IDs (prefixed with `NodeID-`) to fetch state sync data from. An example setting of this field would be @@ -112,43 +68,57 @@ data from. An example setting of this field would be If not specified (or empty), peers are selected at random. Defaults to empty string (`""`). -#### `state-sync-server-trie-cache` (int) +### `state-sync-server-trie-cache` + +_Integer_ Size of trie cache used for providing state sync data to peers in MBs. Should be a multiple of `64`. Defaults to `64`. ### Continuous Profiling -#### `continuous-profiler-dir` (string) +### `continuous-profiler-dir` + +_String_ Enables the continuous profiler (captures a CPU/Memory/Lock profile at a specified interval). Defaults to `""`. If a non-empty string is provided, it enables the continuous profiler and specifies the directory to place the profiles in. -#### `continuous-profiler-frequency` (duration) +### `continuous-profiler-frequency` + +_Duration_ Specifies the frequency to run the continuous profiler. Defaults `900000000000` nano seconds which is 15 minutes. -#### `continuous-profiler-max-files` (int) +### `continuous-profiler-max-files` + +_Integer_ Specifies the maximum number of profiles to keep before removing the oldest. Defaults to `5`. ### Enabling Avalanche Specific APIs -#### `snowman-api-enabled` (boolean) +### `snowman-api-enabled` + +_Boolean_ Enables the Snowman API. Defaults to `false`. -#### `coreth-admin-api-enabled` (boolean) +### `coreth-admin-api-enabled` + +_Boolean_ Deprecated as of `v0.12.5`. Use `admin-api-enabled` instead. Enables the Admin API. Defaults to `false`. -#### `coreth-admin-api-dir` (string) +### `coreth-admin-api-dir` + +_String_ Deprecated as of `v0.12.5`. Use `admin-api-dir` instead. @@ -157,7 +127,7 @@ Defaults to `""`. ### Enabling EVM APIs -#### `eth-apis` ([]string) +### `eth-apis` ([]string) Use the `eth-apis` field to specify the exact set of below services to enable on your node. If this field is not set, then the default list will be: @@ -197,7 +167,7 @@ every service you wish to enable. ::: -#### `eth` +### `eth` The API name `public-eth` is deprecated as of v1.7.15, and the APIs previously under this name have been migrated to `eth`. @@ -207,7 +177,7 @@ Adds the following RPC calls to the `eth_*` namespace. Defaults to `true`. `eth_coinbase` `eth_etherbase` -#### `eth-filter` +### `eth-filter` The API name `public-eth-filter` is deprecated as of v1.7.15, and the APIs previously under this name have been migrated to `eth-filter`. @@ -229,7 +199,7 @@ complete documentation): - `eth_getFilterLogs` - `eth_getFilterChanges` -#### `admin` +### `admin` The API name `private-admin` is deprecated as of v1.7.15, and the APIs previously under this name have been migrated to `admin`. @@ -239,7 +209,7 @@ Adds the following RPC calls to the `admin_*` namespace. Defaults to `false`. - `admin_importChain` - `admin_exportChain` -#### `debug` +### `debug` The API names `private-debug` and `public-debug` are deprecated as of v1.7.15, and the APIs previously under these names have been migrated to `debug`. @@ -255,7 +225,7 @@ Adds the following RPC calls to the `debug_*` namespace. Defaults to `false`. - `debug_getModifiedAccountsByHash` - `debug_getAccessibleState` -#### `net` +### `net` Adds the following RPC calls to the `net_*` namespace. Defaults to `true`. @@ -268,7 +238,7 @@ networking layer, so `net_listening` always returns true and `net_peerCount` always returns 0. For accurate metrics on the network layer, users should use the AvalancheGo APIs. -#### `debug-tracer` +### `debug-tracer` Adds the following RPC calls to the `debug_*` namespace. Defaults to `false`. @@ -281,14 +251,14 @@ Adds the following RPC calls to the `debug_*` namespace. Defaults to `false`. - `debug_traceTransaction` - `debug_traceCall` -#### `web3` +### `web3` Adds the following RPC calls to the `web3_*` namespace. Defaults to `true`. - `web3_clientVersion` - `web3_sha3` -#### `internal-eth` +### `internal-eth` The API name `internal-public-eth` is deprecated as of v1.7.15, and the APIs previously under this name have been migrated to `internal-eth`. @@ -300,7 +270,7 @@ Adds the following RPC calls to the `eth_*` namespace. Defaults to `true`. - `eth_maxPriorityFeePerGas` - `eth_feeHistory` -#### `internal-blockchain` +### `internal-blockchain` The API name `internal-public-blockchain` is deprecated as of v1.7.15, and the APIs previously under this name have been migrated to `internal-blockchain`. @@ -326,7 +296,7 @@ Adds the following RPC calls to the `eth_*` namespace. Defaults to `true`. - `eth_estimateGas` - `eth_createAccessList` -#### `internal-transaction` +### `internal-transaction` The API name `internal-public-transaction-pool` is deprecated as of v1.7.15, and the APIs previously under this name have been migrated to @@ -352,7 +322,7 @@ Adds the following RPC calls to the `eth_*` namespace. Defaults to `true`. - `eth_pendingTransactions` - `eth_resend` -#### `internal-tx-pool` +### `internal-tx-pool` The API name `internal-public-tx-pool` is deprecated as of v1.7.15, and the APIs previously under this name have been migrated to `internal-tx-pool`. @@ -364,7 +334,7 @@ Adds the following RPC calls to the `txpool_*` namespace. Defaults to `false`. - `txpool_status` - `txpool_inspect` -#### `internal-debug` +### `internal-debug` The API names `internal-private-debug` and `internal-public-debug` are deprecated as of v1.7.15, and the APIs previously under these names have been @@ -378,7 +348,7 @@ Adds the following RPC calls to the `debug_*` namespace. Defaults to `false`. - `debug_chaindbProperty` - `debug_chaindbCompact` -#### `debug-handler` +### `debug-handler` Adds the following RPC calls to the `debug_*` namespace. Defaults to `false`. @@ -398,7 +368,7 @@ Adds the following RPC calls to the `debug_*` namespace. Defaults to `false`. - `debug_freeOSMemory` - `debug_setGCPercent` -#### `internal-account` +### `internal-account` The API name `internal-public-account` is deprecated as of v1.7.15, and the APIs previously under this name have been migrated to `internal-account`. @@ -407,7 +377,7 @@ Adds the following RPC calls to the `eth_*` namespace. Defaults to `true`. - `eth_accounts` -#### `internal-personal` +### `internal-personal` The API name `internal-private-personal` is deprecated as of v1.7.15, and the APIs previously under this name have been migrated to `internal-personal`. @@ -432,91 +402,125 @@ Adds the following RPC calls to the `personal_*` namespace. Defaults to `false`. ### API Configuration -#### `rpc-gas-cap` (int) +### `rpc-gas-cap` + +_Integer_ The maximum gas to be consumed by an RPC Call (used in `eth_estimateGas` and `eth_call`). Defaults to `50,000,000`. -#### `rpc-tx-fee-cap` (int) +### `rpc-tx-fee-cap` + +_Integer_ Global transaction fee (price \* `gaslimit`) cap (measured in AVAX) for send-transaction variants. Defaults to `100`. -#### `api-max-duration` (duration) +### `api-max-duration` + +_Duration_ Maximum API call duration. If API calls exceed this duration, they will time out. Defaults to `0` (no maximum). -#### `api-max-blocks-per-request` (int) +### `api-max-blocks-per-request` + +_Integer_ Maximum number of blocks to serve per `getLogs` request. Defaults to `0` (no maximum). -#### `ws-cpu-refill-rate` (duration) +### `ws-cpu-refill-rate` + +_Duration_ The refill rate specifies the maximum amount of CPU time to allot a single connection per second. Defaults to no maximum (`0`). -#### `ws-cpu-max-stored` (duration) +### `ws-cpu-max-stored` + +_Duration_ Specifies the maximum amount of CPU time that can be stored for a single WS connection. Defaults to no maximum (`0`). -#### `allow-unfinalized-queries` (boolean) +### `allow-unfinalized-queries` Allows queries for unfinalized (not yet accepted) blocks/transactions. Defaults to `false`. -#### `accepted-cache-size` `(int) +### `accepted-cache-size` + +_Integer_ Specifies the depth to keep accepted headers and accepted logs in the cache. This is particularly useful to improve the performance of `eth_getLogs` for recent logs. -### Transaction Pool +## Transaction Pool + +### `local-txs-enabled` -#### `local-txs-enabled` (boolean) +_Boolean_ Enables local transaction handling (prioritizes transactions submitted through this node). Defaults to `false`. -#### `allow-unprotected-txs` (boolean) +### `allow-unprotected-txs` + +_Boolean_ If `true`, the APIs will allow transactions that are not replay protected (EIP-155) to be issued through this node. Defaults to `false`. -#### `allow-unprotected-tx-hashes` ([]TxHash) +### `allow-unprotected-tx-hashes` + +_[]TxHash_ Specifies an array of transaction hashes that should be allowed to bypass replay protection. This flag is intended for node operators that want to explicitly allow specific transactions to be issued through their API. Defaults to an empty list. -#### `push-gossip-num-validators` (int) +### `push-gossip-num-validators` + +_Integer_ Number of validators to initially send transactions received over the RPC. Defaults to 100. -#### `push-gossip-num-peers` (int) +### `push-gossip-num-peers` + +_Integer_ Number of peers to initially send transactions received over the RPC. Defaults to 0. -#### `push-regossip-num-validators` (int) +### `push-regossip-num-validators` + +_Integer_ Number of validators to periodically send transactions received over the RPC. Defaults to 10. -#### `push-regossip-num-peers` (int) +### `push-regossip-num-peers` + +_Integer_ Number of peers to periodically send transactions received over the RPC. Defaults to 0. -#### `push-gossip-frequency` (duration) +### `push-gossip-frequency` + +_Duration_ Frequency to send transactions received over the RPC to peers. Defaults to `100000000` nano seconds which is 100 milliseconds. -#### `pull-gossip-frequency` (duration) +### `pull-gossip-frequency` + +_Duration_ Frequency to request transactions from peers. Defaults to `1000000000` nano seconds which is 1 second. -#### `tx-regossip-frequency` (duration) +### `tx-regossip-frequency` + +_Duration_ Deprecated as of `v0.12.5`. Use `regossip-frequency` instead. @@ -524,134 +528,186 @@ Amount of time that should elapse before we attempt to re-gossip a transaction that was already gossiped once. Defaults to `30000000000` nano seconds which is 30 seconds. -#### `tx-pool-price-limit` (int) +### `tx-pool-price-limit` + +_Integer_ Minimum gas price to enforce for acceptance into the pool. Defaults to 1 wei. -#### `tx-pool-price-bump` (int) +### `tx-pool-price-bump` + +_Integer_ Minimum price bump percentage to replace an already existing transaction (nonce). Defaults to 10%. -#### `tx-pool-account-slots` (int) +### `tx-pool-account-slots` + +_Integer_ Number of executable transaction slots guaranteed per account. Defaults to 16. -#### `tx-pool-global-slots` (int) +### `tx-pool-global-slots` + +_Integer_ Maximum number of executable transaction slots for all accounts. Defaults to 5120. -#### `tx-pool-account-queue` (int) +### `tx-pool-account-queue` + +_Integer_ Maximum number of non-executable transaction slots permitted per account. Defaults to 64. -#### `tx-pool-global-queue` (int) +### `tx-pool-global-queue` + +_Integer_ Maximum number of non-executable transaction slots for all accounts. Defaults to 1024. -#### `tx-pool-lifetime` (duration) +### `tx-pool-lifetime` + +_Duration_ Maximum duration a non-executable transaction will be allowed in the poll. Defaults to `600000000000` nano seconds which is 10 minutes. ### Metrics -#### `metrics-enabled` (boolean) +### `metrics-enabled` + +_Boolean_ Enables metrics. Defaults to `false`. -#### `metrics-expensive-enabled` (boolean) +### `metrics-expensive-enabled` + +_Boolean_ Enables expensive metrics. Defaults to `false`. ### Snapshots -#### `snapshot-async` (boolean) +### `snapshot-async` + +_Boolean_ If `true`, allows snapshot generation to be executed asynchronously. Defaults to `true`. -#### `snapshot-verification-enabled` (boolean) +### `snapshot-verification-enabled` + +_Boolean_ If `true`, verifies the complete snapshot after it has been generated. Defaults to `false`. -### Logging +## Logging + +### `log-level` -#### `log-level` (string) +_String_ Defines the log level for the chain. Must be one of `"trace"`, `"debug"`, `"info"`, `"warn"`, `"error"`, `"crit"`. Defaults to `"info"`. -#### `log-json-format` (bool) +### `log-json-format` + +_Boolean_ If `true`, changes logs to JSON format. Defaults to `false`. ### Keystore Settings -#### `keystore-directory` (string) +### `keystore-directory` + +_String_ The directory that contains private keys. Can be given as a relative path. If empty, uses a temporary directory at `coreth-keystore`. Defaults to the empty string (`""`). -#### `keystore-external-signer` (string) +### `keystore-external-signer` + +_String_ Specifies an external URI for a clef-type signer. Defaults to the empty string (`""` as not enabled). -#### `keystore-insecure-unlock-allowed` (bool) +### `keystore-insecure-unlock-allowed` + +_Boolean_ If `true`, allow users to unlock accounts in unsafe HTTP environment. Defaults to `false`. ### Database -#### `trie-clean-cache` (int) +### `trie-clean-cache` + +_Integer_ Size of cache used for clean trie nodes (in MBs). Should be a multiple of `64`. Defaults to `512`. -#### `trie-dirty-cache` (int) +### `trie-dirty-cache` + +_Integer_ Size of cache used for dirty trie nodes (in MBs). When the dirty nodes exceed this limit, they are written to disk. Defaults to `256`. -#### `trie-dirty-commit-target` (int) +### `trie-dirty-commit-target` + +_Integer_ Memory limit to target in the dirty cache before performing a commit (in MBs). Defaults to `20`. -#### `trie-prefetcher-parallelism` (int) +### `trie-prefetcher-parallelism` + +_Integer_ Max concurrent disk reads trie pre-fetcher should perform at once. Defaults to `16`. -#### `snapshot-cache` (int) +### `snapshot-cache` + +_Integer_ Size of the snapshot disk layer clean cache (in MBs). Should be a multiple of `64`. Defaults to `256`. -#### `trie-clean-journal` (string) +### `trie-clean-journal` + +_String_ Directory to use to save the trie clean cache (must be populated to enable journaling the trie clean cache). Empty and disabled by default. -#### `trie-clean-rejournal` (duration) +### `trie-clean-rejournal` + +_Duration_ Frequency to re-journal the trie clean cache to disk (minimum 1 minute, must be populated to enable journaling the trie clean cache). -#### `acceptor-queue-limit` (int) +### `acceptor-queue-limit` + +_Integer_ Specifies the maximum number of blocks to queue during block acceptance before blocking on Accept. Defaults to `64`. -#### `commit-interval` (int) +### `commit-interval` + +_Integer_ Specifies the commit interval at which to persist the merkle trie to disk. Defaults to `4096`. -#### `pruning-enabled` (boolean) +### `pruning-enabled` + +_Boolean_ If `true`, database pruning of obsolete historical data will be enabled. This reduces the amount of data written to disk, but does not delete any state that is written to the disk previously. @@ -671,7 +727,9 @@ true`, `allow-missing-tries` should be set to `true` as well. ::: -#### `populate-missing-tries` (\*uint64) +### `populate-missing-tries` + +_uint64_ If non-nil, sets the starting point for repopulating missing tries to re-generate archival merkle forest. @@ -684,21 +742,29 @@ This flag should be used once to re-generate the archival merkle forest and should be removed from the config after completion. This flag will cause the node to delay starting up while it re-processes old blocks. -#### `populate-missing-tries-parallelism` (int) +### `populate-missing-tries-parallelism` + +_Integer_ Number of concurrent readers to use when re-populating missing tries on startup. Defaults to 1024. -#### `allow-missing-tries` (boolean) +### `allow-missing-tries` + +_Boolean_ If `true`, allows a node that was once configured as archival to switch to pruning mode. Defaults to `false`. -#### `preimages-enabled` (boolean) +### `preimages-enabled` + +_Boolean_ If `true`, enables preimages. Defaults to `false`. -#### `offline-pruning-enabled` (boolean) +### `offline-pruning-enabled` + +_Boolean_ If `true`, offline pruning will run on startup and block until it completes (approximately one hour on Mainnet). This will reduce the size of the database @@ -715,7 +781,9 @@ This is meant to be run manually, so after running with this flag once, it must be toggled back to false before running the node again. Therefore, you should run with this flag set to true and then set it to false on the subsequent run. -#### `offline-pruning-bloom-filter-size` (int) +### `offline-pruning-bloom-filter-size` + +_Integer_ This flag sets the size of the bloom filter to use in offline pruning (denominated in MB and defaulting to 512 MB). The bloom filter is kept in memory @@ -729,35 +797,45 @@ false positive rate, which can impact the results of offline pruning. This is an advanced parameter that has been tuned to 512 MB and should not be changed without thoughtful consideration. -#### `offline-pruning-data-directory` (string) +### `offline-pruning-data-directory` + +_String_ This flag must be set when offline pruning is enabled and sets the directory that offline pruning will use to write its bloom filter to disk. This directory should not be changed in between runs until offline pruning has completed. -#### `tx-lookup-limit` (uint64) +### `tx-lookup-limit` (uint64) Number of recent blocks for which to maintain transaction lookup indices in the database. If set to 0, transaction lookup indices will be maintained for all blocks. Defaults to `0`. -#### `skip-tx-indexing` (bool) +### `skip-tx-indexing` + +_Boolean_ If set to `true`, the node will not index transactions. TxLookupLimit can be still used to control deleting old transaction indices. Defaults to `false`. ### VM Networking -#### `max-outbound-active-requests` (int) +### `max-outbound-active-requests` + +_Integer_ Specifies the maximum number of outbound VM2VM requests in flight at once. Defaults to `16`. -#### `max-outbound-active-cross-chain-requests` (int) +### `max-outbound-active-cross-chain-requests` + +_Integer_ Specifies the maximum number of outbound cross-chain requests in flight at once. Defaults to `64`. ### Miscellaneous -#### `airdrop` (string) +### `airdrop` + +_String_ Path to a json file that contains a list of addresses for a genesis airdrop. Each address will be airdropped `AirdropAmount` at genesis, and the hash of the @@ -765,27 +843,11 @@ airdrop file must match `AirdropHash`. `AirdropAmount` and `AirdropHash` are part of the genesis config. This option applies to `subnet-evm` only (not applicable to `coreth`). -#### `skip-upgrade-check` (bool) +### `skip-upgrade-check` + +_Boolean_ If set to `true`, the chain will skip verifying that all expected network upgrades have taken place before the last accepted block on startup. This allows node operators to recover if their node has accepted blocks after a network upgrade with a version of the code prior to the upgrade. Defaults to `false`. - -## Subnet Chain Configs - -As mentioned above, if a Subnet's chain id is -`2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt`, the config for this chain -should be at -`{chain-config-dir}/2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt/config.json` - -## FAQ - -- When using `getBlockNumber` it will return finalized blocks. To allow for queries - for unfinalized (not yet accepted) blocks/transactions use `allow-unfainalized-queries` - and set to true (by default it is set to `false`) - -- When deactivating offline pruning `(pruning-enabled: false)` from previously - enabled state, this will not impact blocks whose state was already pruned. This will - return missing trie node errors, as the node can't lookup the state of a historical - block if that state was deleted. diff --git a/docs/nodes/configure/c-chain-configs.md b/docs/nodes/configure/chain-configs/P.md similarity index 100% rename from docs/nodes/configure/c-chain-configs.md rename to docs/nodes/configure/chain-configs/P.md diff --git a/docs/nodes/configure/x-chain-configs.md b/docs/nodes/configure/chain-configs/X.md similarity index 98% rename from docs/nodes/configure/x-chain-configs.md rename to docs/nodes/configure/chain-configs/X.md index 3d328a4a647..4a0247c0b3e 100644 --- a/docs/nodes/configure/x-chain-configs.md +++ b/docs/nodes/configure/chain-configs/X.md @@ -3,7 +3,7 @@ tags: [Nodes, AvalancheGo] description: Reference for all available X-chain config options and flags. sidebar_label: X-Chain pagination_label: X-Chain Configs -sidebar_position: 1 +sidebar_position: 2 --- # X-Chain Configs diff --git a/docs/nodes/configure/chain-configs/chain-config-flags.md b/docs/nodes/configure/chain-configs/chain-config-flags.md new file mode 100644 index 00000000000..8ff54f929e8 --- /dev/null +++ b/docs/nodes/configure/chain-configs/chain-config-flags.md @@ -0,0 +1,77 @@ +--- +tags: [Nodes] +description: Reference for all available chain config options and flags. +sidebar_label: Chain Configs +pagination_label: Chain Configs +sidebar_position: 0 +--- + +# Chain Configs + +Some chains allow the node operator to provide a custom configuration. +AvalancheGo can read chain configurations from files and pass them to the +corresponding chains on initialization. + +AvalancheGo looks for these files in the directory specified by +`--chain-config-dir` AvalancheGo flag, as documented +[here](/nodes/configure/avalanchego-config-flags.md#--chain-config-dir-string). If omitted, value +defaults to `$HOME/.avalanchego/configs/chains`. This directory can have +sub-directories whose names are chain IDs or chain aliases. Each sub-directory +contains the configuration for the chain specified in the directory name. Each +sub-directory should contain a file named `config`, whose value is passed in +when the corresponding chain is initialized (see below for extension). For +example, config for the C-Chain should be at: +`{chain-config-dir}/C/config.json`. + +This also applies to Subnets, for example, if a Subnet's chain id is +`2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt`, the config for this chain +should be at +`{chain-config-dir}/2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt/config.json` + +:::tip + +By default, none of these directories and/or files exist. You would need to +create them manually if needed. + +::: + +The filename extension that these files should have, and the contents of these +files, is VM-dependent. For example, some chains may expect `config.txt` while +others expect `config.json`. If multiple files are provided with the same name +but different extensions (for example `config.json` and `config.txt`) in the same +sub-directory, AvalancheGo will exit with an error. + +For a given chain, AvalancheGo will follow the sequence below to look for its +config file, where all folder and file names are case sensitive: + +- First it looks for a config sub-directory whose name is the chain ID - If it + isn't found, it looks for a config sub-directory whose name is the chain's + primary alias - If it's not found, it looks for a config sub-directory whose + name is another alias for the chain + +Alternatively, for some setups it might be more convenient to provide config +entirely via the command line. For that, you can use AvalancheGo +`--chain-config-content` flag, as documented +[here](/nodes/configure/avalanchego-config-flags.md#--chain-config-content-string). + +It is not required to provide these custom configurations. If they are not +provided, a VM-specific default config will be used. And the values of these +default config are printed when the node starts. + +## Subnet Chain Configs + +As mentioned above, if a Subnet's chain id is +`2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt`, the config for this chain +should be at +`{chain-config-dir}/2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt/config.json` + +## FAQ + +- When using `getBlockNumber` it will return finalized blocks. To allow for queries + for unfinalized (not yet accepted) blocks/transactions use `allow-unfainalized-queries` + and set to true (by default it is set to `false`) + +- When deactivating offline pruning `(pruning-enabled: false)` from previously + enabled state, this will not impact blocks whose state was already pruned. This will + return missing trie node errors, as the node can't lookup the state of a historical + block if that state was deleted. diff --git a/docs/nodes/configure/p-chain-configs.md b/docs/nodes/configure/p-chain-configs.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/nodes/maintain/run-offline-pruning.md b/docs/nodes/maintain/run-offline-pruning.md index fb66925ca28..3c32d16f316 100644 --- a/docs/nodes/maintain/run-offline-pruning.md +++ b/docs/nodes/maintain/run-offline-pruning.md @@ -44,7 +44,7 @@ The default location of the C-Chain config file is `~/.avalanchego/configs/chains/C/config.json`. **Please note that by default, this file does not exist. You would need to create it manually.** You can update the directory for chain configs by passing in the directory of your choice via -the CLI argument: `chain-config-dir`. See [this](/nodes/configure/chain-config-flags.md) for more +the CLI argument: `chain-config-dir`. See [this](/nodes/configure/chain-configs/chain-config-flags.md) for more info. For example, if you start your node with: ```zsh diff --git a/docs/nodes/run/with-installer/advance-config-maintenance.md b/docs/nodes/run/with-installer/advance-config-maintenance.md index 4a19061768f..892088f2b50 100644 --- a/docs/nodes/run/with-installer/advance-config-maintenance.md +++ b/docs/nodes/run/with-installer/advance-config-maintenance.md @@ -101,7 +101,7 @@ in the example above. The script also creates an empty C-Chain config file, located at `~/.avalanchego/configs/chains/C/config.json`. By editing that file, you can configure the C-Chain, as described in detail -[here](/nodes/configure/chain-config-flags.md). +[here](/nodes/configure/chain-configs/chain-config-flags.md). ## Using a Previous Version diff --git a/docs/reference/avalanchego/c-chain/api.md b/docs/reference/avalanchego/c-chain/api.md index 81b4bc1065f..1d0a919dd27 100644 --- a/docs/reference/avalanchego/c-chain/api.md +++ b/docs/reference/avalanchego/c-chain/api.md @@ -898,7 +898,7 @@ curl -X POST --data '{ ## Admin API This API can be used for debugging. Note that the Admin API is disabled by default. To run a node -with the Admin API enabled, use [C-Chain config flag`--coreth-admin-api-enabled:true`](/nodes/configure/chain-config-flags.md#coreth-admin-api-enabled-boolean). +with the Admin API enabled, use [C-Chain config flag`--coreth-admin-api-enabled:true`](/nodes/configure/chain-configs/chain-config-flags.md#coreth-admin-api-enabled-boolean). ### Endpoint diff --git a/docs/tooling/avalanche-cli.md b/docs/tooling/avalanche-cli.md index 9fef6c938c0..33f085a503a 100644 --- a/docs/tooling/avalanche-cli.md +++ b/docs/tooling/avalanche-cli.md @@ -1,11 +1,11 @@ --- tags: [Tooling, Avalanche-CLI] -description: Avalanche-CLI is a command-line tool that gives developers access to everything Avalanche. This release specializes in helping developers build and test Subnets. +description: Avalanche-CLI is a command-line tool that gives developers access to everything Avalanche. This release specializes in helping developers build and test Subnets. pagination_label: Avalanche-CLI sidebar_postion: 0 --- -# Avalanche-CLI +# Avalanche-CLI Avalanche-CLI is a command-line tool that gives developers access to everything Avalanche. This release specializes in helping developers @@ -18,17 +18,16 @@ in with `avalanche subnet create myNewSubnet`. ## Primary -The `primary` command suite provides a collection of tools for interacting with the Avalanche +The `primary` command suite provides a collection of tools for interacting with the Avalanche Primary Network. - ### Primary AddValidator The `primary addValidator` command adds an Avalanche node as a validator in the Avalanche Primary Network with [AddPermissionlessValidatorTx](/reference/standards/guides/banff-changes.md#addpermissionlessvalidatortx). This command requires the node's BLS key and proof of possession key, more information regarding BLS -can be found [here](/reference/avalanchego/p-chain/txn-format.md#proof-of-possession). +can be found [here](/reference/avalanchego/p-chain/txn-format.md#proof-of-possession). To get a node's BLS key and proof of possession key, call info.getNodeID API as shown [here](/reference/avalanchego/info-api.md#infogetnodeid) @@ -406,8 +405,6 @@ avalanche subnet import public [subnetPath] [flags] - - ### Subnet Join The `subnet join` command configures your validator node to begin validating a new Subnet. @@ -522,7 +519,7 @@ The `subnet vmid` command prints the virtual machine ID (VMID) for the given Sub avalanche subnet vmid [subnetName] ``` -## Elastic Subnet +## Elastic Subnet ### Transforms permissioned Subnet into Elastic Subnet @@ -625,7 +622,7 @@ necessary instructions to upgrade your node manually. After you update your validator's configuration, you need to restart your validator manually. If you provide the `--avalanchego-chain-config-dir` flag, this command attempts to write the upgrade file -at that path. Refer to [this doc](/nodes/configure/chain-config-flags.md#subnet-chain-configs) for +at that path. Refer to [this doc](/nodes/configure/chain-configs/chain-config-flags.md#subnet-chain-configs) for related documentation. **Usage:** @@ -739,11 +736,11 @@ avalanche subnet upgrade export [subnetName] [flags] ## Node -The `node` command suite provides a collection of tools for creating and maintaining +The `node` command suite provides a collection of tools for creating and maintaining validators on the Avalanche Network. To get started, use the node create command wizard to walk through the -configuration to make your node a primary validator on Avalanche public network. You can use the +configuration to make your node a primary validator on Avalanche public network. You can use the rest of the commands to maintain your node and make your node a Subnet Validator. ### Node Create @@ -754,15 +751,15 @@ rest of the commands to maintain your node and make your node a Subnet Validator ::: -The `node create` command sets up a validator on a cloud server of your choice. -The validator will be validating the Avalanche Primary Network and Subnet -of your choice. By default, the command runs an interactive wizard. It +The `node create` command sets up a validator on a cloud server of your choice. +The validator will be validating the Avalanche Primary Network and Subnet +of your choice. By default, the command runs an interactive wizard. It walks you through all the steps you need to set up a validator. Validators can be deployed in multiple regions/zones simultaneously. Once this command is run, you will have to wait for the validator to finish bootstrapping on the primary network before running further commands on it, for example validating a Subnet. You can check the bootstrapping -status by running `avalanche node status`. +status by running `avalanche node status`. The created node will be part of group of validators called `` and users can call node commands with `` so that the command @@ -918,7 +915,6 @@ The `node list` command lists all clusters together with their nodes. The `node ssh` command execute a given command using ssh on all nodes in the cluster. If no command is given, just prints the ssh command line to be used to connect to each node. - **Usage:** ```shell @@ -939,7 +935,7 @@ If no command is given, just prints the ssh command line to be used to connect t ::: -The `node status` command gets the bootstrap status of all nodes in a cluster +The `node status` command gets the bootstrap status of all nodes in a cluster with the Primary Network. If no cluster is given, defaults to node list behaviour. @@ -992,7 +988,7 @@ Note that a stopped node may still incur cloud server storage fees. ::: -The `node sync` command enables all nodes in a cluster to be bootstrapped to a Subnet. +The `node sync` command enables all nodes in a cluster to be bootstrapped to a Subnet. You can check the Subnet bootstrap status by calling avalanche `node status --subnet ` **Usage:** @@ -1053,7 +1049,7 @@ You can check the updated Subnet bootstrap status by calling avalanche The `node validate` command suite provides a collection of commands for nodes to join the Primary Network and Subnets as validators. -If any of the commands is run before the nodes are bootstrapped on the Primary Network, the command +If any of the commands is run before the nodes are bootstrapped on the Primary Network, the command will fail. You can check the bootstrap status by calling `avalanche node status `. ### Node Validate Primary @@ -1097,9 +1093,9 @@ Network. The `node validate subnet` command enables all nodes in a cluster to be validators of a Subnet. If the command is run before the nodes are Primary Network validators, the command will first -make the nodes Primary Network validators before making them Subnet validators. +make the nodes Primary Network validators before making them Subnet validators. If The command is run before the nodes are bootstrapped on the Primary Network, the command -will fail. +will fail. You can check the bootstrap status by calling `avalanche node status `. If The command is run before the nodes are synced to the Subnet, the command will fail. You can check the Subnet sync status by calling `avalanche node status --subnet `. @@ -1139,10 +1135,10 @@ You can check the Subnet sync status by calling `avalanche node status Date: Mon, 25 Mar 2024 13:29:12 -0400 Subject: [PATCH 14/18] links and redirects --- docs/build/subnet/deploy/fuji-testnet-subnet.md | 2 +- docs/build/subnet/deploy/on-prod-infra.md | 2 +- docs/reference/avalanchego/c-chain/api.md | 2 +- .../cli-create-deploy-subnets/deploy-fuji-testnet-subnet.md | 2 +- .../current/build/subnet/deploy/fuji-testnet-subnet.md | 2 +- .../current/build/subnet/deploy/on-prod-infra.md | 2 +- .../current/nodes/configure/avalanchego-config-flags.md | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/build/subnet/deploy/fuji-testnet-subnet.md b/docs/build/subnet/deploy/fuji-testnet-subnet.md index 9d59f5b82e3..ed60e8ae9a1 100644 --- a/docs/build/subnet/deploy/fuji-testnet-subnet.md +++ b/docs/build/subnet/deploy/fuji-testnet-subnet.md @@ -90,7 +90,7 @@ The user is going to need this ID in the later section when calling [addValidato :::info With more data on `Fuji`, it may take a while to bootstrap `Fuji` Testnet from scratch. -You can use [State-Sync](/nodes/configure/chain-configs/C.md#state-sync-enabled-boolean) +You can use [State-Sync](/nodes/configure/chain-configs/C.md#state-sync-enabled) to shorten the time for bootstrapping. ::: diff --git a/docs/build/subnet/deploy/on-prod-infra.md b/docs/build/subnet/deploy/on-prod-infra.md index 887d2619660..01518a7d3e3 100755 --- a/docs/build/subnet/deploy/on-prod-infra.md +++ b/docs/build/subnet/deploy/on-prod-infra.md @@ -121,7 +121,7 @@ week, but there are ways to shorten that process, depending on your circumstance #### State Sync If the nodes you will be running as validators don't need to have the full transaction history, then -you can use [state sync](/nodes/configure/chain-configs/C.md#state-sync-enabled-boolean). With +you can use [state sync](/nodes/configure/chain-configs/C.md#state-sync-enabled). With this flag enabled, instead of replaying the whole history to get to the current state, nodes simply download only the current state from other network peers, shortening the bootstrap process from multiple days to a couple of hours. If the nodes will be used for Subnet validation exclusively, you diff --git a/docs/reference/avalanchego/c-chain/api.md b/docs/reference/avalanchego/c-chain/api.md index 1d0a919dd27..0d5c1e05943 100644 --- a/docs/reference/avalanchego/c-chain/api.md +++ b/docs/reference/avalanchego/c-chain/api.md @@ -898,7 +898,7 @@ curl -X POST --data '{ ## Admin API This API can be used for debugging. Note that the Admin API is disabled by default. To run a node -with the Admin API enabled, use [C-Chain config flag`--coreth-admin-api-enabled:true`](/nodes/configure/chain-configs/chain-config-flags.md#coreth-admin-api-enabled-boolean). +with the Admin API enabled, use [C-Chain config flag`--coreth-admin-api-enabled:true`](/nodes/configure/chain-configs/C.md#coreth-admin-api-enabled). ### Endpoint diff --git a/docs/tooling/cli-create-deploy-subnets/deploy-fuji-testnet-subnet.md b/docs/tooling/cli-create-deploy-subnets/deploy-fuji-testnet-subnet.md index f2ec4ddd74d..14d8f7a7837 100644 --- a/docs/tooling/cli-create-deploy-subnets/deploy-fuji-testnet-subnet.md +++ b/docs/tooling/cli-create-deploy-subnets/deploy-fuji-testnet-subnet.md @@ -86,7 +86,7 @@ The user is going to need this ID in the later section when calling [addValidato :::info With more data on `Fuji`, it may take a while to bootstrap `Fuji` Testnet from scratch. -You can use [State-Sync](/nodes/configure/chain-configs/C.md#state-sync-enabled-boolean) +You can use [State-Sync](/nodes/configure/chain-configs/C.md#state-sync-enabled) to shorten the time for bootstrapping. ::: diff --git a/i18n/es/docusaurus-plugin-content-docs/current/build/subnet/deploy/fuji-testnet-subnet.md b/i18n/es/docusaurus-plugin-content-docs/current/build/subnet/deploy/fuji-testnet-subnet.md index 163caae2f46..1773e6c1a73 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/build/subnet/deploy/fuji-testnet-subnet.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/build/subnet/deploy/fuji-testnet-subnet.md @@ -90,7 +90,7 @@ El usuario va a necesitar este ID en la sección posterior al llamar a addValida :::info Con más datos en `Fuji`, puede llevar tiempo inicializar la Testnet `Fuji` desde cero. -Puedes usar [State-Sync](/nodes/configure/chain-configs/C.md#state-sync-enabled-boolean) +Puedes usar [State-Sync](/nodes/configure/chain-configs/C.md#state-sync-enabled) para acortar el tiempo de inicialización. ::: diff --git a/i18n/es/docusaurus-plugin-content-docs/current/build/subnet/deploy/on-prod-infra.md b/i18n/es/docusaurus-plugin-content-docs/current/build/subnet/deploy/on-prod-infra.md index a2991129169..3646efc7f8b 100755 --- a/i18n/es/docusaurus-plugin-content-docs/current/build/subnet/deploy/on-prod-infra.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/build/subnet/deploy/on-prod-infra.md @@ -118,7 +118,7 @@ semana, pero hay formas de acortar ese proceso, dependiendo de tus circunstancia #### Sincronización de Estado Si los nodos que ejecutarás como validadores no necesitan tener todo el historial de transacciones, entonces -puedes usar [sincronización de estado](/nodes/configure/chain-configs/C.md#state-sync-enabled-boolean). Con +puedes usar [sincronización de estado](/nodes/configure/chain-configs/C.md#state-sync-enabled). Con esta bandera habilitada, en lugar de reproducir toda la historia para llegar al estado actual, los nodos simplemente descargan solo el estado actual de otros pares de la red, acortando el proceso de inicio desde varios días a un par de horas. Si los nodos se utilizarán exclusivamente para validación de Subnet, puedes diff --git a/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/avalanchego-config-flags.md b/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/avalanchego-config-flags.md index 7c81e8050ec..57795ef87db 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/avalanchego-config-flags.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/avalanchego-config-flags.md @@ -169,7 +169,7 @@ Algunas blockchains permiten que el operador del nodo proporcione configuracione #### `--chain-config-dir` (cadena) -Especifica el directorio que contiene las configuraciones de la cadena, como se describe [aquí](chain-config-flags.md). Por defecto, es `$HOME/.avalanchego/configs/chains`. Si no se proporciona esta bandera y el directorio predeterminado no existe, AvalancheGo no saldrá ya que las configuraciones personalizadas son opcionales. Sin embargo, si se establece la bandera, la carpeta especificada debe existir, o AvalancheGo saldrá con un error. Esta bandera se ignora si se especifica `--chain-config-content`. +Especifica el directorio que contiene las configuraciones de la cadena, como se describe [aquí](/nodes/configure/chain-configs/chain-config-flags.md). Por defecto, es `$HOME/.avalanchego/configs/chains`. Si no se proporciona esta bandera y el directorio predeterminado no existe, AvalancheGo no saldrá ya que las configuraciones personalizadas son opcionales. Sin embargo, si se establece la bandera, la carpeta especificada debe existir, o AvalancheGo saldrá con un error. Esta bandera se ignora si se especifica `--chain-config-content`. :::note Por favor, reemplace `chain-config-dir` y `blockchainID` con sus valores reales. @@ -179,7 +179,7 @@ Las actualizaciones de red se pasan desde la ubicación: `chain-config-dir`/`blo Las configuraciones de la cadena se pasan desde la ubicación `chain-config-dir`/`blockchainID`/`config.*`. Los archivos de configuración suelen estar codificados en json y, por lo tanto, se llaman `config.json`. Sin embargo, el formato del archivo depende de la VM. Esta configuración es utilizada por la VM para manejar banderas de configuración opcionales como habilitar/deshabilitar APIs, actualizar el nivel de registro, etc. La configuración de la cadena está destinada a proporcionar parámetros de configuración opcionales y la VM utilizará valores predeterminados si no se pasa nada. -La referencia completa de todas las opciones de configuración para algunas cadenas estándar se puede encontrar en un documento separado de [banderas de configuración de la cadena](chain-config-flags.md). +La referencia completa de todas las opciones de configuración para algunas cadenas estándar se puede encontrar en un documento separado de [banderas de configuración de la cadena](/nodes/configure/chain-configs/chain-config-flags.md). La referencia completa de la configuración de actualización de la Subnet `subnet-evm` se puede encontrar en un documento separado de [Personalizar una Subnet](/build/subnet/upgrade/customize-a-subnet.md). From 0e9f1c64091eb4b9670b11fdc4cbd06c8a1569b1 Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 25 Mar 2024 14:27:55 -0400 Subject: [PATCH 15/18] chain config docs complete with sidebars.json --- docs/nodes/configure/chain-configs/C.md | 19 +- docs/nodes/configure/chain-configs/P.md | 228 ++++++++++++++++++ docs/nodes/configure/chain-configs/X.md | 3 +- .../chain-configs/chain-config-flags.md | 2 +- sidebars.json | 28 ++- 5 files changed, 265 insertions(+), 15 deletions(-) diff --git a/docs/nodes/configure/chain-configs/C.md b/docs/nodes/configure/chain-configs/C.md index 6fe3120227e..3687973c9f9 100644 --- a/docs/nodes/configure/chain-configs/C.md +++ b/docs/nodes/configure/chain-configs/C.md @@ -1,12 +1,11 @@ --- tags: [Nodes] description: Reference for all available C-Chain config options and flags. -sidebar_label: C-Chain pagination_label: C-Chain Configs sidebar_position: 3 --- -# C-Chain Configs +# C-Chain In order to specify a config for the C-Chain, a JSON config file should be placed at `{chain-config-dir}/C/config.json`. This file does not exist by @@ -75,7 +74,7 @@ _Integer_ Size of trie cache used for providing state sync data to peers in MBs. Should be a multiple of `64`. Defaults to `64`. -### Continuous Profiling +## Continuous Profiling ### `continuous-profiler-dir` @@ -100,7 +99,7 @@ _Integer_ Specifies the maximum number of profiles to keep before removing the oldest. Defaults to `5`. -### Enabling Avalanche Specific APIs +## Enabling Avalanche Specific APIs ### `snowman-api-enabled` @@ -400,7 +399,7 @@ Adds the following RPC calls to the `personal_*` namespace. Defaults to `false`. - `personal_initializeWallet` - `personal_unpair` -### API Configuration +## API Configuration ### `rpc-gas-cap` @@ -571,7 +570,7 @@ _Duration_ Maximum duration a non-executable transaction will be allowed in the poll. Defaults to `600000000000` nano seconds which is 10 minutes. -### Metrics +## Metrics ### `metrics-enabled` @@ -585,7 +584,7 @@ _Boolean_ Enables expensive metrics. Defaults to `false`. -### Snapshots +## Snapshots ### `snapshot-async` @@ -640,7 +639,7 @@ _Boolean_ If `true`, allow users to unlock accounts in unsafe HTTP environment. Defaults to `false`. -### Database +## Database ### `trie-clean-cache` @@ -817,7 +816,7 @@ _Boolean_ If set to `true`, the node will not index transactions. TxLookupLimit can be still used to control deleting old transaction indices. Defaults to `false`. -### VM Networking +## VM Networking ### `max-outbound-active-requests` @@ -831,7 +830,7 @@ _Integer_ Specifies the maximum number of outbound cross-chain requests in flight at once. Defaults to `64`. -### Miscellaneous +## Miscellaneous ### `airdrop` diff --git a/docs/nodes/configure/chain-configs/P.md b/docs/nodes/configure/chain-configs/P.md index e69de29bb2d..69b15876995 100644 --- a/docs/nodes/configure/chain-configs/P.md +++ b/docs/nodes/configure/chain-configs/P.md @@ -0,0 +1,228 @@ +--- +tags: [Configs] +description: Reference for all available configuration options and parameters for the PlatformVM. +pagination_label: P-Chain Configs +sidebar_position: 1 +--- + +# P-Chain + +This document provides details about the configuration options available for the PlatformVM. + +In order to specify a configuration for the PlatformVM, you need to define a `Config` struct and its parameters. The default values for these parameters are: + +```json +{ + "Chains": null, + "Validators": null, + "UptimeLockedCalculator": null, + "SybilProtectionEnabled": false, + "PartialSyncPrimaryNetwork": false, + "TrackedSubnets": [], + "TxFee": 0, + "CreateAssetTxFee": 0, + "CreateSubnetTxFee": 0, + "TransformSubnetTxFee": 0, + "CreateBlockchainTxFee": 0, + "AddPrimaryNetworkValidatorFee": 0, + "AddPrimaryNetworkDelegatorFee": 0, + "AddSubnetValidatorFee": 0, + "AddSubnetDelegatorFee": 0, + "MinValidatorStake": 0, + "MaxValidatorStake": 0, + "MinDelegatorStake": 0, + "MinDelegationFee": 0, + "UptimePercentage": 0, + "MinStakeDuration": "0s", + "MaxStakeDuration": "0s", + "RewardConfig": {}, + "ApricotPhase3Time": "0001-01-01T00:00:00Z", + "ApricotPhase5Time": "0001-01-01T00:00:00Z", + "BanffTime": "0001-01-01T00:00:00Z", + "CortinaTime": "0001-01-01T00:00:00Z", + "DurangoTime": "0001-01-01T00:00:00Z", + "EUpgradeTime": "0001-01-01T00:00:00Z", + "UseCurrentHeight": false +} +``` + +Default values are overridden only if explicitly specified in the config. + +## Parameters + +The parameters are as follows: + +### `Chains` + +The node's chain manager + +### `Validators` + +Node's validator set maps subnetID to validators of the subnet + +- The primary network's validator set should have been added to the manager before calling VM.Initialize. +- The primary network's validator set should be empty before calling VM.Initialize. + +### `UptimeLockedCalculator` + +Provides access to the uptime manager as a thread-safe data structure + +### `SybilProtectionEnabled` + +_Boolean_ + +True if the node is being run with staking enabled + +### `PartialSyncPrimaryNetwork` + +_Boolean_ + +If true, only the P-chain will be instantiated on the primary network. + +### `TrackedSubnets` + +_Set[ids.ID]_ + +Set of subnets that this node is validating + +### `TxFee` + +_Uint64_ + +Fee that is burned by every non-state creating transaction + +### `CreateAssetTxFee` + +_Uint64_ + +Fee that must be burned by every state creating transaction before AP3 + +### `CreateSubnetTxFee` + +_Uint64_ + +Fee that must be burned by every subnet creating transaction after AP3 + +### `TransformSubnetTxFee` + +_Uint64_ + +Fee that must be burned by every transform subnet transaction + +### `CreateBlockchainTxFee` + +_Uint64_ + +Fee that must be burned by every blockchain creating transaction after AP3 + +### `AddPrimaryNetworkValidatorFee` + +_Uint64_ + +Transaction fee for adding a primary network validator + +### `AddPrimaryNetworkDelegatorFee` + +_Uint64_ + +Transaction fee for adding a primary network delegator + +### `AddSubnetValidatorFee` + +_Uint64_ + +Transaction fee for adding a subnet validator + +### `AddSubnetDelegatorFee` + +_Uint64_ + +Transaction fee for adding a subnet delegator + +### `MinValidatorStake` + +_Uint64_ + +The minimum amount of tokens one must bond to be a validator + +### `MaxValidatorStake` + +_Uint64_ + +The maximum amount of tokens that can be bonded on a validator + +### `MinDelegatorStake` + +_Uint64_ + +Minimum stake, in nAVAX, that can be delegated on the primary network + +### `MinDelegationFee` + +_Uint32_ + +Minimum fee that can be charged for delegation + +### `UptimePercentage` + +_Float64_ + +UptimePercentage is the minimum uptime required to be rewarded for staking + +### `MinStakeDuration` + +_Duration_ + +Minimum amount of time to allow a staker to stake + +### `MaxStakeDuration` + +_Duration_ + +Maximum amount of time to allow a staker to stake + +### `RewardConfig` + +Config for the minting function + +### `ApricotPhase3Time` + +_Time_ + +Time of the AP3 network upgrade + +### `ApricotPhase5Time` + +_Time_ + +Time of the AP5 network upgrade + +### `BanffTime` + +_Time_ + +Time of the Banff network upgrade + +### `CortinaTime` + +_Time_ + +Time of the Cortina network upgrade + +### `DurangoTime` + +_Time_ + +Time of the Durango network upgrade + +### `EUpgradeTime` + +_Time_ + +Time of the E network upgrade + +### `UseCurrentHeight` + +_Boolean_ + +UseCurrentHeight forces [GetMinimumHeight] to return the current height of the P-Chain instead of the oldest block in the [recentlyAccepted] window. This config is particularly useful for triggering proposervm activation on recently created subnets (without this, users need to wait for [recentlyAcceptedWindowTTL] to pass for activation to occur). diff --git a/docs/nodes/configure/chain-configs/X.md b/docs/nodes/configure/chain-configs/X.md index 4a0247c0b3e..58cbe1435c2 100644 --- a/docs/nodes/configure/chain-configs/X.md +++ b/docs/nodes/configure/chain-configs/X.md @@ -1,12 +1,11 @@ --- tags: [Nodes, AvalancheGo] description: Reference for all available X-chain config options and flags. -sidebar_label: X-Chain pagination_label: X-Chain Configs sidebar_position: 2 --- -# X-Chain Configs +# X-Chain In order to specify a config for the X-Chain, a JSON config file should be placed at `{chain-config-dir}/X/config.json`. diff --git a/docs/nodes/configure/chain-configs/chain-config-flags.md b/docs/nodes/configure/chain-configs/chain-config-flags.md index 8ff54f929e8..4dfec126e69 100644 --- a/docs/nodes/configure/chain-configs/chain-config-flags.md +++ b/docs/nodes/configure/chain-configs/chain-config-flags.md @@ -1,7 +1,7 @@ --- tags: [Nodes] description: Reference for all available chain config options and flags. -sidebar_label: Chain Configs +sidebar_label: Overview pagination_label: Chain Configs sidebar_position: 0 --- diff --git a/sidebars.json b/sidebars.json index bd215657aa9..79eabf660b2 100644 --- a/sidebars.json +++ b/sidebars.json @@ -82,10 +82,19 @@ "type": "html", "value": " Configure " }, + "nodes/configure/avalanchego-config-flags", { - "type": "autogenerated", - "dirName": "nodes/configure" + "type": "category", + "label": "Chain Configs", + "collapsed": true, + "items": [ + { + "type": "autogenerated", + "dirName": "nodes/configure/chain-configs" + } + ] }, + "nodes/configure/subnet-configs", { "type": "html", "value": "
" @@ -561,6 +570,11 @@ { "type": "autogenerated", "dirName": "reference/avalanchego/p-chain" + }, + { + "type": "ref", + "label": "Configs", + "id": "nodes/configure/chain-configs/P" } ] }, @@ -572,6 +586,11 @@ { "type": "autogenerated", "dirName": "reference/avalanchego/c-chain" + }, + { + "type": "ref", + "label": "Configs", + "id": "nodes/configure/chain-configs/C" } ] }, @@ -583,6 +602,11 @@ { "type": "autogenerated", "dirName": "reference/avalanchego/x-chain" + }, + { + "type": "ref", + "label": "Configs", + "id": "nodes/configure/chain-configs/X" } ] }, From a3ac23cc779a4a300e7d4125d2fe008134bbc3d3 Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 25 Mar 2024 15:09:02 -0400 Subject: [PATCH 16/18] spanish --- .../configure/avalanchego-config-flags.md | 1236 ----------------- .../nodes/configure/chain-config-flags.md | 735 ---------- .../current/nodes/configure/subnet-configs.md | 111 -- 3 files changed, 2082 deletions(-) delete mode 100644 i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/avalanchego-config-flags.md delete mode 100644 i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/chain-config-flags.md delete mode 100644 i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/subnet-configs.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/avalanchego-config-flags.md b/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/avalanchego-config-flags.md deleted file mode 100644 index 57795ef87db..00000000000 --- a/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/avalanchego-config-flags.md +++ /dev/null @@ -1,1236 +0,0 @@ ---- -tags: [Nodos] -description: Este documento enumera todas las configuraciones y banderas disponibles para AvalancheGo. -sidebar_label: Configuraciones + Banderas de AvalancheGo -pagination_label: Configuraciones y Banderas de AvalancheGo -sidebar_position: 0 ---- - -# Configuraciones y Banderas de AvalancheGo - - - -Puedes especificar la configuración de un nodo con los argumentos a continuación. - -## Directorio de Datos - -#### `--data-dir` (cadena) - -Establece el directorio base de datos donde se colocarán los subdirectorios por defecto a menos que se especifique lo contrario. -Por defecto, es `$HOME/.avalanchego`. - -## Archivo de Configuración - -#### `--config-file` (cadena) - -Ruta a un archivo JSON que especifica la configuración de este nodo. Los argumentos de línea de comandos -anularán los argumentos establecidos en el archivo de configuración. Esta bandera se ignora -si se especifica `--config-file-content`. - -Ejemplo de archivo de configuración JSON: - -```json -{ - "log-level": "debug" -} -``` - -:::tip -[El script de instalación](/nodes/run/with-installer/installing-avalanchego.md) crea el archivo de configuración del nodo -en `~/.avalanchego/configs/node.json`. No se crea ningún archivo por defecto si -[AvalancheGo se construye desde el código fuente](/nodes/run/node-manually.md), -deberías crearlo manualmente si es necesario. -::: - -#### `--config-file-content` (cadena) - -Como alternativa a `--config-file`, permite especificar el contenido de configuración codificado en base64. - -#### `--config-file-content-type` (cadena) - -Especifica el formato del contenido de configuración codificado en base64. JSON, TOML, YAML son -algunos de los formatos de archivo actualmente soportados (ver -[aquí](https://github.com/spf13/viper#reading-config-files) para la lista completa). Por defecto, es `JSON`. - -## APIs - -#### `--api-admin-enabled` (booleano) - -Si se establece en `true`, este nodo expondrá la API de Administración. Por defecto, es `false`. -Ver [aquí](/reference/avalanchego/admin-api.md) para más información. - -#### `--api-health-enabled` (booleano) - -Si se establece en `false`, este nodo no expondrá la API de Salud. Por defecto, es `true`. Ver -[aquí](/reference/avalanchego/health-api.md) para más información. - -#### `--index-enabled` (booleano) - -Si se establece en `true`, este nodo habilitará el indexador y la API de Índice estará -disponible. Por defecto, es `false`. Ver -[aquí](/reference/avalanchego/index-api.md) para más información. - -#### `--api-info-enabled` (booleano) - -Si se establece en `false`, este nodo no expondrá la API de Información. Por defecto, es `true`. Ver -[aquí](/reference/avalanchego/info-api.md) para más información. - -#### `--api-keystore-enabled` (booleano) - -Si se establece en `true`, este nodo expondrá la API de Keystore. Por defecto, es `false`. -Ver [aquí](/reference/avalanchego/keystore-api.md) para más información. - -#### `--api-metrics-enabled` (booleano) - -Si se establece en `false`, este nodo no expondrá la API de Métricas. Por defecto, es -`true`. Ver [aquí](/reference/avalanchego/metrics-api.md) para más información. - -#### `--http-shutdown-wait` (duración) - -Duración de espera después de recibir SIGTERM o SIGINT antes de iniciar el apagado. -El punto final `/health` devolverá no saludable durante esta duración (si la API de Salud -está habilitada). Por defecto, es `0s`. - -#### `--http-shutdown-timeout` (duración) - -Duración máxima de espera para que las conexiones existentes se completen durante el -apagado del nodo. Por defecto, es `10s`. - -## Arranque - -#### `--bootstrap-beacon-connection-timeout` (duración) - -Tiempo de espera al intentar conectar con beacons de arranque. Por defecto, es `1m`. - -#### `--bootstrap-ids` (cadena) - -Los IDs de arranque son una lista separada por comas de los IDs de validadores. Estos IDs se utilizarán -para autenticar a los pares de arranque. Un ejemplo de configuración de este campo sería -`--bootstrap-ids="NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg,NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ"`. -El número de IDs dados aquí debe ser el mismo que el número dado -`--bootstrap-ips`. El valor por defecto depende del ID de red. - -#### `--bootstrap-ips` (cadena) - -Las IPs de arranque son una lista separada por comas de pares IP:puerto. Estas direcciones IP -se utilizarán para arrancar el estado actual de Avalanche. Un ejemplo de configuración de -este campo sería `--bootstrap-ips="127.0.0.1:12345,1.2.3.4:5678"`. El número -de IPs dados aquí debe ser el mismo que el número dado `--bootstrap-ids`. El -valor por defecto depende del ID de red. - -#### `--bootstrap-retry-enabled` (booleano) - -Si se establece en `false`, no se volverá a intentar el arranque si falla. Por defecto, es `true`. - -#### `--bootstrap-retry-warn-frequency` (uint) - -Especifica cuántas veces se debe reintentar el arranque antes de advertir al operador. Por defecto, es `50`. - -#### `--bootstrap-ancestors-max-containers-sent` (uint) - -Número máximo de contenedores en un mensaje `Ancestors` enviado por este nodo. Por defecto, es `2000`. - -#### `--bootstrap-ancestors-max-containers-received` (unit) - -Este nodo lee como máximo esta cantidad de contenedores de un mensaje `Ancestors` entrante. Por defecto, es `2000`. - -#### `--bootstrap-max-time-get-ancestors` (duración) - -Tiempo máximo para gastar recuperando un contenedor y sus ancestros al responder a un mensaje GetAncestors. -Por defecto, es `50ms`. - -## Sincronización de Estado - -#### `--state-sync-ids` (cadena) - -Los IDs de sincronización de estado son una lista separada por comas de los IDs de validadores. Los -validadores especificados serán contactados para obtener y autenticar el punto de inicio (resumen de estado) para la sincronización de estado. Un ejemplo de configuración de este campo sería -`--state-sync-ids="NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg,NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ"`. -El número de IDs dados aquí debe ser el mismo que el número dado -`--state-sync-ips`. El valor por defecto es vacío, lo que resulta en que se muestreen todos los validadores. - -#### `--state-sync-ips` (cadena) - -Las IPs de sincronización de estado son una lista separada por comas de pares IP:puerto. Estas direcciones IP -serán contactadas para obtener y autenticar el punto de inicio (resumen de estado) para -la sincronización de estado. Un ejemplo de configuración de este campo sería -`--state-sync-ips="127.0.0.1:12345,1.2.3.4:5678"`. El número de IPs dados aquí -debe ser el mismo que el número de `--state-sync-ids` dados. - -## Sincronización Parcial Red Primaria - -#### `--partial-sync-primary-network` (cadena) - -La sincronización parcial permite a los no validadores sincronizar opcionalmente solo la cadena P en la red primaria. - -## Configuraciones de la Cadena - -Algunas blockchains permiten que el operador del nodo proporcione configuraciones personalizadas para blockchains individuales. Estas configuraciones personalizadas se dividen en dos categorías: actualizaciones de red y configuraciones opcionales de la cadena. AvalancheGo lee estas configuraciones desde el directorio de configuración de la cadena y las pasa a la VM durante la inicialización. - -#### `--chain-config-dir` (cadena) - -Especifica el directorio que contiene las configuraciones de la cadena, como se describe [aquí](/nodes/configure/chain-configs/chain-config-flags.md). Por defecto, es `$HOME/.avalanchego/configs/chains`. Si no se proporciona esta bandera y el directorio predeterminado no existe, AvalancheGo no saldrá ya que las configuraciones personalizadas son opcionales. Sin embargo, si se establece la bandera, la carpeta especificada debe existir, o AvalancheGo saldrá con un error. Esta bandera se ignora si se especifica `--chain-config-content`. - -:::note -Por favor, reemplace `chain-config-dir` y `blockchainID` con sus valores reales. -::: - -Las actualizaciones de red se pasan desde la ubicación: `chain-config-dir`/`blockchainID`/`upgrade.*`. Los archivos de actualización suelen estar codificados en json y, por lo tanto, se llaman `upgrade.json`. Sin embargo, el formato del archivo depende de la VM. Después de que una blockchain ha activado una actualización de red, la misma configuración de actualización debe pasarse siempre para asegurar que las actualizaciones de red se activen en el momento correcto. - -Las configuraciones de la cadena se pasan desde la ubicación `chain-config-dir`/`blockchainID`/`config.*`. Los archivos de configuración suelen estar codificados en json y, por lo tanto, se llaman `config.json`. Sin embargo, el formato del archivo depende de la VM. Esta configuración es utilizada por la VM para manejar banderas de configuración opcionales como habilitar/deshabilitar APIs, actualizar el nivel de registro, etc. La configuración de la cadena está destinada a proporcionar parámetros de configuración opcionales y la VM utilizará valores predeterminados si no se pasa nada. - -La referencia completa de todas las opciones de configuración para algunas cadenas estándar se puede encontrar en un documento separado de [banderas de configuración de la cadena](/nodes/configure/chain-configs/chain-config-flags.md). - -La referencia completa de la configuración de actualización de la Subnet `subnet-evm` se puede encontrar en un documento separado de [Personalizar una Subnet](/build/subnet/upgrade/customize-a-subnet.md). - -#### `--chain-config-content` (cadena) - -Como alternativa a `--chain-config-dir`, las configuraciones personalizadas de las cadenas se pueden cargar en su totalidad desde la línea de comandos a través de la bandera `--chain-config-content`. El contenido debe estar codificado en base64. - -Ejemplo: - -```bash -cchainconfig="$(echo -n '{"log-level":"trace"}' | base64)" -chainconfig="$(echo -n "{\"C\":{\"Config\":\"${cchainconfig}\",\"Upgrade\":null}}" | base64)" -avalanchego --chain-config-content "${chainconfig}" -``` - -#### `--chain-aliases-file` (cadena) - -Ruta al archivo JSON que define alias para ID de Blockchains. Por defecto, es `~/.avalanchego/configs/chains/aliases.json`. Esta bandera se ignora si se especifica `--chain-aliases-file-content`. Ejemplo de contenido: - -```json -{ - "q2aTwKuyzgs8pynF7UXBZCU7DejbZbZ6EUyHr3JQzYgwNPUPi": ["DFK"] -} -``` - -El ejemplo anterior asigna alias a la Blockchain cuyo ID es `"q2aTwKuyzgs8pynF7UXBZCU7DejbZbZ6EUyHr3JQzYgwNPUPi"` como `"DFK"`. Los alias de la cadena se agregan después de agregar alias de red primaria y antes de cualquier cambio en los alias a través de la API de administración. Esto significa que el primer alias incluido para una Blockchain en una Subnet se tratará como el "Alias Primario" en lugar del blockchainID completo. El Alias Primario se utiliza en todas las métricas y registros. - -#### `--chain-aliases-file-content` (cadena) - -Como alternativa a `--chain-aliases-file`, permite especificar contenido de alias de Blockchains codificado en base64. - -#### `--chain-data-dir` (cadena) - -Directorio de datos específico de la cadena. Por defecto, es `$HOME/.avalanchego/chainData`. - -## Base de Datos - -##### `--db-dir` (cadena, ruta de archivo) - -Especifica el directorio en el que se persiste la base de datos. Por defecto, es `"$HOME/.avalanchego/db"`. - -##### `--db-type` (cadena) - -Especifica el tipo de base de datos a utilizar. Debe ser uno de `LevelDB` o `memdb`. `memdb` es una base de datos en memoria, no persistente. - -:::note - -`memdb` almacena todo en memoria. Así que si tienes una instancia de LevelDB de 900 GiB, entonces usando `memdb` necesitarías 900 GiB de RAM. `memdb` es útil para pruebas rápidas ocasionales, no para ejecutar un nodo real (en Fuji o Mainnet). También tenga en cuenta que `memdb` no persiste después de reiniciar. Así que cada vez que reinicies el nodo, comenzará a sincronizar desde cero. - -::: - -### Configuración de la Base de Datos - -#### `--db-config-file` (cadena) - -Ruta al archivo de configuración de la base de datos. Se ignora si se especifica `--db-config-file-content`. - -#### `--db-config-file-content` (cadena) - -Como alternativa a `--db-config-file`, permite especificar el contenido de la configuración de la base de datos codificado en base64. - -#### Configuración de LevelDB - -Un archivo de configuración de LevelDB debe ser JSON y puede tener estas claves. Cualquier clave no especificada recibirá el valor predeterminado. - -```go -{ - // BlockCacheCapacity define la capacidad de la caché de bloques de 'sorted table'. - // Use -1 para cero. - // - // El valor predeterminado es 12MiB. - "blockCacheCapacity": int - - // BlockSize es el tamaño mínimo sin comprimir en bytes de cada bloque de 'sorted table'. - // - // El valor predeterminado es 4KiB. - "blockSize": int - - // CompactionExpandLimitFactor limita el tamaño de la compactación después de la expansión. - // Esto se multiplicará por el límite de tamaño de tabla en el nivel de destino de la compactación. - // - // El valor predeterminado es 25. - "compactionExpandLimitFactor": int - - // CompactionGPOverlapsFactor limita las superposiciones en el abuelo (Nivel + 2) - // que una sola 'sorted table' genera. Esto se multiplicará por - // el límite de tamaño de tabla en el nivel de abuelo. - // - // El valor predeterminado es 10. - "compactionGPOverlapsFactor": int - - // CompactionL0Trigger define el número de 'sorted table' en el nivel-0 que - // desencadenará la compactación. - // - // El valor predeterminado es 4. - "compactionL0Trigger": int - - // CompactionSourceLimitFactor limita el tamaño de la fuente de compactación. Esto no se aplica a - // nivel-0. - // Esto se multiplicará por el límite de tamaño de tabla en el nivel de destino de la compactación. - // - // El valor predeterminado es 1. - "compactionSourceLimitFactor": int - - // CompactionTableSize limita el tamaño de la 'sorted table' que genera la compactación. - // Los límites para cada nivel se calcularán como: - // CompactionTableSize * (CompactionTableSizeMultiplier ^ Nivel) - // El multiplicador para cada nivel también se puede ajustar finamente utilizando CompactionTableSizeMultiplierPerLevel. - // - // El valor predeterminado es 2MiB. - "compactionTableSize": int - - // CompactionTableSizeMultiplier define el multiplicador para CompactionTableSize. - // - // El valor predeterminado es 1. - "compactionTableSizeMultiplier": float - - // CompactionTableSizeMultiplierPerLevel define el multiplicador por nivel para - // CompactionTableSize. - // Use cero para omitir un nivel. - // - // El valor predeterminado es nulo. - "compactionTableSizeMultiplierPerLevel": []float - - // CompactionTotalSize limita el tamaño total de la 'sorted table' para cada nivel. - // Los límites para cada nivel se calcularán como: - // CompactionTotalSize * (CompactionTotalSizeMultiplier ^ Nivel) - // El multiplicador para cada nivel también se puede ajustar finamente utilizando - // CompactionTotalSizeMultiplierPerLevel. - // - // El valor predeterminado es 10MiB. - "compactionTotalSize": int - - // CompactionTotalSizeMultiplier define el multiplicador para CompactionTotalSize. - // - // El valor predeterminado es 10. - "compactionTotalSizeMultiplier": float - - - -// disableSeeksCompaction permite desactivar la 'compactación desencadenada por búsquedas'. -// El propósito de la 'compactación desencadenada por búsquedas' es optimizar la base de datos para -// minimizar las 'búsquedas de nivel', sin embargo, esto puede generar muchas -// compactaciones pequeñas que pueden no ser preferibles. -// -// El valor predeterminado es true. -"disableSeeksCompaction": bool - -// openFilesCacheCapacity define la capacidad de la caché de archivos abiertos. -// Use -1 para cero, esto tiene el mismo efecto que especificar NoCacher a OpenFilesCacher. -// -// El valor predeterminado es 1024. -"openFilesCacheCapacity": int - -// writeBuffer define el tamaño máximo de un 'memdb' antes de que se vacíe en -// una 'tabla ordenada'. 'memdb' es una base de datos en memoria respaldada por un -// diario desordenado en disco. -// -// LevelDB puede contener hasta dos 'memdb' al mismo tiempo. -// -// El valor predeterminado es 6MiB. -"writeBuffer": int - -// filterBitsPerKey es el número de bits que se agregan al filtro de Bloom por -// clave. -// -// El valor predeterminado es 10. -"filterBitsPerKey": int - -// maxManifestFileSize es el límite máximo de tamaño del archivo MANIFEST-******. -// Cuando el archivo MANIFEST-****** crece más allá de este tamaño, LevelDB creará -// un nuevo archivo MANIFEST. -// -// El valor predeterminado es infinito. -"maxManifestFileSize": int - -// metricUpdateFrequency es la frecuencia para sondear las métricas de LevelDB en -// nanosegundos. -// Si <= 0, las métricas de LevelDB no se sondean. -// -// El valor predeterminado es 10s. -"metricUpdateFrequency": int -} -``` - -## Génesis - -#### `--genesis-file` (string) - -Ruta a un archivo JSON que contiene los datos de génesis a utilizar. Se ignora cuando se ejecutan -redes estándar (Mainnet, Fuji Testnet), o cuando se especifica `--genesis-content`. Si no se proporciona, utiliza los datos de génesis predeterminados. - -Estas son las propiedades principales en el archivo JSON: - -- `networkID`: Un identificador único para la blockchain, debe ser un número en el rango [0, 2^32). -- `allocations`: La lista de direcciones iniciales, sus saldos iniciales y el cronograma de desbloqueo para cada una. -- `startTime`: La hora de inicio de la blockchain, debe ser una marca de tiempo Unix - y no puede ser una hora en el futuro. -- `initialStakeDuration`: La duración de stake, en segundos, de los validadores que existen en el génesis de la red. -- `initialStakeDurationOffset`: El desplazamiento, en segundos, entre los tiempos de inicio - de los validadores que existen en el génesis. -- `initialStakedFunds`: Una lista de direcciones que poseen los fondos stakeados en el génesis - (cada dirección debe estar presente en `allocations` también) -- `initialStakers`: Los validadores que existen en el génesis. Cada elemento contiene - la `rewardAddress`, NodeID y la `delegationFee` del validador. -- `cChainGenesis`: La información de génesis que se pasará a la C-Chain. -- `message`: Un mensaje para incluir en el génesis. No es obligatorio. - -Para un ejemplo de una representación JSON de los datos de génesis, consulte [genesis_local.json](https://github.com/ava-labs/avalanchego/blob/master/genesis/genesis_local.json). - -#### `--genesis-file-content` (string) - -Como alternativa a `--genesis-file`, permite especificar los datos de génesis codificados en base64 a utilizar. - -## Servidor HTTP - -#### `--http-host` (string) - -La dirección en la que escuchan las API HTTP. De forma predeterminada, es `127.0.0.1`. Esto significa que, -de forma predeterminada, su nodo solo puede manejar llamadas de API realizadas desde la misma máquina. Para -permitir llamadas de API desde otras máquinas, use `--http-host=`. También puede ingresar -nombres de dominio como parámetro. - -#### `--http-port` (int) - -Cada nodo ejecuta un servidor HTTP que proporciona las API para interactuar con el -nodo y la red Avalanche. Este argumento especifica el puerto en el que el servidor HTTP -escuchará. El valor predeterminado es `9650`. - -#### `--http-tls-cert-file` (string, ruta de archivo) - -Este argumento especifica la ubicación del certificado TLS utilizado por el nodo para -el servidor HTTPS. Esto debe especificarse cuando `--http-tls-enabled=true`. No -hay un valor predeterminado. Esta bandera se ignora si se especifica `--http-tls-cert-file-content`. - -#### `--http-tls-cert-file-content` (string) - -Como alternativa a `--http-tls-cert-file`, permite especificar el contenido codificado en base64 -del certificado TLS utilizado por el nodo para el servidor HTTPS. Tenga en cuenta que -el contenido completo del certificado, con el encabezado inicial y final, debe estar codificado en base64. -Esto debe especificarse cuando `--http-tls-enabled=true`. - -#### `--http-tls-enabled` (booleano) - -Si se establece en `true`, esta bandera intentará actualizar el servidor para usar HTTPS. De forma predeterminada, es `false`. - -#### `--http-tls-key-file` (string, ruta de archivo) - -Este argumento especifica la ubicación de la clave privada TLS utilizada por el nodo para -el servidor HTTPS. Esto debe especificarse cuando `--http-tls-enabled=true`. No -hay un valor predeterminado. Esta bandera se ignora si se especifica `--http-tls-key-file-content`. - -#### `--http-tls-key-file-content` (string) - -Como alternativa a `--http-tls-key-file`, permite especificar el contenido codificado en base64 -de la clave privada TLS utilizada por el nodo para el servidor HTTPS. Tenga en cuenta que -el contenido completo de la clave privada, con el encabezado inicial y final, debe estar codificado en base64. -Esto debe especificarse cuando `--http-tls-enabled=true`. - -#### `--http-read-timeout` (string) - -Duración máxima para leer la solicitud completa, incluido el cuerpo. Un valor cero o -negativo significa que no habrá tiempo de espera. - -#### `--http-read-header-timeout` (string) - -Duración máxima para leer las cabeceras de la solicitud. El plazo de lectura de la conexión se restablece después de leer las cabeceras. Si `--http-read-header-timeout` es cero, se utiliza el valor de `--http-read-timeout`. Si ambos son cero, no hay tiempo de espera. - -#### `--http-write-timeout` (string) - -Duración máxima antes de agotar el tiempo de espera de escritura de la respuesta. Se restablece cada vez -que se lee el encabezado de una nueva solicitud. Un valor cero o negativo significa que no habrá tiempo de espera. - -#### `--http-idle-timeout` (string) - -Duración máxima para esperar la siguiente solicitud cuando las conexiones persistentes están habilitadas. Si -`--http-idle-timeout` es cero, se utiliza el valor de `--http-read-timeout`. Si ambos son cero, -no hay tiempo de espera. - -#### `--http-allowed-origins` (string) - -Orígenes permitidos en el puerto HTTP. De forma predeterminada, es `*`, lo que permite todos los orígenes. Ejemplo: -`"https://*.avax.network https://*.avax-test.network"` - -#### `--http-allowed-hosts` (string) - -Lista de nombres de host aceptables en las solicitudes de API. Proporcione el comodín (`'*'`) para aceptar -solicitudes de todos los hosts. Una llamada de API cuyo campo `Host` HTTP no sea aceptable recibirá un código de error 403. De forma predeterminada, es `localhost`. - -## Límite de descriptores de archivo - -#### `--fd-limit` (int) - -Intenta aumentar el límite de descriptores de archivo del proceso a al menos este valor y -devuelve un error si el valor está por encima del máximo del sistema. Predeterminado de Linux `32768`. - -## Registro - -#### `--log-level` (string, `{verbo, debug, trace, info, warn, error, fatal, off}`) - -El nivel de registro determina qué eventos se registran. Hay 8 niveles diferentes, en orden de mayor a menor prioridad. - -- `off`: Ningún registro tiene este nivel de registro. Desactiva el registro. -- `fatal`: Errores fatales que no son recuperables. -- `error`: Errores que encuentra el nodo, estos errores pudieron ser recuperados. -- `warn`: Una advertencia que podría ser indicativa de un nodo bizantino espurio, o un error potencial futuro. -- `info`: Descripciones útiles de actualizaciones de estado del nodo. -- `trace`: Rastrea los resultados del trabajo de los contenedores (bloque, vértice, transacción). Útil para rastrear identificadores de contenedores y sus resultados. -- `debug`: El registro de depuración es útil cuando se intenta entender posibles errores en el código. Se mostrará más información de la que se desearía típicamente para el uso normal. -- `verbo`: Rastrea cantidades extensas de información que el nodo está procesando. Esto incluye el contenido de los mensajes y volcados binarios de datos para un análisis de protocolo de nivel extremadamente bajo. - -Al especificar un nivel de registro, tenga en cuenta que se rastrearán todos los registros con la prioridad especificada o superior. El valor predeterminado es `info`. - -#### `--log-display-level` (cadena, `{verbo, debug, trace, info, warn, error, fatal, off}`) - -El nivel de registro determina qué eventos mostrar en stdout. Si se deja en blanco, se utilizará el valor proporcionado a `--log-level`. - -#### `--log-format` (cadena, `{auto, plain, colors, json}`) - -La estructura del formato de registro. El valor predeterminado es `auto`, que formatea los registros como en una terminal, cuando la salida es una terminal. De lo contrario, debe ser uno de `{auto, plain, colors, json}`. - -#### `--log-dir` (cadena, ruta de archivo) - -Especifica el directorio en el que se guardan los registros del sistema. El valor predeterminado es `"$HOME/.avalanchego/logs"`. Si está ejecutando el nodo como un servicio del sistema (por ejemplo, utilizando el script de instalación), los registros también se almacenarán en `$HOME/var/log/syslog`. - -#### `--log-disable-display-plugin-logs` (booleano) - -Deshabilita la visualización de los registros de los complementos en stdout. El valor predeterminado es `false`. - -#### `--log-rotater-max-size` (entero sin signo) - -El tamaño máximo del archivo de registro en megabytes antes de que se rote. El valor predeterminado es `8`. - -#### `--log-rotater-max-files` (entero sin signo) - -El número máximo de archivos de registro antiguos para retener. 0 significa retener todos los archivos de registro antiguos. El valor predeterminado es `7`. - -#### `--log-rotater-max-age` (entero sin signo) - -El número máximo de días para retener archivos de registro antiguos según la marca de tiempo codificada en su nombre de archivo. 0 significa retener todos los archivos de registro antiguos. El valor predeterminado es `0`. - -#### `--log-rotater-compress-enabled` (booleano) - -Habilita la compresión de archivos de registro rotados a través de gzip. El valor predeterminado es `false`. - -## ID de red - -#### `--network-id` (cadena) - -La identidad de la red a la que el nodo debe conectarse. Puede ser uno de: - -- `--network-id=mainnet` -> Conectarse a Mainnet (predeterminado). -- `--network-id=fuji` -> Conectarse a la red de prueba Fuji. -- `--network-id=testnet` -> Conectarse a la red de prueba actual. (En este momento, esto es Fuji). -- `--network-id=local` -> Conectarse a una red de prueba local. -- `--network-id=network-{id}` -> Conectarse a la red con el ID dado. - `id` debe estar en el rango `[0, 2^32)`. - -## OpenTelemetry - -AvalancheGo admite recopilar y exportar trazas de [OpenTelemetry](https://opentelemetry.io/). Esto puede ser útil para la depuración, el análisis de rendimiento o el monitoreo. - -#### `--tracing-enabled` (booleano) - -Si es verdadero, habilita el rastreo de OpenTelemetry. El valor predeterminado es `false`. - -#### `--tracing-endpoint` (cadena) - -El punto final para exportar los datos de traza. El valor predeterminado es `localhost:4317`. - -#### `--tracing-insecure` (cadena) - -Si es verdadero, no utiliza TLS al exportar los datos de traza. El valor predeterminado es `true`. - -#### `--tracing-sample-rate` (flotante) - -La fracción de trazas a muestrear. Si es `>=` 1, siempre se muestrea. Si es `<=` 0, nunca se muestrea. -El valor predeterminado es `0.1`. - -#### `--tracing-exporter-type`(cadena) - -Tipo de exportador a utilizar para el rastreo. Las opciones son [`grpc`,`http`]. El valor predeterminado es `grpc`. - -## IP pública - -Los validadores deben conocer una de sus direcciones IP públicas para que puedan habilitar -que otros nodos se conecten a ellos. - -De forma predeterminada, el nodo intentará realizar el tránsito de NAT para obtener la IP del nodo -según su enrutador. - -#### `--public-ip` (cadena) - -Si se proporciona este argumento, el nodo asumirá que esta es su IP pública. - -:::tip -Cuando se ejecuta una red local, puede ser más fácil establecer este valor en `127.0.0.1`. -::: - -#### `--public-ip-resolution-frequency` (duración) - -Frecuencia con la que este nodo resuelve/actualiza su IP pública y renueva los mapeos NAT, si corresponde. El valor predeterminado es de 5 minutos. - -#### `--public-ip-resolution-service` (cadena) - -Cuando se proporciona, el nodo utilizará ese servicio para resolver/actualizar periódicamente su IP pública. -Los únicos valores aceptables son `ifconfigCo`, `opendns` o `ifconfigMe`. - -## Staking (Participación) - -#### `--staking-port` (entero) - -El puerto a través del cual los pares de la red se conectarán a este nodo externamente. -Tener este puerto accesible desde Internet es necesario para el correcto funcionamiento del nodo. -El valor predeterminado es `9651`. - -#### `--sybil-protection-enabled` (booleano) - -Avalanche utiliza Prueba de Participación (PoS) como resistencia a sybil para hacer prohibitivamente -costoso atacar la red. Si es falso, la resistencia a sybil está deshabilitada y todos -los pares serán muestreados durante el consenso. El valor predeterminado es `true`. Tenga en cuenta que esto no se puede desactivar en redes públicas (`Fuji` y `Mainnet`). - -Establecer este indicador en `false` **no significa** "este nodo no es un validador". -Significa que este nodo muestreará a todos los nodos, no solo a los validadores. -**No debe establecer este indicador en falso a menos que entienda lo que está haciendo.** - -#### `--sybil-protection-disabled-weight` (entero sin signo) - -Peso que se proporcionará a cada par cuando la participación esté deshabilitada. El valor predeterminado es `100`. - -#### `--staking-tls-cert-file` (cadena, ruta de archivo) - -Avalanche utiliza conexiones TLS autenticadas de dos vías para conectar nodos de forma segura. -Este argumento especifica la ubicación del certificado TLS utilizado por el nodo. De -forma predeterminada, el nodo espera que el certificado TLS esté en -`$HOME/.avalanchego/staking/staker.crt`. Esta bandera se ignora si -se especifica `--staking-tls-cert-file-content`. - -#### `--staking-tls-cert-file-content` (cadena) - -Como alternativa a `--staking-tls-cert-file`, permite especificar el contenido base64 -codificado del certificado TLS utilizado por el nodo. Tenga en cuenta que el contenido completo del certificado, con el encabezado inicial y final, debe estar codificado en base64. - -#### `--staking-tls-key-file` (cadena, ruta de archivo) - -Avalanche utiliza conexiones TLS autenticadas de dos vías para conectar nodos de forma segura. -Este argumento especifica la ubicación de la clave privada TLS utilizada por el nodo. De -forma predeterminada, el nodo espera que la clave privada TLS esté en -`$HOME/.avalanchego/staking/staker.key`. Esta bandera se ignora si -se especifica `--staking-tls-key-file-content`. - -#### `--staking-tls-key-file-content` (cadena) - -Como alternativa a `--staking-tls-key-file`, permite especificar el contenido base64 -codificado de la clave privada TLS utilizada por el nodo. Tenga en cuenta que el contenido completo de la clave privada, con el encabezado inicial y final, debe estar codificado en base64. - -## Subnets - -### Seguimiento de Subnets - -#### `--track-subnets` (cadena) - -Lista separada por comas de los ID de Subnet que este nodo rastreará si se agrega. -El valor predeterminado es vacío (solo validará la Red Primaria). - -### Configuraciones de Subnets - -Es posible proporcionar parámetros para Subnets. Estos parámetros se aplican a todas las cadenas en las Subnets especificadas. Los parámetros deben especificarse con un archivo de configuración `{subnetID}.json` bajo `--subnet-config-dir`. AvalancheGo carga las configuraciones para las Subnets especificadas en el parámetro `--track-subnets`. - -La referencia completa de todas las opciones de configuración para una Subnet se puede encontrar en un documento aparte de [Configuraciones de Subnet](./subnet-configs). - -#### `--subnet-config-dir` (`string`) - -Especifica el directorio que contiene las configuraciones de las Subnets, como se describe anteriormente. Por defecto, es `$HOME/.avalanchego/configs/subnets`. Si se establece explícitamente la bandera, la carpeta especificada debe existir, o AvalancheGo saldrá con un error. Esta bandera se ignora si se especifica `--subnet-config-content`. - -Ejemplo: Digamos que tenemos una Subnet con ID `p4jUwqZsA2LuSftroCd3zb4ytH8W99oXKuKVZdsty7eQ3rXD6`. Podemos crear un archivo de configuración en el directorio `subnet-config-dir` por defecto en `$HOME/.avalanchego/configs/subnets/p4jUwqZsA2LuSftroCd3zb4ytH8W99oXKuKVZdsty7eQ3rXD6.json`. Un archivo de configuración de ejemplo es: - -```json -{ - "validatorOnly": false, - "consensusParameters": { - "k": 25, - "alpha": 18 - } -} -``` - -:::tip -Por defecto, ninguno de estos directorios y/o archivos existe. Deberá crearlos manualmente si es necesario. -::: - -#### `--subnet-config-content` (string) - -Como alternativa a `--subnet-config-dir`, permite especificar parámetros codificados en base64 para una Subnet. - -## Versión - -#### `--version` (booleano) - -Si es `true`, imprime la versión y sale. Por defecto es `false`. - -## Opciones Avanzadas - -Las siguientes opciones pueden afectar la corrección de un nodo. Solo los usuarios avanzados deben cambiar estas opciones. - -### Gossiping - -#### `--consensus-accepted-frontier-gossip-validator-size` (uint) - -Número de validadores a los que hacer gossip de la frontera aceptada. Por defecto es `0`. - -#### `--consensus-accepted-frontier-gossip-non-validator-size` (uint) - -Número de no validadores a los que hacer gossip de la frontera aceptada. Por defecto es `0`. - -#### `--consensus-accepted-frontier-gossip-peer-size` (uint) - -Número de pares a los que hacer gossip de la frontera aceptada. Por defecto es `15`. - -#### `--consensus-accepted-frontier-gossip-frequency` (duración) - -Tiempo entre gossipeos de fronteras aceptadas. Por defecto es `10s`. - -#### `--consensus-on-accept-gossip-validator-size` (uint) - -Número de validadores a los que hacer gossip de cada contenedor aceptado. Por defecto es `0`. - -#### `--consensus-on-accept-gossip-non-validator-size` (uint) - -Número de no validadores a los que hacer gossip de cada contenedor aceptado. Por defecto es `0`. - -#### `--consensus-on-accept-gossip-peer-size` (uint) - -Número de pares a los que hacer gossip de cada contenedor aceptado. Por defecto es `10`. - -### Benchlist - -#### `--benchlist-duration` (duración) - -Cantidad máxima de tiempo que un par está en la lista de bench después de superar `--benchlist-fail-threshold`. Por defecto es `15m`. - -#### `--benchlist-fail-threshold` (int) - -Número de consultas fallidas consecutivas a un nodo antes de ponerlo en bench (asumiendo que todas las consultas a él fallarán). Por defecto es `10`. - -#### `--benchlist-min-failing-duration` (duración) - -Cantidad mínima de tiempo que las consultas a un par deben estar fallando antes de que el par sea puesto en bench. Por defecto es `150s`. - -### Parámetros de Consenso - -:::note -Algunos de estos parámetros solo se pueden establecer en una red local o privada, no en la Testnet Fuji o en Mainnet -::: - -#### `--consensus-shutdown-timeout` (duración) - -Tiempo de espera antes de matar una cadena no receptiva. Por defecto es `5s`. - -#### `--create-asset-tx-fee` (int) - -Tarifa de transacción, en nAVAX, para transacciones que crean nuevos activos. Por defecto es `10000000` nAVAX (.01 AVAX) por transacción. Esto solo se puede cambiar en una red local. - -#### `--create-subnet-tx-fee` (int) - -Tarifa de transacción, en nAVAX, para transacciones que crean nuevas Subnets. Por defecto es `1000000000` nAVAX (1 AVAX) por transacción. Esto solo se puede cambiar en una red local. - -#### `--create-blockchain-tx-fee` (int) - -Tarifa de transacción, en nAVAX, para transacciones que crean nuevas blockchains. Por defecto es `1000000000` nAVAX (1 AVAX) por transacción. Esto solo se puede cambiar en una red local. - -#### `--transform-subnet-tx-fee` (int) - -Tarifa de transacción, en nAVAX, para transacciones que transforman Subnets. Por defecto es `1000000000` nAVAX (1 AVAX) por transacción. Esto solo se puede cambiar en una red local. - -#### `--add-primary-network-validator-fee` (int) - -Tarifa de transacción, en nAVAX, para transacciones que agregan nuevos validadores de la red primaria. Por defecto es 0. Esto solo se puede cambiar en una red local. - -#### `--add-primary-network-delegator-fee` (int) - -Tarifa de transacción, en nAVAX, para transacciones que agregan nuevos delegadores de la red primaria. Por defecto es 0. Esto solo se puede cambiar en una red local. - -#### `--add-subnet-validator-fee` (int) - -Tarifa de transacción, en nAVAX, para transacciones que agregan nuevos validadores de Subnets. Por defecto es `10000000` nAVAX (.01 AVAX). - -#### `--add-subnet-delegator-fee` (int) - -Tarifa de transacción, en nAVAX, para transacciones que agregan nuevos delegadores de Subnets. Por defecto es `10000000` nAVAX (.01 AVAX). - -#### `--min-delegator-stake` (int) - -La participación mínima, en nAVAX, que se puede delegar a un validador de la Red Primaria. - -Por defecto es `25000000000` (25 AVAX) en Mainnet. Por defecto es `5000000` (.005 AVAX) en Test Net. Esto solo se puede cambiar en una red local. - -#### `--min-delegation-fee` (int) - -La tarifa mínima de delegación que se puede cobrar por la delegación en la Red Primaria, multiplicada por `10,000`. Debe estar en el rango `[0, 1000000]`. Por defecto es `20000` (2%) en Mainnet. Esto solo se puede cambiar en una red local. - -#### `--min-stake-duration` (duración) - -Duración mínima de stake. El valor por defecto en Mainnet es `336h` (dos semanas). Esto solo se puede cambiar en una red local. Esto se aplica tanto a los períodos de delegación como de validación. - -#### `--min-validator-stake` (int) - -La participación mínima, en nAVAX, requerida para validar la Red Primaria. Esto solo se puede cambiar en una red local. - -Por defecto es `2000000000000` (2,000 AVAX) en Mainnet. Por defecto es `5000000` (.005 AVAX) en Test Net. - -#### `--max-stake-duration` (duración) - -La duración máxima de apuesta, en horas. Por defecto es `8760h` (365 días) en Mainnet. Esto solo se puede cambiar en una red local. - -#### `--max-validator-stake` (int) - -La apuesta máxima, en nAVAX, que se puede colocar en un validador en la red primaria. Por defecto es `3000000000000000` (3,000,000 AVAX) en Mainnet. Esto incluye la apuesta proporcionada tanto por el validador como por los delegadores al validador. Esto solo se puede cambiar en una red local. - -#### `--stake-minting-period` (duración) - -Período de consumo de la función de apuesta, en horas. El valor predeterminado en Mainnet es `8760h` (365 días). Esto solo se puede cambiar en una red local. - -#### `--stake-max-consumption-rate` (uint) - -El porcentaje máximo de la tasa de consumo para el suministro de tokens restante en el período de acuñación, que es de 1 año en Mainnet. Por defecto es `120,000`, que es un 12% por año. Esto solo se puede cambiar en una red local. - -#### `--stake-min-consumption-rate` (uint) - -El porcentaje mínimo de la tasa de consumo para el suministro de tokens restante en el período de acuñación, que es de 1 año en Mainnet. Por defecto es `100,000`, que es un 10% por año. Esto solo se puede cambiar en una red local. - -#### `--stake-supply-cap` (uint) - -El suministro máximo de apuestas, en nAVAX, que se pueden colocar en un validador. Por defecto es `720,000,000,000,000,000` nAVAX. Esto solo se puede cambiar en una red local. - -#### `--tx-fee` (int) - -La cantidad requerida de nAVAX a quemar para que una transacción sea válida en la X-Chain, y para transacciones de importación/exportación en la P-Chain. Este parámetro requiere acuerdo de la red en su forma actual. Cambiar este valor desde el valor predeterminado solo debe hacerse en redes privadas o redes locales. Por defecto, son `1,000,000` nAVAX por transacción. - -#### `--uptime-requirement` (float) - -Fracción de tiempo que un validador debe estar en línea para recibir recompensas. Por defecto es `0.8`. Esto solo se puede cambiar en una red local. - -#### `--uptime-metric-freq` (duración) - -Frecuencia de renovación de la métrica de tiempo de actividad promedio de este nodo. Por defecto es `30s`. - -#### Parámetros de Snow - -##### `--snow-concurrent-repolls` (int) - -El consenso de Snow requiere repollar transacciones que se emiten durante períodos de baja -uso de la red. Este parámetro permite definir qué tan agresivo será el cliente en -finalizar estas transacciones pendientes. Esto solo debe cambiarse después de -considerar cuidadosamente los compromisos del consenso de Snow. El valor debe ser al -menos `1` y como máximo `--snow-rogue-commit-threshold`. Por defecto es `4`. - -##### `--snow-sample-size` (int) - -El consenso de Snow define `k` como el número de validadores que se muestrean durante -cada encuesta de red. Este parámetro permite definir el valor `k` utilizado para -consenso. Esto solo debe cambiarse después de considerar cuidadosamente los -compromisos del consenso de Snow. El valor debe ser al menos `1`. Por defecto es `20`. - -##### `--snow-quorum-size` (int) - -El consenso de Snow define `alpha` como el número de validadores que deben preferir una -transacción durante cada encuesta de red para aumentar la confianza en la -transacción. Este parámetro nos permite definir el valor `alpha` utilizado para el consenso. -Esto solo debe cambiarse después de considerar cuidadosamente los compromisos del consenso de Snow. El -valor debe ser mayor que `k/2`. Por defecto es `15`. - -##### `--snow-virtuous-commit-threshold` (int) - -El consenso de Snow define `beta1` como el número de encuestas consecutivas en las que una -transacción virtuosa debe aumentar su confianza para que sea aceptada. Este -parámetro nos permite definir el valor `beta1` utilizado para el consenso. Esto solo debe -cambiarse después de considerar cuidadosamente los compromisos del consenso de Snow. El -valor debe ser al menos `1`. Por defecto es `15`. - -##### `--snow-rogue-commit-threshold` (int) - -El consenso de Snow define `beta2` como el número de encuestas consecutivas en las que una -transacción rogue debe aumentar su confianza para que sea aceptada. Este parámetro -nos permite definir el valor `beta2` utilizado para el consenso. Esto solo debe cambiarse -después de considerar cuidadosamente los compromisos del consenso de Snow. El valor debe -ser al menos `beta1`. Por defecto es `20`. - -##### `--snow-optimal-processing` (int) - -Número óptimo de elementos de procesamiento en el consenso. El valor debe ser al menos `1`. Por defecto es `50`. - -##### `--snow-max-processing` (int) - -Número máximo de elementos de procesamiento que se considerarán saludables. Informa de no saludable -si hay más de este número de elementos pendientes. El valor debe ser al menos -`1`. Por defecto es `1024`. - -##### `--snow-max-time-processing` (duración) - -Tiempo máximo que un elemento debe estar en proceso y aún así estar saludable. -Informa de no saludable si hay un elemento en proceso durante más tiempo que esta duración. -El valor debe ser mayor que `0`. Por defecto es `2m`. - -### Parámetros de ProposerVM - -#### `--proposervm-use-current-height` (bool) - -Hacer que ProposerVM informe siempre la altura del último bloque aceptado en la P-chain. Por defecto es `false`. - -### Perfilado continuo - -Puede configurar su nodo para que ejecute continuamente perfiles de memoria/CPU y guarde los más recientes. El perfilado continuo de memoria/CPU está habilitado si se establece `--profile-continuous-enabled`. - -#### `--profile-continuous-enabled` (boolean) - -Si la aplicación debe producir continuamente perfiles de rendimiento. Por defecto es falso (no habilitado). - -#### `--profile-dir` (string) - -Si el perfilado está habilitado, el nodo ejecuta continuamente perfiles de memoria/CPU y los coloca en este directorio. Por defecto es `$HOME/.avalanchego/profiles/`. - -#### `--profile-continuous-freq` (duración) - -Con qué frecuencia se crea un nuevo perfil de CPU/memoria. Por defecto es `15m`. - -#### `--profile-continuous-max-files` (int) - -Número máximo de archivos de perfiles de CPU/memoria que se mantendrán. Por defecto son 5. - -### Salud - -#### `--health-check-frequency` (duración) - -La frecuencia con la que se ejecuta la comprobación de salud. Por defecto es `30s`. - -#### `--health-check-averager-halflife` (duración) - -Vida media de los promedios utilizados en las comprobaciones de salud (para medir la tasa de fallos de mensajes, por ejemplo). Un valor más grande --> cálculo de promedios menos volátil. Por defecto es `10s`. - -### Red - -#### `--network-allow-private-ips` (bool) - -Permite que el nodo se conecte a pares con IPs privadas. Por defecto es `true`. - -#### `--network-compression-type` (string) - -El tipo de compresión a utilizar al enviar mensajes a los pares. Por defecto es `gzip`. -Debe ser uno de [`gzip`, `zstd`, `none`]. - -Los nodos pueden manejar mensajes entrantes comprimidos con `gzip`, pero por defecto envían mensajes comprimidos con `zstd`. - -#### `--network-initial-timeout` (duración) - -Valor de tiempo de espera inicial del administrador de tiempo de espera adaptativo. Por defecto es `5s`. - -#### `--network-initial-reconnect-delay` (duración) - -Duración de retraso inicial que se debe esperar antes de intentar reconectar un par. Por defecto es `1s`. - -#### `--network-max-reconnect-delay` (duración) - -Duración máxima de retraso que se debe esperar antes de intentar reconectar un par. Por defecto es `1h`. - -#### `--network-minimum-timeout` (duración) - -Valor de tiempo de espera mínimo del administrador de tiempo de espera adaptativo. Por defecto es `2s`. - -#### `--network-maximum-timeout` (duración) - -Valor de tiempo de espera máximo del administrador de tiempo de espera adaptativo. Por defecto es `10s`. - -#### `--network-maximum-inbound-timeout` (duración) - -Valor de tiempo de espera máximo de un mensaje entrante. Define la duración dentro de la cual se debe cumplir un -mensaje entrante. Los mensajes entrantes que contengan un plazo límite superior -a este valor se anularán con este valor. Por defecto es `10s`. - -#### `--network-timeout-halflife` (duración) - -Vida media utilizada al calcular la latencia de red promedio. Un valor más grande --> menos -cálculo de latencia de red volátil. Por defecto es `5m`. - -#### `--network-timeout-coefficient` (duración) - -Las solicitudes a los pares expirarán después de \[`network-timeout-coefficient`\] \* \[latencia promedio de la solicitud\]. El valor predeterminado es `2`. - -#### `--network-read-handshake-timeout` (duración) - -Valor de tiempo de espera para leer mensajes de saludo. El valor predeterminado es `15s`. - -#### `--network-ping-timeout` (duración) - -Valor de tiempo de espera para Ping-Pong con un par. El valor predeterminado es `30s`. - -#### `--network-ping-frequency` (duración) - -Frecuencia de envío de pings a otros pares. El valor predeterminado es `22.5s`. - -#### `--network-health-min-conn-peers` (uint) - -El nodo informará que está en mal estado si está conectado a menos de esta cantidad de pares. El valor predeterminado es `1`. - -#### `--network-health-max-time-since-msg-received` (duración) - -El nodo informará que está en mal estado si no ha recibido un mensaje durante este tiempo. El valor predeterminado es `1m`. - -#### `--network-health-max-time-since-msg-sent` (duración) - -La capa de red informa que está en mal estado si no ha enviado un mensaje durante al menos este tiempo. El valor predeterminado es `1m`. - -#### `--network-health-max-portion-send-queue-full` (float) - -El nodo informará que está en mal estado si su cola de envío está más llena que esta proporción. Debe estar en \[0,1\]. El valor predeterminado es `0.9`. - -#### `--network-health-max-send-fail-rate` (float) - -El nodo informará que está en mal estado si falla más de esta proporción de envíos de mensajes. Debe estar en \[0,1\]. El valor predeterminado es `0.25`. - -#### `--network-health-max-outstanding-request-duration` (duración) - -El nodo informa que está en mal estado si ha habido una solicitud pendiente durante esta duración. El valor predeterminado es `5m`. - -#### `--network-max-clock-difference` (duración) - -Valor máximo de diferencia de reloj permitida entre este nodo y los pares. El valor predeterminado es `1m`. - -#### `--network-require-validator-to-connect` (bool) - -Si es verdadero, este nodo solo mantendrá una conexión con otro nodo si este nodo es un validador, el otro nodo es un validador o el otro nodo es un beacon. - -#### `--network-tcp-proxy-enabled` (bool) - -Requiere que todas las conexiones P2P se inicien con una cabecera de proxy TCP. El valor predeterminado es `false`. - -#### `--network-tcp-proxy-read-timeout` (duración) - -Duración máxima para esperar una cabecera de proxy TCP. El valor predeterminado es `3s`. - -#### `--network-outbound-connection-timeout` (duración) - -Tiempo de espera al marcar un par. El valor predeterminado es `30s`. - -### Limitación de velocidad de mensajes - -Estas banderas gobiernan la limitación de velocidad de los mensajes entrantes y salientes. Para obtener más información sobre la limitación de velocidad y las banderas a continuación, consulte el paquete `throttling` en AvalancheGo. - -#### Basado en CPU - -Limitación de velocidad basada en cuánto uso de CPU causa un par. - -##### `--throttler-inbound-cpu-validator-alloc` (float) - -Número de CPU asignadas para uso de validadores. El valor debe estar en el rango (0, recuento total de núcleos]. El valor predeterminado es la mitad del número de CPU en la máquina. - -##### `--throttler-inbound-cpu-max-recheck-delay` (duración) - -En el limitador de velocidad de CPU, verifique al menos con esta frecuencia si el uso de CPU del nodo ha disminuido a un nivel aceptable. El valor predeterminado es `5s`. - -##### `--throttler-inbound-disk-max-recheck-delay` (duración) - -En el limitador de velocidad de red basado en disco, verifique al menos con esta frecuencia si el uso de disco del nodo ha disminuido a un nivel aceptable. El valor predeterminado es `5s`. - -##### `--throttler-inbound-cpu-max-non-validator-usage` (float) - -Número de CPU que, si se utilizan por completo, limitarán la velocidad de todos los no validadores. El valor debe estar en el rango [0, recuento total de núcleos]. El valor predeterminado es el 80% del número de CPU en la máquina. - -##### `--throttler-inbound-cpu-max-non-validator-node-usage` (float) - -Número máximo de CPU que un no validador puede utilizar. El valor debe estar en el rango [0, recuento total de núcleos]. El valor predeterminado es el número de CPU / 8. - -##### `--throttler-inbound-disk-validator-alloc` (float) - -Número máximo de lecturas/escrituras de disco por segundo para asignar para uso de validadores. Debe ser > 0. El valor predeterminado es `1000 GiB/s`. - -##### `--throttler-inbound-disk-max-non-validator-usage` (float) - -Número de lecturas/escrituras de disco por segundo que, si se utilizan por completo, limitarán la velocidad de todos los no validadores. Debe ser >= 0. El valor predeterminado es `1000 GiB/s`. - -##### `--throttler-inbound-disk-max-non-validator-node-usage` (float) - -Número máximo de lecturas/escrituras de disco por segundo que un no validador puede utilizar. Debe ser >= 0. El valor predeterminado es `1000 GiB/s`. - -#### Basado en ancho de banda - -Limitación de velocidad basada en el ancho de banda que utiliza un par. - -##### `--throttler-inbound-bandwidth-refill-rate` (uint) - -Uso máximo promedio de ancho de banda entrante de un par, en bytes por segundo. Consulte la interfaz `throttling.BandwidthThrottler`. El valor predeterminado es `512`. - -##### `--throttler-inbound-bandwidth-max-burst-size` (uint) - -Ancho de banda entrante máximo que un nodo puede usar a la vez. Consulte la interfaz `throttling.BandwidthThrottler`. El valor predeterminado es `2 MiB`. - -#### Basado en el tamaño del mensaje - -Limitación de velocidad basada en el tamaño total, en bytes, de los mensajes no procesados. - -##### `--throttler-inbound-at-large-alloc-size` (uint) - -Tamaño, en bytes, de la asignación en grande en el limitador de velocidad de mensajes entrantes. El valor predeterminado es `6291456` (6 MiB). - -##### `--throttler-inbound-validator-alloc-size` (uint) - -Tamaño, en bytes, de la asignación de validador en el limitador de velocidad de mensajes entrantes. El valor predeterminado es `33554432` (32 MiB). - -##### `--throttler-inbound-node-max-at-large-bytes` (uint) - -Número máximo de bytes que un nodo puede tomar de la asignación en grande del limitador de velocidad de mensajes entrantes. El valor predeterminado es `2097152` (2 MiB). - -#### Basado en el número de mensajes - -Limitación de velocidad basada en el número de mensajes no procesados. - -##### `--throttler-inbound-node-max-processing-msgs` (uint) - -El nodo dejará de leer mensajes de un par cuando esté procesando esta cantidad de mensajes del par. Reanudará la lectura de mensajes del par cuando esté procesando menos de esta cantidad de mensajes. El valor predeterminado es `1024`. - -#### Saliente - -Limitación de velocidad para mensajes salientes. - -##### `--throttler-outbound-at-large-alloc-size` (uint) - -Tamaño, en bytes, de la asignación en grande en el limitador de velocidad de mensajes salientes. El valor predeterminado es `33554432` (32 MiB). - -##### `--throttler-outbound-validator-alloc-size` (uint) - -Tamaño, en bytes, de la asignación de validador en el limitador de velocidad de mensajes salientes. El valor predeterminado es `33554432` (32 MiB). - -##### `--throttler-outbound-node-max-at-large-bytes` (uint) - -Número máximo de bytes que un nodo puede tomar de la asignación en grande del limitador de velocidad de mensajes salientes. El valor predeterminado es `2097152` (2 MiB). - -### Limitación de velocidad de conexión - -#### `--network-inbound-connection-throttling-cooldown` (duración) - -El nodo mejorará una conexión entrante desde una IP dada como máximo una vez dentro de esta duración. El valor predeterminado es `10s`. Si es 0 o negativo, no considerará la recencia de la última mejora al decidir si mejorar. - -#### `--network-inbound-connection-throttling-max-conns-per-sec` (uint) - -El nodo aceptará como máximo esta cantidad de conexiones entrantes por segundo. El valor predeterminado es `512`. - -#### `--network-outbound-connection-throttling-rps` (uint) - -El nodo realiza como máximo esta cantidad de intentos de conexión saliente por segundo. El valor predeterminado es `50`. - -### Chismes de la lista de pares que hacen gossiping - -Los nodos hacen gossiping de pares entre sí para que cada nodo pueda tener una lista de pares actualizada. Un nodo hace gossiping de `--network-peer-list-num-validator-ips` IPs de validadores a `--network-peer-list-validator-gossip-size` validadores, `--network-peer-list-non-validator-gossip-size` no validadores y `--network-peer-list-peers-gossip-size` pares cada `--network-peer-list-gossip-frequency`. - -#### `--network-peer-list-num-validator-ips` (int) - -Número de IPs de validadores para hacer gossiping a otros nodos. Por defecto: `15`. - -#### `--network-peer-list-validator-gossip-size` (int) - -Número de validadores a los que el nodo hará gossiping de la lista de pares. Por defecto: `20`. - -#### `--network-peer-list-non-validator-gossip-size` (int) - -Número de no validadores a los que el nodo hará gossiping de la lista de pares. Por defecto: `0`. - -#### `--network-peer-list-peers-gossip-size` (int) - -Número total de pares (incluyendo no validadores o validadores) a los que el nodo hará gossiping de la lista de pares. Por defecto: `0`. - -#### `--network-peer-list-gossip-frequency` (duración) - -Frecuencia para hacer gossiping de los pares a otros nodos. Por defecto: `1m`. - -#### `--network-peer-read-buffer-size` (int) - -Tamaño del búfer en el que se leen los mensajes de los pares (hay un búfer por cada par). Por defecto: `8` KiB (8192 bytes). - -#### `--network-peer-write-buffer-size` (int) - -Tamaño del búfer en el que se escriben los mensajes de los pares (hay un búfer por cada par). Por defecto: `8` KiB (8192 bytes). - -### Seguimiento del uso de recursos - -#### `--meter-vm-enabled` (bool) - -Habilitar las VM de medición para rastrear el rendimiento de la VM con más precisión. Por defecto: `true`. - -#### `--system-tracker-frequency` (duración) - -Frecuencia para comprobar el uso real del sistema de los procesos rastreados. Más comprobaciones frecuentes --> métricas de uso más precisas, pero más caro de rastrear. Por defecto: `500ms`. - -#### `--system-tracker-processing-halflife` (duración) - -Vida media a utilizar para el rastreador de solicitudes de procesamiento. Una vida media más grande --> las métricas de uso cambian más lentamente. Por defecto: `15s`. - -#### `--system-tracker-cpu-halflife` (duración) - -Vida media a utilizar para el rastreador de CPU. Una vida media más grande --> las métricas de uso de la CPU cambian más lentamente. Por defecto: `15s`. - -#### `--system-tracker-disk-halflife` (duración) - -Vida media a utilizar para el rastreador de disco. Una vida media más grande --> las métricas de uso de disco cambian más lentamente. Por defecto: `1m`. - -#### `--system-tracker-disk-required-available-space` (uint) - -Número mínimo de bytes disponibles en disco, por debajo de los cuales el nodo se apagará. Por defecto: `536870912` (512 MiB). - -#### `--system-tracker-disk-warning-threshold-available-space` (uint) - -Umbral de advertencia para el número de bytes disponibles en disco, por debajo del cual el nodo se considerará no saludable. Debe ser >= `--system-tracker-disk-required-available-space`. Por defecto: `1073741824` (1 GiB). - -### Plugins - -#### `--plugin-dir` (string) - -Establece el directorio para los [plugins de VM](/build/vm/intro.md). El valor por defecto es `$HOME/.avalanchego/plugins`. - -### Configuraciones de Máquinas Virtuales (VM) - -#### `--vm-aliases-file (string)` - -Ruta del archivo JSON que define alias para IDs de Máquinas Virtuales. Por defecto: `~/.avalanchego/configs/vms/aliases.json`. Esta bandera se ignora si se especifica `--vm-aliases-file-content`. Ejemplo de contenido: - -```json -{ - "tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH": [ - "timestampvm", - "timerpc" - ] -} -``` - -El ejemplo anterior asigna los alias "timestampvm" y "timerpc" a la VM cuyo ID es "tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH". - -`--vm-aliases-file-content` (string) - -Como alternativa a `--vm-aliases-file`, permite especificar los alias codificados en base64 para IDs de Máquinas Virtuales. - -### Indexación - -#### `--index-allow-incomplete` (boolean) - -Si es verdadero, permite ejecutar el nodo de una manera que podría hacer que un índice pierda transacciones. Ignorado si el índice está desactivado. Por defecto: `false`. - -### Enrutador - -#### `--router-health-max-drop-rate` (float) - -El nodo se reporta como no saludable si el enrutador deja caer más de esta proporción de mensajes. Por defecto: `1`. - -#### `--router-health-max-outstanding-requests` (uint) - -El nodo se reporta como no saludable si hay más de esta cantidad de solicitudes de consenso pendientes (Get, PullQuery, etc.) en todas las cadenas. Por defecto: `1024`. diff --git a/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/chain-config-flags.md b/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/chain-config-flags.md deleted file mode 100644 index 2f3f2bca6a5..00000000000 --- a/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/chain-config-flags.md +++ /dev/null @@ -1,735 +0,0 @@ ---- -tags: [Nodos] -description: Referencia de todas las opciones de configuración y banderas disponibles para la cadena. -sidebar_label: Configuraciones de la Cadena -pagination_label: Configuraciones de la Cadena -sidebar_position: 1 ---- - -# Configuraciones de la Cadena - -Algunas cadenas permiten que el operador del nodo proporcione una configuración personalizada. -AvalancheGo puede leer las configuraciones de la cadena desde archivos y pasarlas a las -cadenas correspondientes durante la inicialización. - -AvalancheGo busca estos archivos en el directorio especificado por -la bandera `--chain-config-dir` de AvalancheGo, como se documenta -[aquí](/nodes/configure/avalanchego-config-flags.md#--chain-config-dir-string). Si se omite, el valor -por defecto es `$HOME/.avalanchego/configs/chains`. Este directorio puede tener -subdirectorios cuyos nombres son ID de cadena o alias de cadena. Cada subdirectorio -contiene la configuración de la cadena especificada en el nombre del directorio. Cada -subdirectorio debe contener un archivo llamado `config`, cuyo valor se pasa -cuando se inicializa la cadena correspondiente (ver más abajo para la extensión). Por -ejemplo, la configuración para la C-Chain debería estar en: -`{chain-config-dir}/C/config.json`. - -Esto también se aplica a las Subnets, por ejemplo, si el ID de cadena de una Subnet es -`2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt`, la configuración para esta cadena -debería estar en -`{chain-config-dir}/2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt/config.json` - -:::tip - -Por defecto, ninguno de estos directorios y/o archivos existe. Deberá -crearlos manualmente si es necesario. - -::: - -La extensión de archivo que estos archivos deben tener, y el contenido de estos -archivos, depende de la VM. Por ejemplo, algunas cadenas pueden esperar `config.txt` mientras -que otras esperan `config.json`. Si se proporcionan varios archivos con el mismo nombre -pero con extensiones diferentes (por ejemplo, `config.json` y `config.txt`) en el mismo -subdirectorio, AvalancheGo saldrá con un error. - -Para una cadena dada, AvalancheGo seguirá la siguiente secuencia para buscar su -archivo de configuración, donde todos los nombres de carpetas y archivos distinguen entre mayúsculas y minúsculas: - -- Primero busca un subdirectorio de configuración cuyo nombre sea el ID de la cadena - Si no - se encuentra, busca un subdirectorio de configuración cuyo nombre sea el alias principal de la cadena - Si no se encuentra, - busca un subdirectorio de configuración cuyo nombre sea otro alias para la cadena - -Alternativamente, para algunas configuraciones puede ser más conveniente proporcionar la configuración -completamente a través de la línea de comandos. Para eso, puede usar la bandera `--chain-config-content` de AvalancheGo, como se documenta -[aquí](/nodes/configure/avalanchego-config-flags.md#--chain-config-content-string). - -No es necesario proporcionar estas configuraciones personalizadas. Si no se proporcionan, se utilizará una configuración predeterminada específica de la VM. Y los valores de estas -configuraciones predeterminadas se imprimen cuando el nodo se inicia. - -## Configuraciones de la C-Chain - -Para especificar una configuración para la C-Chain, se debe colocar un archivo de configuración JSON en -`{chain-config-dir}/C/config.json`. Este archivo no existe por -defecto. - -Por ejemplo, si `chain-config-dir` tiene el valor predeterminado que es -`$HOME/.avalanchego/configs/chains`, entonces `config.json` debería colocarse en -`$HOME/.avalanchego/configs/chains/C/config.json`. - -La configuración de la C-Chain se imprime en el registro cuando un nodo se inicia. Los valores predeterminados -para cada bandera de configuración se especifican a continuación. - -Los valores predeterminados se anulan solo si se especifican en el archivo de configuración dado. Es -recomendable proporcionar solo valores que sean diferentes de los predeterminados, ya que eso -hace que la configuración sea más resistente a futuros cambios predeterminados. De lo contrario, si -los valores predeterminados cambian, su nodo permanecerá con los valores antiguos, lo que podría -afectar negativamente el funcionamiento de su nodo. - -### Sincronización de Estado - -#### `state-sync-enabled` (booleano) - -Establece en `true` para iniciar la cadena con la sincronización de estado habilitada. El par -descargará el estado de la cadena de los pares hasta un bloque reciente cerca de la punta, luego procederá con -el arranque normal. - -Por defecto, realiza la sincronización de estado si se inicia un nuevo nodo desde cero. Sin embargo, si -se ejecuta con una base de datos existente, por defecto será falso y no realizará la sincronización de estado -en ejecuciones posteriores. - -Tenga en cuenta que si necesita datos históricos, la sincronización de estado no es la opción correcta. -Sin embargo, es suficiente si solo está ejecutando un validador. - -#### `state-sync-skip-resume` (booleano) - -Si se establece en `true`, la cadena no reanudará una operación de sincronización de estado -que no se completó previamente. Normalmente, la cadena debería poder reanudar -la sincronización de estado sin ningún problema. Por defecto, es `false`. - -#### `state-sync-min-blocks` (entero) - -Número mínimo de bloques por delante de la cadena que el nodo local debe preferir -la sincronización de estado sobre el arranque. Si la base de datos del nodo ya está cerca de la -punta de la cadena, el arranque es más eficiente. Por defecto, es `300000`. - -#### `state-sync-ids` (cadena) - -Lista separada por comas de ID de nodo (precedidos de `NodeID-`) para recuperar la sincronización de estado -datos de. Un ejemplo de configuración de este campo sería -`--state-sync-ids="NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg,NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ"`. -Si no se especifica (o está vacío), se seleccionan pares al azar. Por defecto es una cadena vacía (`""`). - -#### `state-sync-server-trie-cache` (entero) - -Tamaño de la caché de trie utilizada para proporcionar datos de sincronización de estado a los pares en MB. Debe ser -un múltiplo de `64`. Por defecto, es `64`. - -### Perfilado Continuo - -#### `continuous-profiler-dir` (cadena) - -Habilita el perfilador continuo (captura un perfil de CPU/Memoria/Bloqueo a un -intervalo especificado). Por defecto es `""`. Si se proporciona una cadena no vacía, se -habilita el perfilador continuo y especifica el directorio para colocar los -perfiles. - -#### `continuous-profiler-frequency` (duración) - -Especifica la frecuencia con la que se ejecuta el perfilador continuo. Por defecto `900000000000` -nanosegundos, que son 15 minutos. - -#### `continuous-profiler-max-files` (entero) - -Especifica el número máximo de perfiles a mantener antes de eliminar los más antiguos. -Por defecto, es `5`. - -### Habilitando APIs Específicas de Avalanche - -#### `snowman-api-enabled` (booleano) - -Habilita la API de Snowman. Por defecto es `false`. - -#### `coreth-admin-api-enabled` (booleano) - -Obsoleto a partir de `v0.12.5`. Use `admin-api-enabled` en su lugar. - -Habilita la API de Admin. Por defecto es `false`. - -#### `coreth-admin-api-dir` (cadena) - -Obsoleto a partir de `v0.12.5`. Use `admin-api-dir` en su lugar. - -Especifica el directorio que la API de Admin utiliza para almacenar perfiles de CPU/Memoria/Bloqueo. -Por defecto es `""`. - -### Habilitando APIs de EVM - -#### `eth-apis` ([]cadena) - -Use el campo `eth-apis` para especificar el conjunto exacto de servicios a habilitar en -su nodo. Si este campo no está configurado, entonces la lista predeterminada será: -`["eth","eth-filter","net","web3","internal-eth","internal-blockchain","internal-transaction"]`. - -:::note - -Los nombres utilizados en esta bandera de configuración se han actualizado en Coreth `v0.8.14`. -Los nombres anteriores que contienen `public-` y `private-` están obsoletos. Si bien -la versión actual continúa aceptando valores obsoletos, es posible que no se admitan -en futuras actualizaciones y se recomienda actualizar a los nuevos valores. - -La asignación de valores obsoletos y su equivalente actualizado es la siguiente: - - -| Obsoleto | Usar en su lugar | -| ---------------------------------- | ---------------------- | -| `public-eth` | `eth` | -| `public-eth-filter` | `eth-filter` | -| `private-admin` | `admin` | -| `private-debug` | `debug` | -| `public-debug` | `debug` | -| `internal-public-eth` | `internal-eth` | -| `internal-public-blockchain` | `internal-blockchain` | -| `internal-public-transaction-pool` | `internal-transaction` | -| `internal-public-tx-pool` | `internal-tx-pool` | -| `internal-public-debug` | `internal-debug` | -| `internal-private-debug` | `internal-debug` | -| `internal-public-account` | `internal-account` | -| `internal-private-personal` | `internal-personal` | - -::: - -:::note - -Si completas este campo, anulará los valores predeterminados, por lo que debes incluir -cada servicio que desees habilitar. - -::: - -#### `eth` - -El nombre de API `public-eth` está obsoleto a partir de la versión 1.7.15, y las API previamente -bajo este nombre se han migrado a `eth`. - -Agrega las siguientes llamadas RPC al espacio de nombres `eth_*`. El valor predeterminado es `true`. - -`eth_coinbase` -`eth_etherbase` - -#### `eth-filter` - -El nombre de API `public-eth-filter` está obsoleto a partir de la versión 1.7.15, y las API -bajo este nombre se han migrado a `eth-filter`. - -Habilita la API de filtro público para el espacio de nombres `eth_*`. El valor predeterminado es `true`. - -Agrega las siguientes llamadas RPC (ver [aquí](https://eth.wiki/json-rpc/API) para -documentación completa): - -- `eth_newPendingTransactionFilter` -- `eth_newPendingTransactions` -- `eth_newAcceptedTransactions` -- `eth_newBlockFilter` -- `eth_newHeads` -- `eth_logs` -- `eth_newFilter` -- `eth_getLogs` -- `eth_uninstallFilter` -- `eth_getFilterLogs` -- `eth_getFilterChanges` - -#### `admin` - -El nombre de API `private-admin` está obsoleto a partir de la versión 1.7.15, y las API -bajo este nombre se han migrado a `admin`. - -Agrega las siguientes llamadas RPC al espacio de nombres `admin_*`. El valor predeterminado es `false`. - -- `admin_importChain` -- `admin_exportChain` - -#### `debug` - -Los nombres de API `private-debug` y `public-debug` están obsoletos a partir de la versión 1.7.15, -y las API previamente bajo estos nombres se han migrado a `debug`. - -Agrega las siguientes llamadas RPC al espacio de nombres `debug_*`. El valor predeterminado es `false`. - -- `debug_dumpBlock` -- `debug_accountRange` -- `debug_preimage` -- `debug_getBadBlocks` -- `debug_storageRangeAt` -- `debug_getModifiedAccountsByNumber` -- `debug_getModifiedAccountsByHash` -- `debug_getAccessibleState` - -#### `net` - -Agrega las siguientes llamadas RPC al espacio de nombres `net_*`. El valor predeterminado es `true`. - -- `net_listening` -- `net_peerCount` -- `net_version` - -Nota: Coreth es una máquina virtual y no tiene acceso directo a la -capa de red, por lo que `net_listening` siempre devuelve verdadero y `net_peerCount` -siempre devuelve 0. Para métricas precisas sobre la capa de red, los usuarios deben usar -las API de AvalancheGo. - -#### `debug-tracer` - -Agrega las siguientes llamadas RPC al espacio de nombres `debug_*`. El valor predeterminado es `false`. - -- `debug_traceChain` -- `debug_traceBlockByNumber` -- `debug_traceBlockByHash` -- `debug_traceBlock` -- `debug_traceBadBlock` -- `debug_intermediateRoots` -- `debug_traceTransaction` -- `debug_traceCall` - -#### `web3` - -Agrega las siguientes llamadas RPC al espacio de nombres `web3_*`. El valor predeterminado es `true`. - -- `web3_clientVersion` -- `web3_sha3` - -#### `internal-eth` - -El nombre de API `internal-public-eth` está obsoleto a partir de la versión 1.7.15, y las API -bajo este nombre se han migrado a `internal-eth`. - -Agrega las siguientes llamadas RPC al espacio de nombres `eth_*`. El valor predeterminado es `true`. - -- `eth_gasPrice` -- `eth_baseFee` -- `eth_maxPriorityFeePerGas` -- `eth_feeHistory` - -#### `internal-blockchain` - -El nombre de API `internal-public-blockchain` está obsoleto a partir de la versión 1.7.15, y las -API previamente bajo este nombre se han migrado a `internal-blockchain`. - -Agrega las siguientes llamadas RPC al espacio de nombres `eth_*`. El valor predeterminado es `true`. - -- `eth_chainId` -- `eth_blockNumber` -- `eth_getBalance` -- `eth_getAssetBalance` -- `eth_getProof` -- `eth_getHeaderByNumber` -- `eth_getHeaderByHash` -- `eth_getBlockByNumber` -- `eth_getBlockByHash` -- `eth_getUncleBlockByNumberAndIndex` -- `eth_getUncleBlockByBlockHashAndIndex` -- `eth_getUncleCountByBlockNumber` -- `eth_getUncleCountByBlockHash` -- `eth_getCode` -- `eth_getStorageAt` -- `eth_call` -- `eth_estimateGas` -- `eth_createAccessList` - -#### `internal-transaction` - -El nombre de API `internal-public-transaction-pool` está obsoleto a partir de la versión 1.7.15, y -las API previamente bajo este nombre se han migrado a `internal-transaction`. - -Agrega las siguientes llamadas RPC al espacio de nombres `eth_*`. El valor predeterminado es `true`. - -- `eth_getBlockTransactionCountByNumber` -- `eth_getBlockTransactionCountByHash` -- `eth_getTransactionByBlockNumberAndIndex` -- `eth_getTransactionByBlockHashAndIndex` -- `eth_getRawTransactionByBlockNumberAndIndex` -- `eth_getRawTransactionByBlockHashAndIndex` -- `eth_getTransactionCount` -- `eth_getTransactionByHash` -- `eth_getRawTransactionByHash` -- `eth_getTransactionReceipt` -- `eth_sendTransaction` -- `eth_fillTransaction` -- `eth_sendRawTransaction` -- `eth_sign` -- `eth_signTransaction` -- `eth_pendingTransactions` -- `eth_resend` - -#### `internal-tx-pool` - -El nombre de API `internal-public-tx-pool` está obsoleto a partir de la versión 1.7.15, y las -API previamente bajo este nombre se han migrado a `internal-tx-pool`. - -Agrega las siguientes llamadas RPC al espacio de nombres `txpool_*`. El valor predeterminado es `false`. - -- `txpool_content` -- `txpool_contentFrom` -- `txpool_status` -- `txpool_inspect` - -#### `internal-debug` - -Los nombres de API `internal-private-debug` e `internal-public-debug` están -obsoletos a partir de la versión 1.7.15, y las API que antes estaban bajo estos nombres se han -migrado a `internal-debug`. - -Agrega las siguientes llamadas RPC al espacio de nombres `debug_*`. El valor predeterminado es `false`. - -- `debug_getHeaderRlp` -- `debug_getBlockRlp` -- `debug_printBlock` -- `debug_chaindbProperty` -- `debug_chaindbCompact` - -#### `debug-handler` - -Agrega las siguientes llamadas RPC al espacio de nombres `debug_*`. El valor predeterminado es `false`. - -- `debug_verbosity` -- `debug_vmodule` -- `debug_backtraceAt` -- `debug_memStats` -- `debug_gcStats` -- `debug_blockProfile` -- `debug_setBlockProfileRate` -- `debug_writeBlockProfile` -- `debug_mutexProfile` -- `debug_setMutexProfileFraction` -- `debug_writeMutexProfile` -- `debug_writeMemProfile` -- `debug_stacks` -- `debug_freeOSMemory` -- `debug_setGCPercent` - -#### `internal-account` - -El nombre de API `internal-public-account` está obsoleto a partir de la versión 1.7.15, y las API -que antes estaban bajo este nombre se han migrado a `internal-account`. - -Agrega las siguientes llamadas RPC al espacio de nombres `eth_*`. El valor predeterminado es `true`. - -- `eth_accounts` - -#### `internal-personal` - -El nombre de API `internal-private-personal` está obsoleto a partir de la versión 1.7.15, y las -API que antes estaban bajo este nombre se han migrado a `internal-personal`. - -Agrega las siguientes llamadas RPC al espacio de nombres `personal_*`. El valor predeterminado es `false`. - -- `personal_listAccounts` -- `personal_listWallets` -- `personal_openWallet` -- `personal_deriveAccount` -- `personal_newAccount` -- `personal_importRawKey` -- `personal_unlockAccount` -- `personal_lockAccount` -- `personal_sendTransaction` -- `personal_signTransaction` -- `personal_sign` -- `personal_ecRecover` -- `personal_signAndSendTransaction` -- `personal_initializeWallet` -- `personal_unpair` - -### Configuración de la API - -#### `rpc-gas-cap` (int) - -El gas máximo que consumirá una llamada RPC (usado en `eth_estimateGas` y -`eth_call`). El valor predeterminado es `50,000,000`. - -#### `rpc-tx-fee-cap` (int) - -Límite global de tarifa de transacción (precio \* `gaslimit`) (medido en AVAX) para -variantes de send-transaction. El valor predeterminado es `100`. - -#### `api-max-duration` (duration) - -Duración máxima de una llamada de API. Si las llamadas de API exceden esta duración, se agotará el tiempo de espera. El valor predeterminado es `0` (sin máximo). - -#### `api-max-blocks-per-request` (int) - -Número máximo de bloques para servir por solicitud de `getLogs`. El valor predeterminado es `0` (sin máximo). - -#### `ws-cpu-refill-rate` (duration) - -La tasa de relleno especifica la cantidad máxima de tiempo de CPU que se asignará a una sola -conexión por segundo. El valor predeterminado es sin máximo (`0`). - -#### `ws-cpu-max-stored` (duration) - -Especifica la cantidad máxima de tiempo de CPU que se pueden almacenar para una sola conexión WS. El valor predeterminado es sin máximo (`0`). - -#### `allow-unfinalized-queries` (boolean) - -Permite consultas de bloques/transacciones no finalizadas (aún no aceptadas). El valor predeterminado es `false`. - -#### `accepted-cache-size` `(int) - -Especifica la profundidad para mantener encabezados y registros aceptados en la caché. Esto -es particularmente útil para mejorar el rendimiento de `eth_getLogs` para registros recientes. - -### Pool de transacciones - -#### `local-txs-enabled` (boolean) - -Habilita el manejo de transacciones locales (prioriza las transacciones enviadas a través -de este nodo). El valor predeterminado es `false`. - -#### `allow-unprotected-txs` (boolean) - -Si es `true`, las API permitirán que se emitan transacciones que no están protegidas contra reproducción -(EIP-155) a través de este nodo. El valor predeterminado es `false`. - -#### `allow-unprotected-tx-hashes` ([]TxHash) - -Especifica una matriz de hashes de transacciones que se deben permitir pasar -la protección de reproducción. Esta bandera está destinada a operadores de nodos que desean explícitamente -permitir que se emitan transacciones específicas a través de su API. El valor predeterminado es una lista vacía. - -#### `tx-regossip-frequency` (duration) - -Obsoleto a partir de `v0.12.5`. Usar en su lugar `regossip-frequency`. - -Cantidad de tiempo que debe transcurrir antes de intentar volver a propagar una transacción -que ya se propagó una vez. El valor predeterminado es `60000000000` nanosegundos, que es -1 minuto. - -#### `tx-pool-price-limit` (int) - -Precio mínimo de gas para exigir la aceptación en la piscina. El valor predeterminado es 1 wei. - -#### `tx-pool-price-bump` (int) - -Porcentaje mínimo de aumento de precio para reemplazar una transacción que ya existe (nonce). El valor predeterminado es 10%. - -#### `tx-pool-account-slots` (int) - -Número de espacios de transacción ejecutables garantizados por cuenta. El valor predeterminado es 16. - -#### `tx-pool-global-slots` (int) - -Número máximo de espacios de transacción ejecutables para todas las cuentas. El valor predeterminado es 5120. - -#### `tx-pool-account-queue` (int) - -Número máximo de espacios de transacción no ejecutables permitidos por cuenta. El valor predeterminado es 64. - -#### `tx-pool-global-queue` (int) - -Número máximo de espacios de transacción no ejecutables para todas las cuentas. El valor predeterminado es 1024. - -### Métricas - -#### `metrics-enabled` (boolean) - -Habilita las métricas. El valor predeterminado es `false`. - -#### `metrics-expensive-enabled` (boolean) - -Habilita métricas costosas. El valor predeterminado es `false`. - -### Instantáneas - -#### `snapshot-async` (boolean) - -Si es `true`, permite que la generación de instantáneas se ejecute de forma asíncrona. El valor predeterminado es -`true`. - -#### `snapshot-verification-enabled` (boolean) - -Si es `true`, verifica la instantánea completa después de que se ha generado. El valor predeterminado es `false`. - -### Registro - -#### `log-level` (string) - -Define el nivel de registro para la cadena. Debe ser uno de `"trace"`, `"debug"`, `"info"`, -`"warn"`, `"error"`, `"crit"`. El valor predeterminado es `"info"`. - -#### `log-json-format` (bool) - -Si es `true`, cambia los registros al formato JSON. El valor predeterminado es `false`. - -### Configuración de Keystore - -#### `keystore-directory` (string) - -El directorio que contiene las claves privadas. Puede ser una ruta relativa. Si -está vacío, utiliza un directorio temporal en `coreth-keystore`. El valor predeterminado es una cadena vacía (`""`). - -#### `keystore-external-signer` (string) - -Especifica una URI externa para un firmante de tipo clef. El valor predeterminado es una cadena vacía -(`""` como no habilitado). - -#### `keystore-insecure-unlock-allowed` (bool) - -Si es `true`, permite desbloquear cuentas en un entorno HTTP inseguro. El valor predeterminado es `false`. - -### Base de Datos - -#### `trie-clean-cache` (int) - -Tamaño de la caché utilizada para nodos de trie limpios (en MB). Debe ser un múltiplo de `64`. Por defecto, es `512`. - -#### `trie-dirty-cache` (int) - -Tamaño de la caché utilizada para nodos de trie sucios (en MB). Cuando los nodos sucios superan este límite, se escriben en disco. Por defecto, es `256`. - -#### `trie-dirty-commit-target` (int) - -Límite de memoria para apuntar en la caché sucia antes de realizar un commit (en MB). Por defecto, es `20`. - -#### `trie-prefetcher-parallelism` (int) - -Máximo de lecturas de disco concurrentes que el prebuscador de trie debe realizar a la vez. Por defecto, es `16`. - -#### `snapshot-cache` (int) - -Tamaño de la caché limpia de la capa de disco de instantáneas (en MB). Debe ser un múltiplo de `64`. Por defecto, es `256`. - -#### `trie-clean-journal` (string) - -Directorio para guardar la caché limpia del trie (debe estar poblado para habilitar el registro de la caché limpia del trie). Vacío y deshabilitado por defecto. - -#### `trie-clean-rejournal` (duration) - -Frecuencia para volver a registrar la caché limpia del trie en disco (mínimo 1 minuto, debe estar poblado para habilitar el registro de la caché limpia del trie). - -#### `acceptor-queue-limit` (int) - -Especifica el número máximo de bloques en cola durante la aceptación de bloques antes de bloquearse en Aceptar. Por defecto, es `64`. - -#### `commit-interval` (int) - -Especifica el intervalo de commit en el que persistir el trie de merkle en disco. Por defecto, es `4096`. - -#### `pruning-enabled` (boolean) - -Si es `true`, se habilitará el recorte de la base de datos de datos históricos obsoletos. Esto reduce la cantidad de datos escritos en disco, pero no elimina ningún estado que se haya escrito en el disco anteriormente. Esta bandera debe establecerse en `false` para nodos que necesiten acceso a todos los datos en raíces históricas. El recorte se hará sólo para nuevos datos. Por defecto, es `false` en la versión 1.4.9, y `true` en versiones posteriores. - -:::note - -Si un nodo se ejecuta alguna vez con `pruning-enabled` como `false` (modo de archivo), establecer `pruning-enabled` en `true` resultará en una advertencia y el nodo se apagará. Esto es para protegerse contra configuraciones incorrectas no intencionales de un nodo de archivo. - -Para anular esto y cambiar al modo de recorte, además de `pruning-enabled: true`, `allow-missing-tries` también debe establecerse en `true`. - -::: - -#### `populate-missing-tries` (\*uint64) - -Si no es nulo, establece el punto de partida para repoblar los tries faltantes y regenerar el bosque de merkle de archivo. - -Para restaurar un bosque de merkle de archivo que ha sido corrompido (nodos de trie faltantes para una sección de la cadena de bloques), especifique el punto de partida del último bloque en disco, donde el trie completo estaba disponible en ese bloque para volver a procesar bloques desde esa altura en adelante y regenerar el bosque de merkle de archivo al iniciar. Esta bandera debe usarse una vez para regenerar el bosque de merkle de archivo y debe eliminarse de la configuración después de completar. Esta bandera hará que el nodo retrase su inicio mientras vuelve a procesar bloques antiguos. - -#### `populate-missing-tries-parallelism` (int) - -Número de lectores concurrentes a utilizar al volver a poblar los tries faltantes al iniciar. Por defecto, es `1024`. - -#### `allow-missing-tries` (boolean) - -Si es `true`, permite que un nodo que alguna vez se configuró como de archivo cambie al modo de poda. Por defecto, es `false`. - -#### `preimages-enabled` (boolean) - -Si es `true`, habilita las preimágenes. Por defecto, es `false`. - -#### `offline-pruning-enabled` (boolean) - -Si es `true`, el recorte sin conexión se ejecutará al iniciar y bloqueará hasta que se complete (aproximadamente una hora en Mainnet). Esto reducirá el tamaño de la base de datos eliminando nodos de trie antiguos. **Mientras se realiza el recorte sin conexión, su nodo no podrá procesar bloques y se considerará fuera de línea.** Mientras está en curso, el proceso de recorte consume una pequeña cantidad de espacio adicional en disco (para marcadores de eliminación y el filtro de bloom). Para más información, consulte [aquí](/nodes/maintain/run-offline-pruning.md#disk-space-considerations). - -Dado que el recorte sin conexión elimina datos de estado antiguos, esto no debe ejecutarse en nodos que necesiten soportar solicitudes de API de archivo. - -Esto está destinado a ejecutarse manualmente, por lo que después de ejecutarlo una vez con esta bandera, debe cambiarse de nuevo a falso antes de ejecutar el nodo de nuevo. Por lo tanto, debe ejecutarse con esta bandera establecida en verdadero y luego establecerla en falso en la ejecución siguiente. - -#### `offline-pruning-bloom-filter-size` (int) - -Esta bandera establece el tamaño del filtro de bloom a utilizar en el recorte sin conexión (denominado en MB y con un valor predeterminado de 512 MB). El filtro de bloom se mantiene en memoria para comprobaciones eficientes durante el recorte y también se escribe en disco para permitir que el recorte se reanude sin volver a generar el filtro de bloom. - -El estado activo se agrega al filtro de bloom antes de iterar la base de datos para encontrar nodos de trie que se pueden eliminar de forma segura, cualquier nodo de trie que no esté en el filtro de bloom se considera seguro para su eliminación. El tamaño del filtro de bloom puede afectar su tasa de falsos positivos, lo que puede afectar los resultados del recorte sin conexión. Este es un parámetro avanzado que se ha ajustado a 512 MB y no debe cambiarse sin una consideración cuidadosa. - -#### `offline-pruning-data-directory` (string) - -Esta bandera debe establecerse cuando se habilita el recorte sin conexión y establece el directorio que el recorte sin conexión utilizará para escribir su filtro de bloom en disco. Este directorio no debe cambiarse entre ejecuciones hasta que el recorte sin conexión haya completado. - -#### `tx-lookup-limit` (uint64) - -Número de bloques recientes para los cuales mantener índices de búsqueda de transacciones en la base de datos. Si se establece en 0, se mantendrán índices de búsqueda de transacciones para todos los bloques. Por defecto, es `0`. - -#### `skip-tx-indexing` (bool) - -Si se establece en `true`, el nodo no indexará transacciones. El límite de búsqueda de transacciones aún se puede utilizar para controlar la eliminación de índices de transacciones antiguas. Por defecto, es `false`. - -### Red de VM - -#### `max-outbound-active-requests` (int) - -Especifica el número máximo de solicitudes salientes de VM2VM en vuelo a la vez. Por defecto, es `16`. - -#### `max-outbound-active-cross-chain-requests` (int) - -Especifica el número máximo de solicitudes salientes de cadena cruzada en vuelo a la vez. Por defecto, es `64`. - -### Varios - -#### `airdrop` (string) - -Ruta a un archivo json que contiene una lista de direcciones para un airdrop de génesis. Cada dirección recibirá un airdrop de `AirdropAmount` en el génesis, y el hash del archivo de airdrop debe coincidir con `AirdropHash`. `AirdropAmount` y `AirdropHash` son parte de la configuración de génesis. Esta opción se aplica sólo a `subnet-evm` (no aplicable a `coreth`). - -#### `skip-upgrade-check` (bool) - -Si se establece en `true`, la cadena omitirá verificar que todas las actualizaciones de red esperadas se hayan realizado antes del último bloque aceptado al iniciar. Esto permite que los operadores de nodos se recuperen si su nodo ha aceptado bloques después de una actualización de red con una versión del código anterior a la actualización. Por defecto, es `false`. - -## Configuraciones de la Cadena X - -Para especificar una configuración para la Cadena X, se debe colocar un archivo de configuración JSON en `{chain-config-dir}/X/config.json`. - -Por ejemplo, si `chain-config-dir` tiene el valor predeterminado que es `$HOME/.avalanchego/configs/chains`, entonces `config.json` se puede colocar en `$HOME/.avalanchego/configs/chains/X/config.json`. - -Esto le permite especificar una configuración que se pasará a la Cadena X. Los valores predeterminados para esta configuración son: - -```json -{ - "index-transactions": false, - "index-allow-incomplete": false -} -``` - -Los valores predeterminados se anulan sólo si se especifican explícitamente en la configuración. - -Los parámetros son los siguientes: - -**Indexación de Transacciones** - -### `index-transactions` (boolean) - -Habilita la indexación de transacciones AVM si se establece en `true`. El valor predeterminado es `false`. -Cuando se establece en `true`, las transacciones AVM se indexan según la `dirección` y el `assetID` involucrados. Estos datos están disponibles a través de `avm.getAddressTxs` -[API](/reference/avalanchego/x-chain/api.md#avmgetaddresstxs). - -:::note -Si `index-transactions` se establece en true, siempre debe estar configurado en true -durante la vida útil del nodo. Si se establece en `false` después de haber sido establecido en `true`, el -nodo se negará a iniciar a menos que `index-allow-incomplete` también se establezca en `true` -(ver más abajo). -::: - -### `index-allow-incomplete` (booleano) - -Permite índices incompletos. El valor predeterminado es `false`. - -Este valor de configuración se ignora si no hay datos indexados de la cadena X en la base de datos y -`index-transactions` se establece en `false`. - -## Configuraciones de la Cadena de Subnet - -Como se mencionó anteriormente, si la id de cadena de una Subnet es -`2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt`, la configuración para esta cadena -debería estar en -`{chain-config-dir}/2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt/config.json` - -## Preguntas frecuentes - -- Cuando se usa `getBlockNumber` devolverá bloques finalizados. Para permitir consultas - de bloques/transacciones no finalizados (aún no aceptados), use `allow-unfainalized-queries` - y establezca en true (por defecto está establecido en `false`). - -- Cuando se desactiva la poda sin conexión `(pruning-enabled: false)` desde un estado previamente - habilitado, esto no afectará a los bloques cuyo estado ya fue podado. Esto devolverá errores de nodo de trie faltante, ya que el nodo no puede buscar el estado de un bloque histórico si ese estado fue eliminado. - diff --git a/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/subnet-configs.md b/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/subnet-configs.md deleted file mode 100644 index 8f9f49425c1..00000000000 --- a/i18n/es/docusaurus-plugin-content-docs/current/nodes/configure/subnet-configs.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -tags: [Nodos] -description: Referencia de todas las opciones y banderas de configuración de Subnet disponibles. -sidebar_label: Configuraciones de Subnet -pagination_label: Configuraciones de Subnet -sidebar_position: 2 ---- - -# Configuraciones de Subnet - -Es posible proporcionar parámetros para una Subnet. Estos parámetros se aplican a todas -las cadenas en la Subnet especificada. - -AvalancheGo busca archivos especificados con `{subnetID}.json` bajo -`--subnet-config-dir` como se documenta -[aquí](/nodes/configure/avalanchego-config-flags.md#subnet-configs). - -Aquí tienes un ejemplo de archivo de configuración de Subnet: - -```json -{ - "validatorOnly": false, - "consensusParameters": { - "k": 25, - "alpha": 18 - } -} -``` - -## Parámetros - -### Subnet Privada - -#### `validatorOnly` (bool) - -Si es `true`, este nodo no expone el contenido de la blockchain de la Subnet a nodos no validadores -a través de mensajes P2P. Por defecto es `false`. - -Las Subnets de Avalanche son públicas por defecto. Esto significa que cada nodo puede sincronizar y -escuchar transacciones/bloques en Subnets, incluso si no están validando la -Subnet escuchada. - -Los validadores de la Subnet pueden elegir no publicar el contenido de las blockchains a través de esta -configuración. Si un nodo establece `validatorOnly` en verdadero, el nodo intercambia -mensajes sólo con los validadores de esta Subnet. Otros pares no podrán -aprender el contenido de esta Subnet desde este nodo. - -:::tip - -Esta es una configuración específica del nodo. Cada validador de esta Subnet tiene que usar -esta configuración para crear una Subnet privada completa. - -::: - -#### `allowedNodes` (lista de cadenas) - -Si `validatorOnly=true`, esto permite que se permitan explícitamente los NodeIDs especificados -para sincronizar la Subnet independientemente de su estado de validador. Por defecto, está vacío. - -:::tip - -Esta es una configuración específica del nodo. Cada validador de esta Subnet tiene que usar -esta configuración para permitir correctamente un nodo en la Subnet privada. - -::: - -#### `proposerMinBlockDelay` (duración) - -La demora mínima realizada al construir bloques snowman++. El valor predeterminado es de 1 segundo. - -Como una de las formas de controlar la congestión de la red, Snowman++ sólo construirá un -bloque `proposerMinBlockDelay` después de la marca de tiempo del bloque padre. Algunas -VM personalizadas de alto rendimiento pueden encontrar esto demasiado estricto. Esta bandera permite ajustar la -frecuencia a la que se construyen los bloques. - -### Parámetros de Consenso - -Las configuraciones de Subnet admiten cargar nuevos parámetros de consenso. Las claves JSON son -diferentes de sus claves `CLI` correspondientes. Estos parámetros deben agruparse bajo la -clave `consensusParameters`. Los parámetros de consenso de una Subnet se establecen por defecto en los -mismos valores utilizados para la Red Primaria, que se dan en [Parámetros Snow CLI](/nodes/configure/avalanchego-config-flags.md#snow-parameters). - -| Clave CLI | Clave JSON | -| :------------------------------- | :-------------------- | -| --snow-sample-size | k | -| --snow-quorum-size | alpha | -| --snow-virtuous-commit-threshold | `betaVirtuous` | -| --snow-rogue-commit-threshold | `betaRogue` | -| --snow-concurrent-repolls | concurrentRepolls | -| --snow-optimal-processing | `optimalProcessing` | -| --snow-max-processing | maxOutstandingItems | -| --snow-max-time-processing | maxItemProcessingTime | -| --snow-avalanche-batch-size | `batchSize` | -| --snow-avalanche-num-parents | `parentSize` | - -### Configuraciones de Gossip - -Es posible definir diferentes configuraciones de Gossip para cada Subnet sin -cambiar los valores de la Red Primaria. Las claves JSON de estos -parámetros son diferentes de sus claves `CLI` correspondientes. Estos parámetros -se establecen por defecto en los mismos valores utilizados para la Red Primaria. Para más información, -consulta [Configuraciones de Gossip CLI](/nodes/configure/avalanchego-config-flags.md#gossiping). - -| Clave CLI | Clave JSON | -| :------------------------------------------------------ | :------------------------------------- | -| --consensus-accepted-frontier-gossip-validator-size | gossipAcceptedFrontierValidatorSize | -| --consensus-accepted-frontier-gossip-non-validator-size | gossipAcceptedFrontierNonValidatorSize | -| --consensus-accepted-frontier-gossip-peer-size | gossipAcceptedFrontierPeerSize | -| --consensus-on-accept-gossip-validator-size | gossipOnAcceptValidatorSize | -| --consensus-on-accept-gossip-non-validator-size | gossipOnAcceptNonValidatorSize | -| --consensus-on-accept-gossip-peer-size | gossipOnAcceptPeerSize | From a4e7d313bcdb839724a81b20e7f6a46d6aa079a4 Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 25 Mar 2024 17:57:51 -0400 Subject: [PATCH 17/18] vale --- docs/nodes/configure/chain-configs/P.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/nodes/configure/chain-configs/P.md b/docs/nodes/configure/chain-configs/P.md index 69b15876995..a9058c111ea 100644 --- a/docs/nodes/configure/chain-configs/P.md +++ b/docs/nodes/configure/chain-configs/P.md @@ -58,7 +58,7 @@ The node's chain manager ### `Validators` -Node's validator set maps subnetID to validators of the subnet +Node's validator set maps SubnetID to validators of the Subnet - The primary network's validator set should have been added to the manager before calling VM.Initialize. - The primary network's validator set should be empty before calling VM.Initialize. @@ -81,9 +81,7 @@ If true, only the P-chain will be instantiated on the primary network. ### `TrackedSubnets` -_Set[ids.ID]_ - -Set of subnets that this node is validating +Set of Subnets that this node is validating ### `TxFee` @@ -101,13 +99,13 @@ Fee that must be burned by every state creating transaction before AP3 _Uint64_ -Fee that must be burned by every subnet creating transaction after AP3 +Fee that must be burned by every Subnet creating transaction after AP3 ### `TransformSubnetTxFee` _Uint64_ -Fee that must be burned by every transform subnet transaction +Fee that must be burned by every transform Subnet transaction ### `CreateBlockchainTxFee` @@ -131,13 +129,13 @@ Transaction fee for adding a primary network delegator _Uint64_ -Transaction fee for adding a subnet validator +Transaction fee for adding a Subnet validator ### `AddSubnetDelegatorFee` _Uint64_ -Transaction fee for adding a subnet delegator +Transaction fee for adding a Subnet delegator ### `MinValidatorStake` @@ -225,4 +223,4 @@ Time of the E network upgrade _Boolean_ -UseCurrentHeight forces [GetMinimumHeight] to return the current height of the P-Chain instead of the oldest block in the [recentlyAccepted] window. This config is particularly useful for triggering proposervm activation on recently created subnets (without this, users need to wait for [recentlyAcceptedWindowTTL] to pass for activation to occur). +UseCurrentHeight forces `GetMinimumHeight` to return the current height of the P-Chain instead of the oldest block in the `recentlyAccepted` window. This config is particularly useful for triggering proposervm activation on recently created Subnets (without this, users need to wait for `recentlyAcceptedWindowTTL` to pass for activation to occur). From 41ae805e6f4e04f7b7d11a20eeb3aa6e79a881b0 Mon Sep 17 00:00:00 2001 From: meaghan Date: Mon, 25 Mar 2024 18:11:20 -0400 Subject: [PATCH 18/18] nits --- sidebars.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sidebars.json b/sidebars.json index 79eabf660b2..426ed9ef494 100644 --- a/sidebars.json +++ b/sidebars.json @@ -580,33 +580,33 @@ }, { "type": "category", - "label": "C-Chain", + "label": "X-Chain", "collapsed": true, "items": [ { "type": "autogenerated", - "dirName": "reference/avalanchego/c-chain" + "dirName": "reference/avalanchego/x-chain" }, { "type": "ref", "label": "Configs", - "id": "nodes/configure/chain-configs/C" + "id": "nodes/configure/chain-configs/X" } ] }, { "type": "category", - "label": "X-Chain", + "label": "C-Chain", "collapsed": true, "items": [ { "type": "autogenerated", - "dirName": "reference/avalanchego/x-chain" + "dirName": "reference/avalanchego/c-chain" }, { "type": "ref", "label": "Configs", - "id": "nodes/configure/chain-configs/X" + "id": "nodes/configure/chain-configs/C" } ] },