* core/state: typo Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: backport from https://github.com/bnb-chain/bsc/pull/543 Signed-off-by: Delweng <delweng@gmail.com> * eth,ethdb,node,core/state: backport from https://github.com/bnb-chain/bsc/pull/543 Signed-off-by: Delweng <delweng@gmail.com> * eth,core: backport from https://github.com/bnb-chain/bsc/pull/543 Signed-off-by: Delweng <delweng@gmail.com> * cmd: open db with freeze disabled Signed-off-by: Delweng <delweng@gmail.com> * cli: snapshot prune-block Signed-off-by: Delweng <delweng@gmail.com> * fix typo Signed-off-by: Delweng <delweng@gmail.com> * cli/snapshot: fix the issue of dup open db error Signed-off-by: Delweng <delweng@gmail.com> * cli/snapshot: resolve datadir and ancient before backup Signed-off-by: Delweng <delweng@gmail.com> * core: more prune-block log Signed-off-by: Delweng <delweng@gmail.com> * core: truncatetail missing f.offset Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: indextx adjust offset of pruned block Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: freezer batch should implement the offset commit, ref https://github.com/bnb-chain/bsc/pull/1005 Signed-off-by: Delweng <delweng@gmail.com> * core: check of ancientdb, backport https://github.com/bnb-chain/bsc/pull/817 Signed-off-by: Delweng <delweng@gmail.com> * core/state: read raw borReceipt to backup Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: bor receipt maybe in []Receipt or Receipt RLP format Signed-off-by: Delweng <delweng@gmail.com> * core/state: typo and error msg Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: offSet -> offset Signed-off-by: Delweng <delweng@gmail.com> * cli/snapshot: comment Signed-off-by: Delweng <delweng@gmail.com> * cli/snapshot: add prune-block doc Signed-off-by: Delweng <delweng@gmail.com> * docs: add prune-block document Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: print wrong bor-receipt length Signed-off-by: Delweng <delweng@gmail.com> * internal/cli: add snapshot prune block tests (referenced from bsc's PR) * improve errors * cmd, core, eth, internal: fix lint * internal/cli: refactor snapshot prune block test * fix linters in tests * internal/cli: add inspect-ancient-db command, update docs * pruner: use a generic function for simplification * internal/cli: fixes for inspect-db command * internal/cli: improve pruning tests * core/rawdb: update end block calculation logic in inspect command * core/rawdb: improve checks db initialisation * core/rawdb: remove offset check * update mocks for span, ethdb and add command in makefile * docs/cli: update docs with inspect command * go mod tidy * refactor and resolve conflicts * resolve more conflicts * refactor * explicitly read node for hash scheme * add check for hash scheme, fix tests * fix typo * update docs and add warning * raise error if pbss is enabled * revert read raw bor receipt change * consensus/bor: handle nil header case in get root hash * address comments * core/rawdb: check chain continuity by matching parent hash * core/rawdb: account for pruned ancient blocks * go mod tidy * fix tests * fix tests --------- Signed-off-by: Delweng <delweng@gmail.com> Co-authored-by: Delweng <delweng@gmail.com> |
||
|---|---|---|
| .circleci | ||
| .github | ||
| accounts | ||
| audit | ||
| beacon | ||
| build | ||
| builder/files | ||
| cmd | ||
| common | ||
| consensus | ||
| console | ||
| core | ||
| crypto | ||
| docs | ||
| eth | ||
| ethclient | ||
| ethdb | ||
| ethstats | ||
| event | ||
| graphql | ||
| integration-tests | ||
| internal | ||
| log | ||
| metrics | ||
| miner | ||
| node | ||
| p2p | ||
| packaging | ||
| params | ||
| rlp | ||
| rpc | ||
| scripts | ||
| signer | ||
| swarm | ||
| tests | ||
| trie | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| .golangci.yml | ||
| .goreleaser.yml | ||
| .mailmap | ||
| .travis.yml | ||
| appveyor.yml | ||
| AUTHORS | ||
| circle.yml | ||
| COPYING | ||
| COPYING.LESSER | ||
| Dockerfile | ||
| Dockerfile.alltools | ||
| Dockerfile.release | ||
| fuzzbuzz.yaml | ||
| go.mod | ||
| go.sum | ||
| interfaces.go | ||
| Makefile | ||
| oss-fuzz.sh | ||
| README.md | ||
| RETESTBOR.md | ||
| SECURITY.md | ||
| sonar-project.properties | ||
Bor Overview
Bor is the Official Golang implementation of the Polygon PoS blockchain. It is a fork of geth and is EVM compatible (upto London fork).
Installing bor using packaging
The easiest way to get started with bor is to install the packages using the command below. Refer to the releases section to find the latest stable version of bor.
curl -L https://raw.githubusercontent.com/maticnetwork/install/main/bor.sh | bash -s -- v0.4.0 <network> <node_type>
The network accepts mainnet,amoy or mumbai and the node type accepts validator or sentry or archive. The installation script does the following things:
- Create a new user named
bor. - Install the bor binary at
/usr/bin/bor. - Dump the suitable config file (based on the network and node type provided) at
/var/lib/borand uses it as the home dir. - Create a systemd service named
borat/lib/systemd/system/bor.servicewhich starts bor using the config file asboruser.
The releases supports both the networks i.e. Polygon Mainnet, Amoy and Mumbai (Testnet) unless explicitly specified. Before the stable release for mainnet, pre-releases will be available marked with beta tag for deploying on Mumbai/Amoy (testnet). On sufficient testing, stable release for mainnet will be announced with a forum post.
Building from source
- Install Go (version 1.19 or later) and a C compiler.
- Clone the repository and build the binary using the following commands:
make bor - Start bor using the ideal config files for validator and sentry provided in the
packagingfolder../build/bin/bor server --config ./packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml - To build full set of utilities, run:
make all - Run unit and integration tests
make test && make test-integration
Using the new cli
Post v0.3.0 release, bor uses a new command line interface (cli). The new-cli (located at internal/cli) has been built with keeping the flag usage similar to old-cli (located at cmd/geth) with a few notable changes. Please refer to docs section for flag usage guide and example.
Documentation
- The official documentation for the Polygon PoS chain can be found here. It contains all the conceptual and architectural details of the chain along with operational guide for users running the nodes.
- New release announcements and discussions can be found on our forum page.
- Polygon improvement proposals can be found here
Contribution guidelines
Thank you for considering helping out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes! If you'd like to contribute to bor, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base.
From the outset we defined some guidelines to ensure new contributions only ever enhance the project:
- Quality: Code in the Polygon project should meet the style guidelines, with sufficient test-cases, descriptive commit messages, evidence that the contribution does not break any compatibility commitments or cause adverse feature interactions, and evidence of high-quality peer-review. Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
- Testing: Please ensure that the updated code passes all the tests locally before submitting a pull request. In order to run unit tests, run
make testand to run integration tests, runmake test-integration. - Size: The Polygon project’s culture is one of small pull-requests, regularly submitted. The larger a pull-request, the more likely it is that you will be asked to resubmit as a series of self-contained and individually reviewable smaller PRs.
- Maintainability: If the feature will require ongoing maintenance (e.g. support for a particular brand of database), we may ask you to accept responsibility for maintaining this feature
- Pull requests need to be based on and opened against the
developbranch. - PR title should be prefixed with package(s) they modify.
- E.g. "eth, rpc: make trace configs optional"
License
The go-ethereum library (i.e. all code outside of the cmd directory) is licensed under the
GNU Lesser General Public License v3.0,
also included in our repository in the COPYING.LESSER file.
The go-ethereum binaries (i.e. all code inside of the cmd directory) are licensed under the
GNU General Public License v3.0, also
included in our repository in the COPYING file.
Join our Discord server
Join Polygon community – share your ideas or just say hi over on Discord.