在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):kadena-io/chainweb-node开源软件地址(OpenSource Url):https://github.com/kadena-io/chainweb-node开源编程语言(OpenSource Language):Haskell 99.1%开源软件介绍(OpenSource Introduction):
Kadena Public BlockchainKadena is a fast, secure, and scalable blockchain using the Chainweb consensus protocol. Chainweb is a braided, parallelized Proof Of Work consensus mechanism that improves throughput and scalability in executing transactions on the blockchain while maintaining the security and integrity found in Bitcoin. Read our whitepapers:
For additional information, press, and development inquires, please refer to the Kadena website Table of Contents
DocsThe Kadena Docs site, which can be found here serves as a source of information about Kadena. You can find information about how to interact with the public chain, including how to get keys, view network activity, explore blocks, etc. here. If you have additions or comments, please submit a pull request or raise an issue - the GitHub project can be found here Installing ChainwebInstalling dependenciesIf you are using a docker image, you can ignore the reset of this sub-section. Apt-based Linux distributions If you are on Ubuntu, Debian, CentOS or any other Apt-based distribution, you will need to install rocksdb with the following command: sudo apt-get update sudo apt-get install -y librocksdb-dev zlib1g-dev libtinfo-dev libsqlite3-dev libz3-dev If this is not available, then please view the Rocksdb site for alternative modes of installation. Other Linux distributions For all other distributions not using Apt (RHEL, Gentoo, Arch, etc), please
consult your distro's repositories for Mac OSX Using the brew update
brew install sqlite
brew install rocksdb Installing Chainweb-nodeMinimal recommended hardware requirements for nodes are:
If the node is also used as API server for Pact or mining, rosetta, chainweb-data: 4 CPU cores and 8GB of RAM. Chainweb-node binaries for ubuntu-16.04, ubuntu-18.04 can be found here. Download the archive for your system and extract the binaries and place them into a directory from where they can be executed. At this point, you are ready to run a Chainweb node DockerA docker image is available from here and can be used with the following commands: # Initialize the database (optional, but avoids several hours of initial db synchronization)
docker run -ti --rm -v chainweb-db:/root/.local/share/chainweb-node/mainnet01/0/ kadena/chainweb-node /chainweb/initialize-db.sh # Run a chainweb-node in Kadena's mainnet
docker run -d -p 443:443 -v chainweb-db:target=/root/.local/share/chainweb-node/mainnet01/0/ kadena/chainweb-node Further details can be found in the README of the docker repository. Building from SourceIMPORTANT NODE: We recommend the use of officially released chainweb-node binaries or docker images, which can be found in the release section of this repository. If you decide to build your own binaries, please make sure to only use officially released and tagged versions of the code. Those versions are extensively tested to ensure that they are compatible with all other nodes in the chainweb network. It is generally not safe to run arbitrary builds of the master branch in the Kadena mainnet. Chainweb is a Haskell project. After cloning the code with git from this GitHub repository the chainweb-node application can be built as follows. Building with CabalIn order to build with You may also need to install To build a # Only necessary if you haven't done this recently.
cabal update
# Build the project.
cabal build To install a runnable binary to cabal install Building with NixAnother way to build and run chainweb is to use the Nix package manager which has binary caching capabilities that allow you to download pre-built binaries for everything needed by Chainweb. For detailed instructions see our wiki. When the build is finished, you can run chainweb with the following command: ./result/ghc/chainweb/bin/chainweb-node Bootstrap NodesBootstrap nodes are used by chainweb-nodes on startup in order to discover other nodes in the network. At least one of the bootstrap nodes must be trusted. Chainweb node operators can configure additional bootstrap nodes by using the
Bootstrap nodes must have public DNS names and a corresponding TLS certificate that is issued by a widely accepted CA (a minimum requirement is acceptance by the OpenSSL library). Operators of bootstrap nodes are expected be committed to guarantee long-term availability of the nodes. The list of builtin bootstrap nodes should be kept up-to-date and concise for each chainweb-node release. If you like to have your node included as a bootstrap node please make a pull request that adds your node to P2P.BootstrapNodes module. Current Testnet Bootstrap Nodes
Current Mainnet Bootstrap NodesAll bootstrap nodes are running on port 443.
Configuring, running, and monitoring the health of a Chainweb NodeThis section assumes you've installed the Note: Your node needs to be reachable from the public internet. You will have to perform Port Forwarding if your machine is behind a router (by default port 1789 is used by the node). NOTE: When you start chainweb-node for the first time it creates a new empty database and start to synchronize and catch up with other nodes in the Kadena network. This process takes a long time -- several days. It is much faster (depending on hardware one to a few hours) to just synchronize the chain database or get a snapshot of it and only rebuild the pact databases from the chain-database. Please, consult the documentation of the docker images for chainweb-node about details how to obtain an initial chain database. Run your node: chainweb-node The node will communicate with other nodes in a P2P network. By default it uses port 1789 for the P2P communication. Node services are exposed via the service API, by default on port 1848. The
service API includes While the P2P endpoint must be directly available from the public internet, it is highly recommended to expose the service API only on a private network. When service API endpoints are made available publicly it is recommended to use a reverse proxy setup things like rate limiting, authentication, and CORS. ConfigurationNo particular configuration is needed for running Chainweb node on the Kadena mainnet. Use A complete configuration file with the default settings can be created with chainweb-node --print-config > config.yaml This file can then be edited in order to change configuration values. The command Given a configuration file or a set of command line options it is possible to print out only those configuration values that are different from their respective default:
Monitoring the health of a Chainweb NodeThe following outlines how you can check that your
If you're behind a NAT, it is VERY IMPORTANT that your network allows external nodes to connect to the node you are running.
For production scenarios we recommend that you use log-level Once your node is running, go through the following checks to verify that you have a healthy node:
Usually, when a node is receiving and publishing cuts (i.e. block heights at every chain), it's working correctly. The You can get the cut height of any node by running the following:
Mine for a Chainweb NetworkSuccessful mining on mainnet requires specialized hardware (ASIC). The setup for solo mining involves running a chainweb-node with a configuration that enables mining and a chainweb-mining-client that connects to the mining API of a chainweb-node and provides a Stratum API for the mining hardware (ASIC). Detailed instructions for setting up all the infrastructure needed to start
mining using For example, to set up a chainweb node for mining, see this section of the docker-compose file. Detailed mining client instructions can be found in the documentation of chainweb-mining-client Chainweb DesignComponent StructureThe Chainweb package contains the following buildable components:
Architecture Overview |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论