{"_id":"@cqlinkoff/ethereumjs-common","_rev":"1-48efba23172965005ca055330c4f904f","name":"@cqlinkoff/ethereumjs-common","dist-tags":{"latest":"1.3.1"},"versions":{"1.3.1":{"name":"@cqlinkoff/ethereumjs-common","version":"1.3.1","description":"Resources common to all Ethereum implementations","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"ethereumjs-config-build","prepublishOnly":"npm run test && npm run build","coverage":"ethereumjs-config-coverage","coveralls":"ethereumjs-config-coveralls","format":"ethereumjs-config-format","format:fix":"ethereumjs-config-format-fix","tslint":"ethereumjs-config-tslint","tslint:fix":"ethereumjs-config-tslint-fix","tsc":"ethereumjs-config-tsc","lint":"ethereumjs-config-lint","lint:fix":"ethereumjs-config-lint-fix","unitTests":"ts-node ./node_modules/tape/bin/tape ./tests/*.ts","test":"npm run lint && npm run unitTests","test:fix":"npm run lint:fix && npm run unitTests","docs:build":"typedoc --out docs --excludePrivate --excludeExternals --mode file --readme none --theme markdown --mdEngine github src/*.ts src/genesisStates/*.ts"},"husky":{"hooks":{"pre-push":"npm run lint"}},"repository":{"type":"git","url":"git+https://github.com/ethereumjs/ethereumjs-common.git"},"keywords":["ethereum","ethereumjs","constants","parameters","genesis","networks","bootstrap"],"author":"","license":"MIT","bugs":{"url":"https://github.com/ethereumjs/ethereumjs-common/issues"},"homepage":"https://github.com/ethereumjs-ethereumjs/common","devDependencies":{"@ethereumjs/config-nyc":"^1.1.0","@ethereumjs/config-prettier":"^1.1.0","@ethereumjs/config-tsc":"^1.1.0","@ethereumjs/config-tslint":"^1.1.0","@types/node":"^10.12.2","@types/tape":"^4.2.33","coveralls":"^3.0.1","husky":"^2.1.0","nyc":"^11.7.1","prettier":"^1.15.3","tape":"^4.9.2","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.14.0","typedoc-plugin-markdown":"^1.1.21","typescript":"^3.2.2","typestrict":"^1.0.2"},"maintainers":[{"name":"kagawa","email":"kingsongao1221@gmail.com"}],"dependencies":{},"gitHead":"79cea8d4ed44685a3757b1c2af500bbc2378db71","_id":"@cqlinkoff/ethereumjs-common@1.3.1","_nodeVersion":"12.4.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-a33f5n9G+3k4e2eQ+1IlbWz76CtdmBPUsI5w9Ib7a+v5etgx0V056uD+hCNGeyl1HDNEEwrU02WmqwDRvdEFxw==","shasum":"6782710737394c735bb0ddb60d615b13c509b3fc","tarball":"https://registry.npmjs.org/@cqlinkoff/ethereumjs-common/-/ethereumjs-common-1.3.1.tgz","fileCount":39,"unpackedSize":803191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNr0LCRA9TVsSAnZWagAAYRMP/RN9jyh+mTGUsjSS5Dup\nsrPBiUikGQsGWxZsh5ptT2yCOElB1tsNX1Q9tNkyyGh584KwcC27gqkQOF6O\nGaPUkSQLShgsB0jEwMvjXdEvQqvrAiYinF/ue4IDQt+ux5i1MWiR/NPGeU9j\nik9NWJ0sot+FfFyeyEKWgIsajiOtDH+v+qkL5u8j4T4k2sJfSnzKOs3JbvJr\nF26ChCZPWMsPaVJ31BwcAuZ0w8JVdLoSANhYjSP+STGYKqjr/1m8gQ/fvXZU\nyDxct7hGO0v/aClwZ5JZmF8SPeYi29VJbNchZ0CyvXWZK8M/deEYBNDhADuJ\nrZvRU2/z9SljlGy8W/1/no+Dn3nlh9C8x7VgFEDwGVfykhxwTi/YGAs0xxil\n8Xska4Nkjklrm0KKS7iY9PQ46hEiBhHAqTiQBq1fajD1unRKbuCcaSWFsR0t\niQ6EdIsBLAIh494+OyYOdjf0hkGFZpzxTbNSzxitOojQYJ3QPTjOjfEfAXNh\nq9MUapet7GB8z0XA0oqoMiyIqfHY22y4PEwcLGBQNrapghw8thv8GVDn8i0N\nkNx5x7/8nVgvTtXLSfbZNgghWJQqHZa+KbZMT/GAoyW6pbLW260GQbFibmus\naOcZBSEBfwhqI4Jigb4OP6GCeaIT10OKt6mhYmR5zha8RhiCQbDyihAZm/F7\nvAx9\r\n=G1M5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDxnsCIocrw+SocabYoBldy5yZP9P/YBelpNRl+0Q+VQIhAPj/J4fQVvbQ//9s34/4hlHH89f3maT//441tLAmmrr8"}]},"_npmUser":{"name":"kagawa","email":"kingsongao1221@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ethereumjs-common_1.3.1_1563868426819_0.1455299106909025"},"_hasShrinkwrap":false}},"time":{"created":"2019-07-23T07:53:46.655Z","1.3.1":"2019-07-23T07:53:47.005Z","modified":"2022-04-05T01:33:41.765Z"},"maintainers":[{"name":"kagawa","email":"kingsongao1221@gmail.com"}],"description":"Resources common to all Ethereum implementations","homepage":"https://github.com/ethereumjs-ethereumjs/common","keywords":["ethereum","ethereumjs","constants","parameters","genesis","networks","bootstrap"],"repository":{"type":"git","url":"git+https://github.com/ethereumjs/ethereumjs-common.git"},"bugs":{"url":"https://github.com/ethereumjs/ethereumjs-common/issues"},"license":"MIT","readme":"# SYNOPSIS\n\n[![Build Status](https://travis-ci.org/ethereumjs/ethereumjs-common.svg?branch=master)](https://travis-ci.org/ethereumjs/ethereumjs-common)\n[![Coverage Status](https://img.shields.io/coveralls/ethereumjs/ethereumjs-common.svg?style=flat-square)](https://coveralls.io/r/ethereumjs/ethereumjs-common)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs.svg?style=flat-square)]()\n\n# ETHEREUMJS-COMMON\n\nResources common to all Ethereum implementations\n\nSucceeds the old [ethereum/common](https://github.com/ethereumjs/common/) library.\n\n# INSTALL\n\n`npm install ethereumjs-common`\n\n# USAGE\n\nAll parameters can be accessed through the `Common` class which can be required through the\nmain package and instantiated either with just the `chain` (e.g. 'mainnet') or the `chain`\ntogether with a specific `hardfork` provided.\n\nHere are some simple usage examples:\n\n```javascript\nconst Common = require('ethereumjs-common')\n\n// Instantiate with only the chain\nlet c = new Common('ropsten')\nc.param('gasPrices', 'ecAddGas', 'byzantium') // 500\n\n// Chain and hardfork provided\nc = new Common('ropsten', 'byzantium')\nc.param('pow', 'minerReward') // 3000000000000000000\n\n// Access genesis data for Ropsten network\nc.genesis().hash // 0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d\n\n// Get bootstrap nodes for chain/network\nc.bootstrapNodes() // Array with current nodes\n```\n\nIt is encouraged to also explicitly set the `supportedHardforks` if the initializing library\nonly supports a certain range of `hardforks`:\n\n```javascript\nlet c = new Common('ropsten', null, ['byzantium', 'constantinople', 'petersburg'])\n```\n\nThis will e.g. throw an error when a param is requested for an unsupported hardfork and\nlike this prevents unpredicted behaviour.\n\n# API\n\nSee the API documentation for a full list of functions for accessing specific chain and\ndepending hardfork parameters. There are also additional helper functions like\n`paramByBlock (topic, name, blockNumber)` or `hardforkIsActiveOnBlock (hardfork, blockNumber)`\nto ease `blockNumber` based access to parameters.\n\n- [API Docs](./docs/README.md)\n\n# Hardfork Params\n\n## Active Hardforks\n\nThere are currently parameter changes by the following past and future hardfork by the\nlibrary supported:\n\n- `chainstart`\n- `homestead`\n- `dao`\n- `tangerineWhistle`\n- `spuriousDragon`\n- `byzantium`\n- `constantinople`\n- `petersburg` (aka `constantinopleFix`, apply together with `constantinople`)\n\n## Future Hardforks\n\nScope and technical details on the `Istanbul` HF are currently forming out\nwithin [EIP-1679](https://eips.ethereum.org/EIPS/eip-1679) respectively the\nassociated EIP pages.\n\nSupported EIPs in the library:\n\n- [EIP-1108](https://eips.ethereum.org/EIPS/eip-1108) `alt_bn128` precompile\n  gas cost reductions (HF candidate, `DRAFT` status)\n\n## Parameter Access\n\nFor hardfork-specific parameter access with the `param()` and `paramByBlock()` functions\nyou can use the following `topics`:\n\n- `gasConfig`\n- `gasPrices`\n- `vm`\n- `pow`\n- `casper`\n- `sharding`\n\nSee one of the hardfork files like `byzantium.json` in the `hardforks` directory\nfor an overview. For consistency, the chain start (`chainstart`) is considered an own\nhardfork.\n\nThe hardfork-specific json files only contain the deltas from `chainstart` and\nshouldn't be accessed directly until you have a specific reason for it.\n\nNote: The list of `gasPrices` and gas price changes on hardforks is consistent\nbut not complete, so there are currently gas price values missing (PRs welcome!).\n\n# Chain Params\n\nSupported chains:\n\n- `mainnet`\n- `ropsten`\n- `rinkeby`\n- `kovan`\n- `goerli` (final configuration since `v1.1.0`)\n- Private/custom chain parameters\n\nThe following chain-specific parameters are provided:\n\n- `name`\n- `chainId`\n- `networkId`\n- `genesis` block header values\n- `hardforks` block numbers\n- `bootstrapNodes` list\n\nTo get an overview of the different parameters have a look at one of the chain-specifc\nfiles like `mainnet.json` in the `chains` directory, or to the `Chain` type in [./src/types.ts](./src/types.ts).\n\n## Working with private/custom chains\n\nThere are two ways to set up a common instance with parameters for a private/custom chain:\n\n1. You can pass a dictionary - conforming to the parameter format described above - with your custom values in\n   the constructor or the `setChain()` method for the `chain` parameter.\n\n2. You can base your custom chain's config in a standard one, using the `Common.forCustomChain` method.\n\n# Bootstrap Nodes\n\nThere is no separate config file for bootstrap nodes like in the old `ethereum-common` library.\nInstead use the `common.bootstrapNodes()` function to get nodes for a specific chain/network.\n\n# Genesis States\n\nNetwork-specific genesis files are located in the `genesisStates` folder.\n\nDue to the large file sizes genesis states are not directly included in the `index.js` file\nbut have to be accessed directly, e.g.:\n\n```javascript\nconst mainnetGenesisState = require('ethereumjs-common/dist/genesisStates/mainnet')\n```\n\nOr by accessing dynamically:\n\n```javascript\nconst genesisStates = require('ethereumjs-common/dist/genesisStates')\nconst mainnetGenesisState = genesisStates.genesisStateByName('mainnet')\nconst mainnetGenesisState = genesisStates.genesisStateById(1) // alternative via network Id\n```\n\n# EthereumJS\n\nSee our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices.\n\nIf you want to join for work or do improvements on the libraries have a look at our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html).\n\n# LICENSE\n\n[MIT](https://opensource.org/licenses/MIT)\n","readmeFilename":"README.md"}