blockchain-infra-decentralization-metrics

所属分类:区块链开发
开发工具:Python
文件大小:0KB
下载次数:0
上传日期:2023-08-29 17:07:32
上 传 者sh-1993
说明:  区块链基础设施去中心化指标,,
(blockchain-infra-decentralization-metrics,,)

文件列表:
LICENSE (11357, 2023-08-29)
analysis/ (0, 2023-08-29)
analysis/__init__.py (0, 2023-08-29)
analysis/__pycache__/ (0, 2023-08-29)
analysis/__pycache__/__init__.cpython-38.pyc (173, 2023-08-29)
analysis/__pycache__/analysis.cpython-38.pyc (4595, 2023-08-29)
analysis/__pycache__/utils.cpython-38.pyc (5207, 2023-08-29)
analysis/analysis.py (9092, 2023-08-29)
analysis/utils.py (10626, 2023-08-29)
aptos/ (0, 2023-08-29)
aptos/aptos.py (4057, 2023-08-29)
aptos/config/ (0, 2023-08-29)
aptos/config/.empty (0, 2023-08-29)
avalanche/ (0, 2023-08-29)
avalanche/avalanche.py (4137, 2023-08-29)
avalanche/config/ (0, 2023-08-29)
avalanche/config/.empty (0, 2023-08-29)
cardano/ (0, 2023-08-29)
cardano/cardano.py (8640, 2023-08-29)
cardano/config/ (0, 2023-08-29)
cardano/config/.empty (0, 2023-08-29)
cardano/output/ (0, 2023-08-29)
cardano/output/cardano-validators-2023-02-07.json (279623, 2023-08-29)
classes/ (0, 2023-08-29)
classes/Blockchain.py (17986, 2023-08-29)
classes/Country.py (4741, 2023-08-29)
classes/Datacenter.py (5131, 2023-08-29)
classes/Provider.py (5153, 2023-08-29)
classes/__init__.py (0, 2023-08-29)
classes/__pycache__/ (0, 2023-08-29)
classes/__pycache__/Blockchain.cpython-38.pyc (9863, 2023-08-29)
classes/__pycache__/Country.cpython-38.pyc (3137, 2023-08-29)
classes/__pycache__/Datacenter.cpython-38.pyc (3250, 2023-08-29)
classes/__pycache__/Provider.cpython-38.pyc (3640, 2023-08-29)
classes/__pycache__/__init__.cpython-38.pyc (172, 2023-08-29)
... ...

# Blockchain Infra Decentralization Metrics The Messari report that used this project can be found here: > [Evluating Validator Decentralization - Geographic and Infrastructure Distribution in Proof of Stake Networks](https://messari.io/report/evaluating-validator-decentralization-geographic-and-infrastructure-distribution-in-proof-of-stake-networks) Contributions to this repo are welcomed and encouraged. --- ## Overview This repo is a collection of scripts that measure the infrastructure decentralization of multiple blockchains. This project measures: - Stake distribution across infrastructure providers. - Stake distribution across geographies. - Validator distribution across infrastructure providers. - Validator distribution across geographies. ## How it Works The individual scripts inside each chain directory get/crawl the IP addresses of the validators and nodes, and finds their respective stake and other relevant information. Each script outputs the data for their chain to a JSON file inside the `json` folder in the root directory. That JSON file **must** follow the specification below. Some of the scripts or programs inside each directory may need some work, so contributions are welcomed. The `main.py` script uses the JSON files for a given chain to find the infrastructure provider and the geographic location where each node is running. ## JSON specification The output should be a JSON objects in the following format: ``` { "timestamp": # When was the analysis last ran "collection_method": , <"crawl" for nodes manually crawled, or "api" for IPs found via the chain RPC API> "chain_data": {Any other information to add about the chain}, "nodes": { : { "is_validator": , #Differentiate between RPC nodes and validator nodes. "stake": , #Stake of the validator or null if RPC node. "address": , #On-chain address of the validator. "extra_info": { } }, : {}, : {}, . . } } ``` ## Usage The tool takes 1 mandatory parameter and 2 optional parameters in the following format: - **[MANDATORY]** `--blockchain=[value]` - Defines the target blockchain. - There must exist a file in the `json/` directory matching `[value]` (i.e. `[value].json`). - `--providers=[val1],[val2]` - Defines the providers for which to track nodes, based on the `config/ProviderConfig.json`. - Only accepted values are the "short" attribute defined for each ASN in the `ProviderConfig.json`. - The keys are ASN numbers for the providers you want to track. - The values have the provider name, description, website, and "short". - `--countries=[val1],[val2]` - Defines the countries for which to track nodes, based on the ISO Alpha-2 country code convention. - Only accepted values are the ISO Alpha-2 country code. A table of each country code to its respective country can be found at `config/CountryConfig.json`. - `--output` -> Prints an overview of the results upon completion. - `--help` -> Prints this message. ## Things to note 1. Criteria for `active` in flow is defined by those nodes whose stake is lower than the minimum specified requirement for that node role - as per [Flow's documentation](https://developers.flow.com/nodes/node-operation/node-roles). 2. RPC node data is not available for all chains, and some stake data may be incomplete for some chains. See each chain's documentation for more information. 3. For chains in which the IPs were acquired via crawling, there is no way to guarantee that the crawler has found an exhaustive list of all the nodes in the network. 4. No IP data is found in this repo, just tools. --- # Disclaimer & License Although Google is the employer of the author of the repo, this is not an officially supported Google product and does not reflect on Google in any ways. Neither the author of this repo nor its employer shall be held liable for any issues caused by the usage of this code. This includes but is not limited to bugs, errors, wrong or outdated inforamtion, or even loss of funds. This repo is published solely on the basis of good faith and as a tool to help developers. This code should be used with caution. The user is running this code at its own risk. Apache Header: ``` Copyright 2023 Sam Padilla Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```

近期下载者

相关文件


收藏者