diff --git a/search/search_index.json b/search/search_index.json index 022df48..c20ee79 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"XDC Network Docs","text":""},{"location":"#xdc-network-revolutionizing-the-future-of-decentralized-finance-and-global-trade","title":"XDC Network: Revolutionizing the Future of Decentralized Finance and Global Trade","text":"

XDC Network is a pioneering blockchain platform tailored to meet the evolving needs of decentralized finance (DeFi) and global trade. With its unparalleled speed, scalability, and cost-efficiency, XDC Network has become the go-to choice for developers creating decentralized applications (DApps) and for users looking to engage in the next generation of financial and trade ecosystems.

"},{"location":"#key-features-and-benefits-of-xdc-network","title":"Key Features and Benefits of XDC Network","text":""},{"location":"#chains","title":"Chains","text":"

The XDC protocol serves as a messaging and confirmation layer for global payments. Also, the XDC protocol supports smart contracts and Internet of Things (IoT) integrations. As a highly scalable enterprise-grade hybrid blockchain, the XDC protocol boasts a high throughput of 2,000 transactions per second (TPS) and near-instant transaction finality.

XDC Chain

XDC Network is a pioneering blockchain platform tailored to meet the evolving needs of decentralized finance (DeFi) and global trade. With its unparalleled speed, scalability, and cost-efficiency, XDC Network has become the go-to choice for developers creating decentralized applications (DApps) and for users looking to engage in the next generation of financial and trade ecosystems.

"},{"location":"#use-cases","title":"Use Cases","text":""},{"location":"#quick-start","title":"Quick Start","text":"XDC Chain

Get started with XDC Network: Unlock the power of decentralized finance and global trade.

Announcements

Stay updated with the latest XDC Network announcements and developments.

XDC Network: RPC Endpoints

Obtain the RPC Endpoint for XDC Network

XDC Network: Set up Node

XDC Network Masternodes are the backbone of the network, ensuring lightning-fast transaction validation and enhanced security.

Developer Tools

The XDC Chain Network provides a variety of tools and resources to help developers build and deploy applications on the blockchain.

XDC Subnet

XDC Subnet is a technology that allows you to create a secure, scalable, and decentralized network within the XDC Ecosystem.

"},{"location":"announce/","title":"Announcements","text":""},{"location":"announce/#announcement","title":"Announcement","text":"XDC 2.0 Mainnet Release XDC 2.0 Mainnet Release: Key Features and Enhancements October 2, 2024 XinFin Remix Upgrade XinFin Remix is getting a major upgrade and will be launching soon. Coming Soon! Solidity 0.8.23 Integration on XDC Mainnet This EVM upgrade supports the latest version of the Solidity smart contract programming language, version 0.8.23. 2024 June"},{"location":"join-ecosystem/","title":"Index","text":"Join XDC Ecosystem XDC token lies at the heart of XDC Network, and its transformative capabilities are truly awe-inspiring. As a versatile settlement mechanism, XDC fuels the entire ecosystem, enabling lightning-fast and cost-effective transactions while revolutionizing the way DApps function. All dApps

Discover top dApps built on XDC Network Chain, the leading blockchain scaling solution.

RWA

RWA on XDC Network!

DeFi

DeFi on XDC Network!

"},{"location":"join-ecosystem/platforms/dapp/","title":"dApps Built On XDC Network!","text":""},{"location":"join-ecosystem/platforms/defi/","title":"DeFi Built On XDC Network!","text":""},{"location":"join-ecosystem/platforms/rwa/","title":"RWA Built On XDC Network!","text":""},{"location":"showcase/","title":"Showcase","text":""},{"location":"showcase/#smart-contract-introduction","title":"Smart Contract Introduction","text":"

Blockchain technology is a digital ledger that continuously expands by adding records, known as blocks, which are securely connected through cryptography. Each block includes a cryptographic hash of the preceding block, a timestamp, and transaction data. The structure of blockchain ensures that once data is recorded, it is nearly impossible to alter, providing a high level of security. One of the key advantages of blockchain is its decentralized nature, eliminating the need for middlemen, which reduces both time and potential conflicts. Despite its challenges, blockchain technology is recognized for being faster, more economical, and more secure compared to traditional systems, which is why it\u2019s being increasingly adopted by banks and governments.

Now, imagine a contract that automatically executes when certain conditions are met, with the entire process managed by the blockchain network. This is the concept behind smart contracts.

"},{"location":"showcase/#what-are-smart-contracts","title":"What Are Smart Contracts?","text":"

A smart contract is a self-executing program that runs on a blockchain, containing a set of rules agreed upon by the involved parties. Once these predefined rules are satisfied, the contract automatically enforces the terms. Smart contracts facilitate, verify, and enforce the execution of an agreement or transaction without needing an intermediary, representing the simplest form of decentralized automation.

Put simply, a smart contract allows for the exchange of assets\u2014whether money, property, or anything else\u2014without the involvement of a middleman. This leads to trustless execution, where the contract enforces the terms without relying on any party\u2019s honesty or reliability.

Bitcoin was the first blockchain to introduce basic smart contracts, where transactions are only validated if specific conditions are met. Below is an example of a basic smart contract that includes functions to set and retrieve data, with simple operations to modify the data.

"},{"location":"showcase/#overview","title":"Overview","text":""},{"location":"showcase/#key-features-of-smart-contracts","title":"Key Features of Smart Contracts","text":"
  1. Trustworthiness: Smart contracts ensure that your agreements are securely stored on a blockchain, making it impossible for any party to lose or alter the contract. The terms are binding, and both parties must adhere to them.

  2. Transparency: Every detail of the smart contract is visible to all participants before they agree, eliminating the possibility of disputes. The information is open to everyone involved, ensuring clarity and preventing misunderstandings.

  3. Self-Governance: Smart contracts eliminate the need for intermediaries, such as brokers or lawyers, to validate the agreement. This also removes the risk of third-party manipulation, as the contract is automatically executed by the blockchain network.

  4. Precision: Automated contracts not only speed up the process but also reduce costs and eliminate human error. The conditions are clearly defined in the smart contract, ensuring that no detail is overlooked.

  5. Efficiency: Smart contracts automate tasks, saving considerable time that would otherwise be spent manually reviewing and processing agreements.

  6. Cost-Effectiveness: By removing the need for intermediaries, smart contracts can significantly reduce costs. For instance, you don\u2019t need to hire a lawyer to enforce the contract; the code itself ensures compliance.

  7. Security: The data in smart contracts is encrypted and protected by blockchain technology, making it highly secure and reliable for critical processes.

"},{"location":"showcase/#addressing-challenges","title":"Addressing Challenges","text":""},{"location":"showcase/#applications-of-smart-contracts","title":"Applications of Smart Contracts","text":"
  1. Digital Identity Management: Smart contracts allow individuals to maintain control over their digital identities, managing their data, reputation, and assets securely. Businesses can use this technology to streamline the know-your-customer (KYC) process.

  2. Financial Data Integrity: Financial institutions can leverage smart contracts for accurate and transparent data recording, improving financial reporting and reducing auditing expenses. This also enhances market stability by ensuring uniform financial data across organizations.

  3. Healthcare Management: Smart contracts can store personal health records securely on a blockchain, accessible only by authorized personnel. They can also be used to manage various healthcare operations, including drug tracking, compliance with regulations, and managing medical supplies.

  4. Real Estate Transactions: Smart contracts simplify real estate transactions by cutting out intermediaries. For example, rental agreements can be directly managed on the blockchain, reducing costs and making the process more efficient.

"},{"location":"showcase/#conclusion","title":"Conclusion","text":"

Smart contracts offer immense potential and have already shown signs of transforming various industries. However, they are still in the early stages, and much remains to be explored. As organizations become more familiar with blockchain technology and its applications, smart contracts could become easier to implement and more widely trusted. In the future, we might see a blend of traditional and digital contracts, where blockchain technology verifies the terms while physical copies provide additional validation.

"},{"location":"showcase/data-analytics/","title":"Showcase","text":""},{"location":"showcase/data-analytics/#data-and-analytics","title":"Data and Analytics","text":""},{"location":"showcase/data-analytics/#overview","title":"Overview:","text":"

The XDC Network\u2019s data and analytics tools are critical for understanding the dynamics of the blockchain. These tools provide detailed insights into how tokens are used, the behavior of smart contracts, and overall network activity. By leveraging these analytics, stakeholders can make informed decisions and optimize their interactions with the network.

"},{"location":"showcase/data-analytics/#key-features","title":"Key Features:","text":""},{"location":"showcase/data-analytics/#use-cases","title":"Use Cases:","text":""},{"location":"showcase/data-analytics/#xdcscan-mainnet","title":"XDCScan - Mainnet","text":""},{"location":"showcase/data-analytics/#overview_1","title":"Overview:","text":"

XDCScan is the official block explorer for the XDC Network, providing a user-friendly interface to explore and interact with the blockchain. It allows users to search for transactions, view block details, and explore smart contracts deployed on the network. XDCScan is a vital tool for anyone interacting with the XDC Network, from developers to casual users.

"},{"location":"showcase/data-analytics/#key-features_1","title":"Key Features:","text":""},{"location":"showcase/data-analytics/#use-cases_1","title":"Use Cases:","text":""},{"location":"showcase/data-analytics/#xdcscan-testnet-apothem","title":"XDCScan Testnet (Apothem)","text":""},{"location":"showcase/data-analytics/#overview_2","title":"Overview:","text":"

The Apothem XDCScan is the XDC Network\u2019s official test environment. XDCScan Testnet (Apothem) is the block explorer for this testnet, offering all the features of XDCScan but in a testnet context. It is ideal for developers who want to simulate the mainnet environment as closely as possible before deploying their projects.

"},{"location":"showcase/data-analytics/#key-features_2","title":"Key Features:","text":""},{"location":"showcase/data-analytics/#use-cases_2","title":"Use Cases:","text":""},{"location":"showcase/data-analytics/#xdcscan-devnet","title":"XDCScan Devnet","text":""},{"location":"showcase/data-analytics/#overview_3","title":"Overview:","text":"

XDCScan Devnet is a specialized version of XDCScan tailored for the XDC Network\u2019s development environment. It provides a safe and controlled environment for developers to test and debug their smart contracts before deploying them to the mainnet.

"},{"location":"showcase/data-analytics/#key-features_3","title":"Key Features:","text":""},{"location":"showcase/data-analytics/#use-cases_3","title":"Use Cases:","text":""},{"location":"showcase/flattening-smart-contracts/","title":"Showcase","text":""},{"location":"showcase/flattening-smart-contracts/#flattening-smart-contracts-on-the-xdc-network","title":"Flattening Smart Contracts on the XDC Network","text":"

When a smart contract imports a contract that it depends on from another source, that top level smart contract and it\u2019s dependencies will have to be flattened before it can be verified on a block explorer. This section explains how to flatten smart contracts using three different development toolchains; Remix, Truffle, and Hardhat.

For a good overview of flattening smart contracts on the XDC Network please refer to this article.

"},{"location":"showcase/flattening-smart-contracts/#flattening-smart-contracts-with-remix","title":"Flattening Smart Contracts with Remix","text":"

Remix IDE is one of the most user-friendly tools for smart contract development. To flatten a smart contract in Remix:

Refer to know in detail: https://www.xdc.dev/ivan_blocksscan/learn-how-to-flatten-a-smart-contract-and-verify-on-blocksscan-56on

"},{"location":"showcase/flattening-smart-contracts/#flattening-smart-contracts-with-truffle","title":"Flattening Smart Contracts with Truffle","text":"

Truffle is another powerful tool for smart contract development that supports the XDC Network. The process involves:

Refer to know in detail:

"},{"location":"showcase/flattening-smart-contracts/#flattening-smart-contracts-with-hardhat","title":"Flattening Smart Contracts with Hardhat","text":"

Hardhat offers advanced tooling for smart contract developers and supports the XDC Network natively. The flattening process using Hardhat involves:

Refer to know in detail: https://www.xdc.dev/jay_kulkarni_842b41d81b23/deploying-and-verifying-a-pepe-token-on-the-xdc-network-using-hardhat-3nc7

"},{"location":"showcase/tokens/","title":"Showcase","text":""},{"location":"showcase/tokens/#tokens-built-on-xdc","title":"Tokens Built On XDC","text":"

The XDC Network is a powerful blockchain platform designed to support various digital assets and decentralized applications. One of its key features is the ability to create and manage tokens, which can represent anything from currency to assets, data, or even unique digital items. On the XDC Network, tokens are classified into different standards based on their functionality and use cases. Here\u2019s an overview of the major token standards:

"},{"location":"showcase/tokens/#xrc20","title":"XRC20","text":""},{"location":"showcase/tokens/#overview","title":"Overview:","text":"

XRC20 is the most widely used token standard on the XDC Network, similar to the ERC20 standard on Ethereum. XRC20 tokens are fungible, meaning each token is identical in type and value to another token within the same contract. These tokens are primarily used for cryptocurrencies, utility tokens, and other financial instruments.

"},{"location":"showcase/tokens/#key-features","title":"Key Features:","text":""},{"location":"showcase/tokens/#use-cases","title":"Use Cases:","text":""},{"location":"showcase/tokens/#xrc721","title":"XRC721","text":""},{"location":"showcase/tokens/#overview_1","title":"Overview:","text":"

The XRC721 standard allows for the creation of non-fungible tokens (NFTs) on the XDC Network. Unlike XRC20 tokens, XRC721 tokens are unique and cannot be exchanged on a one-to-one basis. Each XRC721 token has a distinct value and set of characteristics, making them ideal for representing ownership of unique items or digital collectibles.

"},{"location":"showcase/tokens/#key-features_1","title":"Key Features:","text":""},{"location":"showcase/tokens/#use-cases_1","title":"Use Cases:","text":""},{"location":"showcase/tokens/#xrc404","title":"XRC404","text":""},{"location":"showcase/tokens/#overview_2","title":"Overview:","text":"

XRC404 is a specialized token standard designed for hybrid tokens on the XDC Network. These tokens combine features of both fungible and non-fungible tokens, offering a new level of flexibility for developers and businesses.

"},{"location":"showcase/tokens/#key-features_2","title":"Key Features:","text":""},{"location":"showcase/tokens/#use-cases_2","title":"Use Cases:","text":""},{"location":"showcase/xdcstats/","title":"Showcase","text":""},{"location":"showcase/xdcstats/#xdc-stats","title":"XDC Stats","text":""},{"location":"showcase/xdcstats/#overview","title":"Overview:","text":"

XDC Stats is a comprehensive analytics platform designed for the XDC Network. It provides real-time data and insights into various aspects of the blockchain, including token transactions, smart contract activity, and network performance. XDC Stats is essential for developers, investors, and users who need to monitor the network\u2019s health and activity levels.

Mainnet Stats | XinFin Network Stats

"},{"location":"showcase/xdcstats/#key-features","title":"Key Features:","text":""},{"location":"showcase/xdcstats/#use-cases","title":"Use Cases:","text":""},{"location":"showcase/wallet/xdc-wallet/","title":"Showcase - XDC Web Wallet","text":"

XDC Web wallet: https://betawallet.xinfin.network/

"},{"location":"subnet/","title":"XDC Subnet","text":""},{"location":"subnet/#xdc-subnet","title":"XDC Subnet","text":"

XDC Subnet is a technology that allows you to create a secure, scalable, and decentralized network within the XDC Ecosystem. It enables various use cases, including creating private subnets, deploying decentralized applications (dApps), and more. Are you ready to embark on a journey into the world of secure, scalable, and decentralized networks? Look no further than XDC Subnet, the cutting-edge technology that empowers you to create a digital realm tailored to your needs within the thriving XDC Ecosystem.

"},{"location":"subnet/#motivation-design-rationale","title":"Motivation & Design Rationale","text":"

As a leading Layer-1 (L1) public blockchain, XinFin\u2019s XDC network has attrated many enterprise and institutional customers. Besides the high performance and high security that XDC already offers, these customers also demand privacy, meaning that their transactions and ledger should not be disclosed to the public. This requirement prohibits them from directly submitting transactions to XDC. Instead, they should only checkpoint snapshots of their ledger to XDC in order to extract XDC\u2019s security.

From a system perspective, \u201csecurity via checkpointing\u201d is achieved via Layer-2 (L2) techniques, such as rollups and subnets. The most popular rollup technique, namely optimistic rollup, is not suitable for our use case. This is because while transaction execution is offloaded to L2, all these L2 transactions are still submitted to L1 as a record. Another popular rollup called zero-knowledge (ZK) rollup solves this problem. But ZK computation is slow, and the type of use cases it can currently support is very limited (such as token transfers), which cannot fulfill the diverse business needs of XDC\u2019s enterprise and institutional customers.

On the other hand, subnet is a perfect solution. By subnet, the customer runs a blockchain and checkpoints its critical consensus data to the parent chain. This way, not only is privacy preserved, the subnet can have its own security and resiliency besides those provided by the parent chain. This is particularly useful to enterprise and institutional customers who may collaborate with untrusted partners. A common criticism against subnet solutions is the high entry bar and operational cost of running a blockchain. However, in XDC\u2019s case, this is indeed welcomed becomes enterprise and institutional customers prefer owning the infrastructure in a private and isolated domain.

Motivated by this opportunity, XDC\u2019s core protocol team has tailor-designed a subnet solution for XDC\u2019s enterprise and institutional customers. It has the following main features: 1. the subnet will be a sovereign, permissioned, and high-performing blockchain wholly owned by the customer. 2. the subnet will be driven by XDC2.0, the most advanced and secure consensus engine originally-built for XDC in-house, and will be deployed to the XDC mainnet, too. 3. a security level equivalent to the sum security of the subnet AND XDC mainnet. 4. native EVM smart contract support. 5. total privacy (i.e., no visibility) of the subset transactions on the XDC mainnet. 6. full access and compatibility to XDC\u2019s abundant SDK and tools, such as the explorer and forensic monitoring system.

"},{"location":"subnet/#architecture","title":"Architecture","text":"

The architecture consists of the following key components owned by the customer:

"},{"location":"subnet/Installation_guide/","title":"Installation Guide","text":"

In the rapidly evolving landscape of blockchain technology, staying ahead of the curve is essential. One of the most intriguing advancements in the world of blockchain is the concept of blockchain subnets. In this comprehensive guide, we will dive deep into what blockchain subnets are, how they work, and why they are becoming a game-changer in the blockchain industry.

What Are Blockchain Subnets? Blockchain subnets are like specialized branches of a blockchain network. They allow you to create smaller, independent networks within a larger blockchain ecosystem. Think of them as self-contained mini-blockchains, each with its own unique features and functionalities. These subnets operate alongside the main blockchain but offer more flexibility and scalability.

How Do Blockchain Subnets Work? Blockchain subnets work by segregating the main blockchain into smaller, more manageable parts. This segmentation brings several advantages such as Scalability, Customization, Privacy and Security.

Setting Up Your Own Blockchain Subnet XDC Subnet is a powerful technology that allows you to create a secure, scalable, and decentralized network within the XDC Ecosystem. It enables various use cases, including creating private subnets, deploying decentralized applications (DApps), and more. In this guide, we\u2019ll walk you through the steps to set up your own XDC Subnet, opening doors to a world of possibilities.

Step 1: Uninstall Old Versions

Before you dive into setting up XDC Subnet, ensure that you don\u2019t have any conflicting packages from previous installations. Run the following command to uninstall them:

for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done\n

Enter fullscreen mode Exit fullscreen mode

Step 2: Set Up the Docker Repository

To install Docker Engine, you need to set up the Docker repository. Follow these steps:

  1. Update the apt package index and install required packages:

    $ sudo apt-get update $ sudo apt-get install ca-certificates curl gnupg

Enter fullscreen mode Exit fullscreen mode

  1. Add Docker\u2019s official GPG key:

    $ sudo install -m 0755 -d /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg - dearmor -o /etc/apt/keyrings/docker.gpg $ sudo chmod a+r /etc/apt/keyrings/docker.gpg

Enter fullscreen mode Exit fullscreen mode

  1. Use the following command to set up the repository:

    $ echo \\ \u201cdeb [arch=\u201d\\((dpkg - print-architecture)\" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \\ \"\\)(. /etc/os-release && echo \u201c$VERSION_CODENAME\u201d)\u201d stable\u201d | \\ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Enter fullscreen mode Exit fullscreen mode

  1. Update the apt package index again:

    $ sudo apt-get update

Enter fullscreen mode Exit fullscreen mode

Step 3: Install Docker Engine

  1. Now, you can install Docker Engine, containerd, and Docker Compose by running the following command:

    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Enter fullscreen mode Exit fullscreen mode

  1. Verify the installation by running:

    $ sudo docker run hello-world

Enter fullscreen mode Exit fullscreen mode

  1. Update the apt package index & Test the installation.

    $ sudo apt-get update $ docker compose version

Enter fullscreen mode Exit fullscreen mode

Your Docker installation will be successfully completed using these steps!

"},{"location":"subnet/Installation_guide/#with-docker-set-up-lets-move-on-to-setting-up-xdc-subnet","title":"With Docker set up, let\u2019s move on to setting up XDC Subnet.","text":"

Step 4: Clone the Subnet Repository

Clone the Subnet repository and change the directory:

git clone https://github.com/XinFinOrg/XinFin-Node.git\ncd XinFin-Node/subnet/deployment-generator/\n

Enter fullscreen mode Exit fullscreen mode

Step 5: Create a Docker Environment File

Create a docker.env file with parameters similar to docker.env.example, & make necessary configurations by entering below command.

cp docker.env.example docker.env\n

Enter fullscreen mode Exit fullscreen mode

Below is an example of the minimum file required for configs generation, Update the below parameters with your data in the docker.env file. Refer to check out in detail Config Explanation.

Enter fullscreen mode Exit fullscreen mode

docekr.env file:

#deployment config\nCONFIG_PATH= /XinFin-Node/subnet/deployment-generator\n#subnet config\nNETWORK_NAME=testsubnet\nNUM_SUBNET=1\nNUM_MACHINE=3\nMAIN_IP=192.168.1.1\n#parentchain config\nPARENTCHAIN=devnet\nPARENTCHAIN_WALLET=0x0000000000000000000000000000000000000000\nPARENTCHAIN_WALLET_PK=0x0000000000000000000000000000000000000000000000000000000000000000\n

Enter fullscreen mode Exit fullscreen mode

Step 6: Pull the Latest Subnet Generator Image

Pull the latest Subnet Generator image with this command:

sudo docker pull xinfinorg/subnet-generator:latest\n

Enter fullscreen mode Exit fullscreen mode

Step 7: Generate Configurations

Generate configurations, this will create a new generated directory.

docker run --env-file docker.env -v $(pwd)/generated:/app/generated xinfinorg/subnet-generator:latest && cd generated\n

Enter fullscreen mode Exit fullscreen mode

Follow the generated instructions in commands.txt to start Subnet Nodes and make sure they are mining.

Deploy subnet on machine1:

docker compose - env-file docker-compose.env - profile machine1 pull\ndocker compose - env-file docker-compose.env - profile machine1 up -d\n

Enter fullscreen mode Exit fullscreen mode

Step 8: Deploy the Checkpoint Smart Contract

Again, follow the generated instructions in commands.txt to deploy the Checkpoint Smart Contract to the \u201cdeployment-generator\u201d folder.

Run \u201ccd..\u201d command to get back to the \u201cdeployment-generator\u201d folder.

cd ~/.XinFin-Node/subnet/deployment-generator\ndocker run --env-file docker.env \\\n    -v $(pwd)/generated/deployment.json:/app/generated/deployment.json \\\n    --entrypoint 'bash' xinfinorg/subnet-generator:latest ./deploy_csc.sh\n

Enter fullscreen mode Exit fullscreen mode

Execute the following command to deploy the Checkpoint Smart Contract:

This will provide you with the Checkpoint Smart Contract address (checkpoint deployed to:)

Step 9: Deploy Subnet Services

Follow the instructions in commands.txt to deploy Subnet Services (relayer, stats-server, frontend) to the \u201cdeployment-generator/generated\u201d folder:

cd ~/.XinFin-Node/subnet/deployment-generator/generated\ndocker compose --env-file docker-compose.env --profile services pull\ndocker compose --env-file docker-compose.env --profile services up -d\n

Enter fullscreen mode Exit fullscreen mode

Step 10: Check the Status

docker ps -a\n

Enter fullscreen mode Exit fullscreen mode

Step 11: Explore the Subnet UI

Finally, explore the Subnet UI by accessing it at :5000.

Congratulations! You\u2019ve successfully set up your XDC Subnet, enabling you to harness the full potential of XDC Network\u2019s blockchain technology.

Checkout the guide for XDC Subnet user interface.

"},{"location":"subnet/Installation_guide/#some-common-issues-and-solutions","title":"Some Common Issues and Solutions:","text":"

Issue 1: Finding the System\u2019s IP Address

Question: If I do not have the private IP, where can I find the IP address of my system?

Answer: To determine your system\u2019s IP address, use the following command:

ip a\n

Enter fullscreen mode Exit fullscreen mode

Issue 2: Locating the Checkpoint Smart Contract Address

Question: Where can I find the checkpoint smart contract address?

Answer: After executing the command below, you will obtain the \u201ccheckpoint smart contract address.\u201d Please consult the \u201ccommand.txt\u201d file for the necessary commands.

cd ~/.XinFin-Node/subnet/deployment-generator\ndocker run - env-file docker.env \\\n-v $(pwd)/generated/deployment.json:/app/generated/deployment.json \\\n - entrypoint 'bash' xinfinorg/subnet-generator:latest ./deploy_csc.sh\n

Enter fullscreen mode Exit fullscreen mode

Issue 3: Resolving \u201cNo Such File or Directory\u201d Errors

Question: What should I do if I encounter the \u201cno such file or directory\u201d error repeatedly?

Answer: To address this, execute the command below to generate new configuration files. This will create a new directory to replace the existing one. Once you have the new directory, follow the subsequent steps as outlined in the \u201ccommand.txt\u201d file.

docker run - env-file docker.env -v $(pwd)/generated:/app/generated xinfinorg/subnet-generator:latest && cd generated\n

Enter fullscreen mode Exit fullscreen mode

Issue 4: Determining the Exact Config Path for \u201cdocker.env\u201d

Question: How can I find the exact configuration path to update in the \u201cdocker.env\u201d file?

Answer: To obtain the precise configuration path, use the \u201cpwd\u201d command, which will provide you with the necessary information.

pwd\n

Enter fullscreen mode Exit fullscreen mode

Issue 5: Troubleshooting \u2018CSC Deployment Failed\u2019 Issue: Checkpoint Smart Contract Deployment

Question: Encountering a \u201cCSC deployment failed\u201d issue during the deployment of the Checkpoint Smart Contract?

Answer: Please verify that the provided Private Key contains sufficient funds for both the Smart Contract deployment and subsequent transactions.

Blockchain subnets represent a new frontier in blockchain technology. They offer the scalability, customization, and security needed to drive innovation across various industries. As blockchain subnets continue to gain momentum, staying informed about their capabilities and potential applications is crucial for anyone involved in blockchain development or adoption.

If you have any questions or need assistance, don\u2019t hesitate to reach out to the XDC Network community on XDC.Dev. Start your XDC Subnet journey today!

"},{"location":"subnet/components/","title":"Upgrading the Subnet","text":"

404 Upgrading the Subnet

"},{"location":"subnet/setting_up_your_subnet/","title":"Setting Up Your Own XDC-Subnet Tutorial","text":"

Setting Up Your Own XDC-Subnet Tutorial

"},{"location":"subnet/upgrading_subnet/","title":"Upgrading the Subnet","text":""},{"location":"subnet/upgrading_subnet/#upgrading-the-subnet","title":"Upgrading the Subnet","text":""},{"location":"subnet/upgrading_subnet/#updating-configs","title":"Updating Configs","text":""},{"location":"subnet/upgrading_subnet/#upgrading-subnet-deployment","title":"Upgrading Subnet Deployment","text":""},{"location":"subnet/upgrading_subnet/#create-a-subnet-backup","title":"Create a Subnet backup","text":"
  1. Shutdown the subnet

  2. Make a copy of xdcchain directory

"},{"location":"subnet/upgrading_subnet/#update-subnet-versions","title":"Update Subnet Versions","text":"
  1. Go to docker-compose.yml under generated directory.
  2. Change the docker image tag of your desired component(s).
  3. Run:
      docker compose --env-file docker-compose.env --profile machine1 up -d\n  docker compose --env-file docker-compose.env --profile services up -d\n

Using latest tag is not recommended since not all components version are not guaranteed to be compatible.

"},{"location":"subnet/upgrading_subnet/#updating-services-configs","title":"Updating Services Configs","text":"
  1. Shut down subnet services
    docker compose --env-file docker-compose.env --profile services down\n
  2. Update configuration (usually ENVs inside common.env file)

  3. Start subnet services

    docker compose --env-file docker-compose.env --profile services up -d\n
"},{"location":"subnet/using_subnet/","title":"UI Usage Guide","text":""},{"location":"subnet/using_subnet/#ui-usage-guide","title":"UI Usage Guide","text":"

The guide for XDC Subnet user interface

"},{"location":"subnet/using_subnet/#homepage","title":"Homepage","text":"

Once subnet is successfully deployed. The homepage will show the following.

  1. The Subnet blockchain state. You can see the current \u2018Not Confirmed\u2019 and \u2018Confirmed\u2019 blocks. \u2018Confirmed\u2019 or \u2018committed\u2019 blocks should be 3 blocks behind latest blocks.
  2. The Subnet blockchain AS KNOWN by the Parentchain. The Relayer periodically calls the Checkpoint Smart Contract to update the Subnet status (default every 2 minutes).
  3. The Network Info card shows the Subnet throughput state, by default Blocktime should be every 2 seconds. It also indicates the Parentchain network
  4. The Relayer Info card shows the Relayer status. Which Checkpoint Smart Contract (CSC) it calls, Subnet blocks in the backlog, and the remaining wallet funds.
  5. The Masternodes Info card shows the Subnet nodes status. By default, all Subnet nodes are Masternodes and all should be active.

In the lower half of the homepage there are more information as shown.

  1. This card shows further details of subnet blocks, including their height, hash, proposer, and confirmation status. The left side of \u2018confirmation status\u2019 shows the block being committed in the Subnet chain and the right side shows the block hash being recorded in the Parent chain.

  2. This card shows a detailed view of the subnet nodes including their address. The status also differrentiates inactive nodes to \u2018penalty\u2019 or \u2018standby\u2019

  3. Additionally, you can select the UI theme (light or dark) by toggling this button.

"},{"location":"subnet/using_subnet/#confirmation-checker","title":"Confirmation Checker","text":"

After navigating with the left menu bar to the Confirmation Checker of the Subnet, this will be shown.

The input box accepts Block height, Block hash, and even TX hash.

After your input, the search engine will traverse the chain and display the info accodingly. Below is an example of Block height search.

  1. Confirmation status of the block (or the block that TX belongs to)
  2. The block detailed information
  3. The Parentchain block where the Subnet block was recorded

Next is another example of a Block hash search.

  1. Confirmation status of the block (or the block that TX belongs to)
  2. The block detailed information
  3. As the Subnet block has not been checkpointed in the Parentchain, the UI is displaying height 0.
"},{"location":"subnet/using_subnet/#subnet-management","title":"Subnet Management","text":"

Subnet management is used for adding and removing Masternodes in the Subnet. To manage the subnet, you need to use the Grandmaster Account, as only the Grandmaster has the right to manage the Subnet.

You can find the Grandmaster Key in the keys.json file.

After making a modification with Subnet management, the change will take effect in the next epoch (900 blocks).

When adding a Masternode address in the management, the new Masternode server should also be started up and added to the network.

"},{"location":"subnet/using_subnet/#1-log-in-to-the-wallet-and-connect-to-the-subnet","title":"1. Log in to the Wallet and Connect to the Subnet","text":"

To manage the subnet, you need to use your Grandmaster Account. Find the Grandmaster Key in the keys.json file and import this account into your wallet.

  1. Go to the correct tab and switch to the Grandmaster Account.
  2. Click the Connect Wallet button.

  3. Choose your wallet and allow the subnet network to be added. The wallet will automatically switch to this network, as shown below:

If the wallet doesn\u2019t switch to the subnet automatically, follow the instructions on the page to fill in the network details manually and connect to the subnet.

  1. Connect the account and network.

You will see a confirmation page like this:

"},{"location":"subnet/using_subnet/#2-node-operations","title":"2. Node Operations","text":""},{"location":"subnet/using_subnet/#21-add-nodes-in-a-subnet","title":"2.1 Add Nodes in a Subnet","text":"

Subnet nodes are managed by two files. To add a node, create the corresponding subnetX.env file and add an entry in docker-compose.yml. Apply the changes to add the node to the subnet. (To remove a node, delete the related configuration file)

To add a node, follow these steps:

  1. Go to the generated directory and run the add-node.sh script. Enter the key when prompted:

    cd .scripts/add-node.sh\n
  2. Update the subnet settings with the following commands:

    docker-compose --env-file docker-compose.env --profile machine1 up -d\ndocker-compose --env-file docker-compose.env --profile services up -d\n
"},{"location":"subnet/using_subnet/#22-add-candidate","title":"2.2 Add candidate","text":"
  1. Switch to the Master List Tab
  2. Click the Add a new master candidate button to add the node as a master node. Delegation amount must be at least 10,000,000 Subnet tokens.
"},{"location":"subnet/using_subnet/#23-change-node-delegation","title":"2.3 Change node delegation","text":""},{"location":"subnet/using_subnet/#24-remove-a-node","title":"2.4 Remove a node","text":"
  1. In the Master List Tab, select the node you want to remove, and click the Remove button.
  2. After removal, the node\u2019s delegated XDC will be reset to zero, and the node information will be removed from the list after one epoch.
"},{"location":"subnet/using_subnet/#faucet","title":"Faucet","text":"

In Subnets, all native tokens are initially assigned to the Grandmaster Wallet. To allow users to use the Subnet, we have to distribute the tokens out of the Grandmaster. We have provided convenient scripts for you to easily share Subnet tokens to your users.

"},{"location":"subnet/using_subnet/#one-time-transfer","title":"One-time Transfer","text":"

Under generated directory run the Faucet script.

./scripts/faucet.sh\n

The script will ask for your source wallet private key. You can use the Grandmaster Wallet(check keys.json file for the private key). Then input the destination wallet and the transfer amount.

"},{"location":"subnet/using_subnet/#faucet-server","title":"Faucet Server","text":"

Under generated directory run the Faucet server script.

./scripts/faucet-server.sh\n

The script will ask for your source wallet private key. you can use the Grandmaster Wallet(check keys.json for the private key). By default, the server is hosted on port 5211 of your machine. Then, on your browser, visit the url: http://127.0.0.1:5211

Input your destination wallet or feel free to generate a random wallet via Address Generator.

Submit and wait for confirmation.

You can host this on any server and allow users to make token requests by themselves.

"},{"location":"subnet/using_subnet/#transfer-subnet-funds-without-faucet","title":"Transfer Subnet Funds Without Faucet","text":"

The Faucet is not neccessary needed for funds transfer, most Ethereum compatible web3 wallet will also work.

First import a new wallet with the Grandmaster private key. Then add a custom network pointing to your Subnet RPC URL. Finally, use the web3 wallet for tokens transfer.

"},{"location":"subnet/using_subnet/#faucet-source-code","title":"Faucet Source Code","text":"

Please feel free to check the below repositories for the Subnet Faucet source code.

https://github.com/XinFinOrg/XinFin-Node/tree/master/subnet/deployment-generator/scripts

https://github.com/XinFinOrg/XinFin-Node/tree/master/subnet/deployment-generator/src/faucet.js

"},{"location":"subnet/using_subnet/#blockchain-explorer","title":"Blockchain Explorer","text":"

You may optionally use an external blocks explorer if you require verbose browsing such as block detail, accounts browsing, contracts browsing. We can recommend Chainlens-free as one of the solution. Please follow the instructions as the previous link. You only need to pass one of the Subnet\u2019s RPC as a variable in the docker-compose command, which will most likely be NODE_ENDPOINT=http://localhost:8545 or NODE_ENDPOINT=http://<MAIN_IP>:8545.

"},{"location":"subnet/components/api_library/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/api_library/#api-library","title":"API Library","text":"

This section specifies the API library we develop for the subnet users to confirm subnet transactions.

"},{"location":"subnet/components/api_library/#specifications","title":"Specifications","text":"

TBW

"},{"location":"subnet/components/checkpoint_contract/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/checkpoint_contract/#checkpoint-smart-contract","title":"Checkpoint Smart Contract","text":"

This section specifies the Checkpoint Smart Contract in the parent chain that protects the child chain.

"},{"location":"subnet/components/checkpoint_contract/#design","title":"Design","text":""},{"location":"subnet/components/checkpoint_contract/#overview","title":"Overview","text":"

The primary function of the parent chain smart contract is to receive block data from the subnet node, verify it, and store it.

Noteworthy aspects:

"},{"location":"subnet/components/checkpoint_contract/#specifics","title":"Specifics","text":""},{"location":"subnet/components/checkpoint_contract/#checkpoint","title":"Checkpoint","text":"

The Checkpoint contract implements a blockchain checkpoint system, which verifies and stores block header information for subnetworks. Here are some key functions and features:

Logic Flow:

  1. Checkpoint uses the following parameters for contract construction:

  2. address[] initial_validator_set: List of initial validator addresses

  3. bytes genesis_header: block0HexRLP
  4. bytes block1_header: block1HexRLP
  5. uint64 gap: GAP block number on public chain
  6. uint64 epoch: EPOCH block number on public chain

  7. Relayers need to fetch every block data from the subnet node.

  8. Users can retrieve the information of each block using methods such as getHeader.

"},{"location":"subnet/components/checkpoint_contract/#lite-checkpoint","title":"Lite Checkpoint","text":"

Lite Checkpoint is a lightweight block header checkpoint. It implements several functions, including:

Logic Flow:

  1. Lite Checkpoint uses the following parameters for contract construction:

  2. address[] initialValidatorSet: List of initial validator addresses

  3. bytes block1: block1HexRLP
  4. uint64 gap: GAP block number on public chain
  5. uint64 epoch: EPOCH block number on public chain

  6. Relayers only need to fetch gap/epoch block data and fetch the following consecutive roundNumber blocks to confirm the signed gap/epoch block from the subnet node.

  7. Users can get gap/epoch block information from methods such as getHeader.

"},{"location":"subnet/components/checkpoint_contract/#upgradeable-module","title":"Upgradeable module","text":"

The Upgradeable module mainly revolves around the concept of transparent proxies and the ability to upgrade the underlying logic contracts without changing the contract\u2019s address.

"},{"location":"subnet/components/checkpoint_contract/#proxygateway-smart-contract","title":"ProxyGateway Smart Contract","text":"

The ProxyGateway smart contract plays a central role in this module. It inherits from ProxyAdmin and primarily serves the purpose of creating and managing transparent upgradeable proxies (TransparentUpgradeableProxy).

Key Components and Functionalities:

Logic Flow:

  1. Initialization:

The process begins with the ProxyGateway contract, which serves as a central hub for creating transparent upgradeable proxies. The contract owner has the capability to create either \u201cfull\u201d or \u201clite\u201d proxies.

  1. Proxy Creation:

  2. The owner calls either the createFullProxy or createLiteProxy function based on the desired type of proxy.

  3. The specified logic contract\u2019s MODE is checked to ensure it matches the desired proxy type.
  4. A new TransparentUpgradeableProxy is created with the specified logic contract, the ProxyGateway as the admin, and any necessary initialization data.
  5. The new proxy\u2019s address is stored in the cscProxies mapping under its corresponding type.
  6. The CreateProxy event is emitted to log the creation of the new proxy.

  7. Upgrading the Proxy:

When there\u2019s a need to upgrade the underlying logic of the proxy (for instance, to introduce new features or fix bugs):

Users and other contracts can interact with the proxy just as they would with a regular contract. However, behind the scenes, all function calls and data accesses are delegated to the current logic contract that the proxy points to.

  1. Querying and Data Access:

Users and contracts can still query data, access functions, or invoke transactions on the proxy\u2019s address. The proxy transparently delegates these to the underlying logic contract, ensuring continuity of operations.

  1. Advanced Management:

Through the ProxyAdmin functionality, the owner can further manage the proxy, such as changing the admin or even downgrading to a previous version of the logic contract if needed.

"},{"location":"subnet/components/checkpoint_contract/#spec","title":"Spec","text":""},{"location":"subnet/components/checkpoint_contract/#apis","title":"APIs","text":""},{"location":"subnet/components/checkpoint_contract/#algorithms-and-rules","title":"Algorithms and Rules","text":"

Block header verification follows two principle rules: 1. Received block should have consistent round number and block number associated with its parent block. 2. Received block should have enough certificates signed by the list of block signers.

Once a block header is checked and stored, the contract will examine whether there are 3 consecutive blocks that have 3 consetive round number. If that is the case, all of the direct ancestor blocks that are prior to these 3 consecutive blocks will be committed.

"},{"location":"subnet/components/relayer/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/relayer/#relayer","title":"Relayer","text":"

This section specifies the relayer that checkpoints the subnet chain to the parent chain.

"},{"location":"subnet/components/relayer/#design","title":"Design","text":""},{"location":"subnet/components/relayer/#background","title":"Background","text":"

There is a strong demand from the banking industry to adopt XDC. One of the key requirements to enter the field is the ability to support subnets so that banks are able to keep the sensitive transactions within their own domain (privacy concern) but at the same time, have the ability to continuously audit the result (hash) of the subnet transactions on the XDC mainnet (security concern).

Since the mainnet and subnets will be running as two independent node cluster, we will need to figure out a method to bridge them together to perform the auditing feature mentioned above. This is where \u201crelayer\u201d is coming into play.

"},{"location":"subnet/components/relayer/#high-level-architectural-diagram","title":"High-level architectural diagram","text":"

At high level, the relayer is able to: 1. Pull necessary data from both subnet and mainnet 2. Process and submit subnet block data as smart contract transactions into mainnet 3. When subnet masternodes list changes, report the new list and change height to the mainnet using grand-master account.

"},{"location":"subnet/components/relayer/#relayer-mode","title":"Relayer Mode","text":"

There are 2 relayer modes \u2018Full\u2019 and \u2018Lite\u2019 where the default mode is \u2018Full\u2019. In the full mode, all subnet block headers are checkpointed to the parent chain. In the lite mode, only the Epoch and Epoch gap subnet block headers are checkpointed in the parent chain (blocks 451,900,1351,1800, and so on). The Epoch and Epoch gap blocks stores important information regarding subnet validators selection. For further reading please check Checkpoint Smart Contract.

"},{"location":"subnet/components/relayer/#choosing-full-or-lite-relayer","title":"Choosing Full or Lite Relayer","text":"

The Full mode has the advantage of being more \u2018complete\u2019 and more \u2018current\u2019 as blocks are getting confirmed in the parent chain almost immediately. The Lite mode has the advantage of using lower parent chain gas fee as the Relayer is only submitting to once every 450 blocks.

"},{"location":"subnet/components/relayer/#deployment","title":"Deployment","text":"

In the deployment RELAYER_MODE config is only relevant for Checkpoint Smart Contract (CSC) deployment. The relayer itself is able to detect the CSC type automatically and push block headers accordingly.

"},{"location":"subnet/components/subnet_chain/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/subnet_chain/#subnet-chain","title":"Subnet Chain","text":"

This section specifies the subnet itself, a sovereign, permissioned, and high-performing blockchain.

"},{"location":"subnet/components/subnet_chain/#design","title":"Design","text":"

XDC subnet is a blockchain network tailored for private and consortium use cases. It is powered by XDC2.0, which is the core engine of XDC network and enables state-of-the-art security against Byzantine attacks with forensics, fast transaction confirmation, and low energy consumption. It is also designed to enable secure checkpointing to XDC mainnet, so that it can harness the security, finality, and accountability of mainnet.

"},{"location":"subnet/components/subnet_chain/#xdc20-protocol","title":"XDC2.0 Protocol","text":"

As the core engine of both XDC mainnet and subnet, XDC2.0 maintains the consistency of the blockchain with strong security and performance guarantees. The Delegated Proof-of-Stake subprotocol elects a committee of masternodes. The masternodes run the state-of-the-art HotStuff consensus subprotocol to settle block generation and verification and confirm transactions. Besides, XDC2.0 protocol enables its unique feature, namely forensic monitoring. When the adversary corrupts more than \u2153 masternodes and violates safety, forensic monitoring can detect those actions and report irrefutable evidence of the culprits.

The distinction between XDC2.0 for subnet and mainnet is that for subnet the masternodes are permissioned whereas for mainnet they are permissionless.

"},{"location":"subnet/components/subnet_chain/#your-own-blockchain-network","title":"Your Own Blockchain Network","text":"

XDC subnet is completely owned by you. You, the owner of the subnet, are capable of controlling several aspects of the subnet.

First, the owner regulates the master node list. More specifically, the join/retire of mater nodes is done by smart contract calls that only the owner has access to. Also, underperforming or misbehaving masternodes could be expelled by the owner. This is in contrast with XDC mainnet, where masternodes join or leave willingly as long as they follow the rule enforced by the protocol.

Second, the blockchain genesis can be configured by the owner. The owner is able to distribute initial tokens and create accounts, as well as deploy system-level smart contracts on the blockchain.

Last, the owner can customize blockchain parameters, such as epoch length, max masternode number, the quorum certificate threshold, the reward per epoch, etc.

"},{"location":"subnet/components/subnet_chain/#integrating-with-xdc-mainnet","title":"Integrating with XDC mainnet","text":"

Integrating with XDC mainnet will enable subnet to harness the security, finality, and accountability of XDC mainnet. This requires the subnet owner to deploy a smart contract (XDC will provide) to XDC mainnet and report block headers and masternode changes to the smart contract.

As long as the mainnet is secure, the block header information of the subnet is securely stored on the mainnet. Users can also query the mainnet for finality to enhance the confidence that the subnet transaction is indeed finalized. The subnet can also report the culprits to the forensic server of XDC mainnet when its forensic monitor module detects safety violations. When the culprit report is validated, necessary measurements should be taken by the owner to reestablish the security of the subnet.

It is worth noting that the subnet can be deployed as a standalone, independent blockchain network without integrating with XDC mainnet. The choice is up to the owner whether to harness the advantages of XDC mainnet.

"},{"location":"subnet/components/subnet_chain/#api","title":"API","text":"

Subnet-specific APIs

"},{"location":"subnet/components/subswap/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/subswap/#subswap","title":"Subswap","text":""},{"location":"subnet/components/subswap/#design","title":"Design","text":"

Topic: Design of Subswap Cross-Chain Transfer System on XDC Zero

Subswap is cross-chain application built on XDC Zero to provide seamless cross-chain transfer capabilities. It is structured in a multi-layered architecture, with each layer handling distinct functions to ensure smooth, secure, and efficient transactions across blockchain networks. This document provides a design overview of each layer, illustrating the components and their roles within the Subswap system.

"},{"location":"subnet/components/subswap/#system-architecture","title":"System Architecture","text":"

Subswap is organized into three layers:

  1. Layer 0 - XDC Zero (Core Infrastructure)
  2. Relayer: Manages the transfer of data and assets between blockchains by relaying transaction information across chains.
  3. Oracle: Provides reliable and up-to-date data for cross-chain operations, ensuring that the transfer protocols operate with accurate information.
  4. Endpoint: Serves as the core communication channel within XDC Zero, connecting the layers and ensuring transactions flow smoothly.
  5. Front-End Management: Handles the user interface and manages interactions with the underlying protocols, offering a streamlined experience for users initiating cross-chain transfers.

  6. Layer 1 - Treasury

  7. Cross-Chain Transfer Frontend: User-facing interface for initiating and tracking cross-chain transactions. This frontend simplifies the user experience, making it easier for users to start transfers between different blockchains.
  8. Mint/Burn Contract: Manages asset issuance and burning on different chains. This contract mints new assets on the target chain while burning them on the source chain, maintaining asset consistency across networks.
  9. Lock/Unlock Contract: Locks assets on the source chain and unlocks them on the target chain, ensuring that the asset\u2019s total supply remains consistent and secure across chains.

  10. Layer 2 - Swap Protocol

  11. Swap Frontend: Provides a user-friendly interface for initiating swaps between different assets on the Subswap platform.
  12. Swap Contract: Executes the swap logic, managing the conversion of assets based on the predefined terms and rates, ensuring that users receive the correct assets after a swap.
"},{"location":"subnet/components/subswap/#design-considerations","title":"Design Considerations","text":""},{"location":"subnet/components/subswap/#conclusion","title":"Conclusion","text":"

Subswap leverages XDC Zero\u2019s powerful infrastructure to deliver an efficient cross-chain transfer service. By layering its architecture, Subswap can maintain security, scalability, and ease of use, meeting the needs of users looking for seamless asset transfers across multiple blockchain networks.

"},{"location":"subnet/components/subswap/#constructionif-you-want-to-make-a-cross-chain-transfer","title":"Construction(if you want to make a cross chain transfer)","text":""},{"location":"subnet/components/subswap/#spec","title":"Spec","text":""},{"location":"subnet/components/subswap/#subswap-api-documentation","title":"Subswap API Documentation","text":"

This document provides an API reference for the Subswap contracts, specifically for the ParentnetTreasury and SubnetTreasury contracts. These contracts facilitate cross-chain asset transfers by minting, burning, locking, and unlocking tokens between chains.

"},{"location":"subnet/components/subswap/#restricted-access-functions","title":"Restricted Access Functions","text":""},{"location":"subnet/components/subswap/#parentnettreasury","title":"ParentnetTreasury","text":"
  1. changeEndpoint(address endpoint) -> void
  2. Description: Allows the contract owner to set a new endpoint address.
  3. Parameters:
  4. Access: onlyOwner

  5. setEndpoint(address endpoint) -> void

  6. Description: Sets a new endpoint address, restricted to calls from the current endpoint.
  7. Parameters:
  8. Access: onlyEndpoint

  9. mint(...) -> void

  10. Description: Mints tokens on the SubnetTreasury chain in response to a cross-chain transfer.
  11. Parameters:
  12. Access: onlyEndpoint
"},{"location":"subnet/components/subswap/#subnettreasury","title":"SubnetTreasury","text":"
  1. changeEndpoint(address endpoint) -> void
  2. Description: Allows the contract owner to set a new endpoint address.
  3. Parameters:
  4. Access: onlyOwner

  5. setEndpoint(address endpoint) -> void

  6. Description: Sets a new endpoint address, restricted to calls from the current endpoint.
  7. Parameters:
  8. Access: onlyEndpoint

  9. unlock(address token, uint256 amount, address recv) -> void

  10. Description: Unlocks tokens on the current chain, sending them to the specified address.
  11. Parameters:
  12. Access: onlyEndpoint
"},{"location":"subnet/components/subswap/#public-functions","title":"Public Functions","text":""},{"location":"subnet/components/subswap/#parentnettreasury_1","title":"ParentnetTreasury","text":"
  1. burn(...) -> void
  2. Description: Burns tokens on the ParentnetTreasury side to initiate a cross-chain transfer, sending a message to SubnetTreasury to mint tokens.
  3. Parameters:
  4. Events:

  5. test(uint256 rid, address rua, bytes memory data) -> void

  6. Description: Sends arbitrary data to the specified chain via the endpoint, for testing purposes.
  7. Parameters:

  8. getEndpoint() -> address

  9. Description: Returns the current endpoint address.
"},{"location":"subnet/components/subswap/#subnettreasury_1","title":"SubnetTreasury","text":"
  1. lock(...) -> void
  2. Description: Locks tokens on the SubnetTreasury side to initiate a cross-chain transfer, sending a message to ParentnetTreasury to mint tokens.
  3. Parameters:
  4. Events:

  5. getChainId() -> uint256

  6. Description: Returns the chain ID of the current chain.

  7. getEndpoint() -> address

  8. Description: Returns the current endpoint address.
"},{"location":"subnet/components/subswap/#algorithms-and-rules","title":"Algorithms and Rules","text":""},{"location":"subnet/components/subswap/#minting-and-burning","title":"Minting and Burning","text":""},{"location":"subnet/components/subswap/#locking-and-unlocking","title":"Locking and Unlocking","text":""},{"location":"subnet/components/subswap/#endpoint-and-cross-chain-communication","title":"Endpoint and Cross-Chain Communication","text":""},{"location":"subnet/components/xdc_zero/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/xdc_zero/#xdczero","title":"XDCZero","text":""},{"location":"subnet/components/xdc_zero/#design","title":"Design","text":"

XDC-Zero is a cross-chain framework that allows interoperability between XDC-Subnet and the XDC network. It ensures frictionless data transmission and rigorous validation across the Subnet and the Parentchain.

"},{"location":"subnet/components/xdc_zero/#key-components","title":"Key Components","text":""},{"location":"subnet/components/xdc_zero/#oracle","title":"Oracle","text":"

Acting as the architectural keystone, the Oracle ensures the safe transfer of pivotal data, notably block headers, bridging source and target blockchains. Utilizing CSC contracts, the system guarantees not just steadfast data transfer but also the safeguarding of crucial block header details on the destination blockchain. Such functionalities affirm the data\u2019s integrity and coherence throughout chains.

"},{"location":"subnet/components/xdc_zero/#relayer","title":"Relayer","text":"

The Relayer functions as the essential conduit for transactional precision. Its core duty is to extract payload data from the source chain\u2019s Endpoint contract and channel it to the counterpart on the target chain. With this mechanism in place, XDC ZERO promises the exact and secure relay of transaction data, fostering efficient cross-chain synergies.

"},{"location":"subnet/components/xdc_zero/#endpoint","title":"Endpoint","text":"

The XDC Zero Endpoint stands as the nexus for cross-chain communication, adeptly receiving and dispatching data packets across disparate blockchain networks. It offers indispensable services for the fluid operation of the cross-chain paradigm:

At its core, the Endpoint functions as the orchestrator for all cross-chain data activities, ensuring data is meticulously received, processed, and channeled to its rightful destination.

"},{"location":"subnet/components/xdc_zero/#frontend","title":"Frontend","text":"

Experience a user-centric interface to manage the endpoint contracts spanning different chains. View the chain entities already synchronized with the current endpoint contract and effortlessly onboard new chain entities as per requirements.

"},{"location":"subnet/components/xdc_zero/#endpoint-workflow","title":"Endpoint workflow","text":""},{"location":"subnet/components/xdc_zero/#workflow","title":"Workflow","text":""},{"location":"subnet/components/xdc_zero/#api-documentation","title":"API Documentation","text":""},{"location":"subnet/components/xdc_zero/#restricted-access-functions","title":"Restricted Access Functions","text":"

Functions accessible only by the contract owner or authorized clients.

  1. send(uint256 rid, address rua, bytes data)

  2. Description: Sends a packet to the designated receive chain.

  3. Parameters:

  4. validateTransactionProof(uint256 csid, bytes key, bytes[] calldata receiptProof, bytes[] calldata transactionProof, bytes32 blockHash)

  5. Description: Validates transaction and receipt proofs, ensuring secure cross-chain communication.

  6. Parameters:

  7. registerChain(uint256 chainId, IFullCheckpoint csc, Endpoint endpoint)

  8. Description: Registers a new chain for packet reception.

  9. Parameters:

  10. approveApplication(uint256 rid, address rua, address sua)

  11. Description: Approves both a receive and send application for cross-chain interaction.

  12. Parameters:

  13. approveRua(uint256 rid, address rua)

  14. Description: Approves a receive application (rua) for a specific chain.

  15. Parameters:

  16. approveSua(address sua)

  17. Description: Approves a send application (sua) for packet sending.

  18. Parameters:

  19. revokeApplication(uint256 rid, address rua, address sua)

  20. Description: Revokes approval for both a receive and send application.

  21. Parameters:

  22. revokeRua(uint256 rid, address rua)

  23. Description: Revokes approval for a specific receive application.

  24. Parameters:

  25. revokeSua(address sua)

  26. Description: Revokes approval for a send application.
  27. Parameters:
"},{"location":"subnet/components/xdc_zero/#public-functions","title":"Public Functions","text":"

Functions accessible by any user or contract on the blockchain.

  1. packetHash() returns (bytes32)

  2. Description: Retrieves the hash for the Packet event.

  3. getRlp(bytes memory key, bytes[] calldata proof, bytes32 root) returns (bytes memory)

  4. Description: Retrieves RLP data based on a Merkle Patricia proof.

  5. getFailureDataLength(uint256 rid) returns (uint256)

  6. Description: Retrieves the count of failed data entries for a specified receive chain.

  7. getReceiveChainLastIndex(uint256 chainId) returns (uint256)

  8. Description: Retrieves the last index for a specified receive chain.

  9. getSendChain(uint256 chainId) returns (Chain memory)

  10. Description: Retrieves details of a send chain based on its ID.

  11. getSendChainIds() returns (uint256[] memory)

  12. Description: Returns an array of all registered send chain IDs.

  13. allowanceRua(uint256 rid, address rua) returns (bool)

  14. Description: Checks if a receive application is approved for a specific chain.

  15. Parameters:

  16. allowanceSua(address sua) returns (bool)

  17. Description: Checks if a send application is approved.
  18. Parameters:
"},{"location":"subnet/components/xdc_zero/#algorithms-and-rules","title":"Algorithms and Rules","text":""},{"location":"subnet/install_guide/config_explanation/","title":"Upgrading the Subnet","text":""},{"location":"subnet/install_guide/config_explanation/#configs-explanation","title":"Configs Explanation","text":""},{"location":"subnet/install_guide/config_explanation/#files-under-generated-directory","title":"Files under \u2018generated\u2019 directory","text":"

After the generator has succesfully run, all generated files will be under \u2018generated\u2019 directory. These files can be edited if you would like to further customize your subnet. Below is a description of each generated file and how it is used.

"},{"location":"subnet/install_guide/config_explanation/#commonenv","title":"common.env","text":""},{"location":"subnet/install_guide/config_explanation/#subnetenv","title":"subnet*.env","text":""},{"location":"subnet/install_guide/config_explanation/#subnet-ports","title":"Subnet Ports","text":"
  1. Subnet Nodes - 3 ports are used per each subnet, RPC port, WS port, and Peering port. The port number is incremented by 1 for the next subnet node. For example subnet1\u2019s RPC is 8545, subnet2\u2019s RPC will be 8546 and so on.
  2. RPC PORT - 8545, 8546, 8547, \u2026 This is the API port, for outside chain communication to issue transaction or query chaindata.
  3. WS PORT - 9555, 9556, 9557, \u2026 This is not used currently.
  4. Peering port - 20303, 20304, 20305, \u2026 This is used for subnet nodes and bootnode peering and communication.
  5. Subnet ports config can be changed in subnetX.env for each individual subnet.
  6. Bootnode - port 20301
  7. Bootnode port can be changed at BOOTNODE_PORT under common.env. Also in each subnetX.env, BOOTNODES port has to be changed.
  8. Stats Server (UI backend) - port 5213.
  9. UI Frontend - port 5214.
  10. Relayer UI - port 5215.
  11. Faucet Server - port 5211
  12. Generator UI - port 5210.
"},{"location":"subnet/install_guide/f%26q/","title":"Upgrading the Subnet","text":""},{"location":"subnet/install_guide/f%26q/#frequently-asked-questions","title":"Frequently Asked Questions","text":""},{"location":"subnet/install_guide/f%26q/#subnet-launch","title":"Subnet Launch","text":""},{"location":"subnet/install_guide/f%26q/#common-issues","title":"Common Issues","text":""},{"location":"subnet/install_guide/f%26q/#troubleshooting-scripts","title":"Troubleshooting Scripts","text":"

This will check your current block in Subnet

This will check the number of peers of your Subnet node

"},{"location":"subnet/install_guide/f%26q/#subnet-node-requirements","title":"Subnet Node Requirements","text":"

Even one node is enough to start the Subnet blockchain! However, for better decentralized security, 3+ nodes are recommended. At least \u2154 of all nodes must be online and honest to mine blocks.

"},{"location":"subnet/install_guide/f%26q/#development-and-testing","title":"Development and Testing","text":"

It\u2019s recommended to use the testnet, as the devnet will be less stable due to frequent development changes.

"},{"location":"subnet/install_guide/f%26q/#managing-subnet-tokens","title":"Managing Subnet Tokens","text":"

In XDC-Subnet, all initial tokens are assigned to the Grandmaster wallet (check keys.json). You can transfer tokens to any wallet address. For easy transfers, refer to the Faucet documentation.

A Faucet server script is provided for you to deploy under generated/scripts/faucet-server.sh. Anyone with access to the faucet page can request tokens. Please refer to the faucet page for more details.

"},{"location":"subnet/install_guide/f%26q/#security-and-sensitive-files","title":"Security and Sensitive Files","text":"

The following files contain sensitive information and should be stored securely:

"},{"location":"subnet/install_guide/f%26q/#configuration-changes","title":"Configuration Changes","text":"

You can update the common.env file to change the Relayer key. Refer to the service configuration documentation for more details.

"},{"location":"subnet/install_guide/f%26q/#troubleshooting","title":"Troubleshooting","text":"

For troubleshooting support, join our Telegram Support Group. For suggestions or requests, you can also reach out via:

"},{"location":"subnet/install_guide/launch_subnet/","title":"Upgrading the Subnet","text":""},{"location":"subnet/install_guide/launch_subnet/#launch-a-subnet","title":"Launch a Subnet","text":""},{"location":"subnet/install_guide/launch_subnet/#requirements","title":"Requirements","text":""},{"location":"subnet/install_guide/launch_subnet/#video-walkthrough","title":"Video Walkthrough","text":""},{"location":"subnet/install_guide/launch_subnet/#generate-subnet-configs-with-ui","title":"Generate Subnet Configs With UI","text":"
  1. Pull generator.sh script from the generator Github repo

    curl -O https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/subnet/deployment-generator/scripts/generate.sh\n
  2. Run the configuration generator, this will start a local webserver

    chmod +x generate.sh\n./generate.sh\ncd generated\n
  3. Go to http://localhost:5210/ in your browser. If you are running this on a remote server.

    first use ssh tunnel: ssh -N -L localhost:5210:localhost:5210 USERNAME@IP_ADDRESS -i SERVER_KEY_FILE

  4. Config the Subnet options per your requirement.

  5. follow the generated instructions in commands.txt. In general, the steps are:

  6. Once successfully deployed, you can check out UI usage guide

"},{"location":"subnet/install_guide/launch_subnet/#removing-subnet","title":"Removing Subnet","text":""},{"location":"subnet/install_guide/launch_subnet/#shutdown-subnet","title":"Shutdown Subnet","text":"

Under generated directory

docker compose --env-file docker-compose.env --profile services down \ndocker compose --env-file docker-compose.env --profile machine1 down\n
"},{"location":"subnet/install_guide/launch_subnet/#deleting-subnet","title":"Deleting Subnet","text":"

Remove xdcchain*, bootnodes, and stats-service directories Warning: this cannot be undone

rm -rf xdcchain* bootnodes stats-service\n
"},{"location":"xdcchain/","title":"XDC Chain","text":"XDC Chain

The XDC Network is a cutting-edge blockchain platform designed to revolutionize the way businesses manage and exchange data, assets, and financial records. Boasting impressive speed and scalability, the XDC Network is capable of handling a high volume of transactions with minimal delays, making it ideal for enterprise-level applications. Its low transaction fees further enhance its appeal, allowing businesses to conduct operations cost-effectively.

What truly sets the XDC Network apart is its military-grade security, ensuring that all data exchanges and asset transfers are protected against potential threats. This level of security is crucial for industries where trust and confidentiality are paramount. By leveraging the XDC Network, businesses can streamline their operations, improve record-keeping accuracy, and facilitate more efficient and secure data exchanges. Whether it's in finance, supply chain management, or trade, the XDC Network provides a robust and reliable infrastructure that empowers businesses to thrive in the digital age.

Developers

User guide to get started on XDC Chain

Governance

XDC Network is a community-oriented ecosystem, meticulously built upon the foundation of decentralized governance.

XDC Ecosystem

XDC ecosystem and developer tools

Run a Masterode

How to run a XDC Masternode

JSON-RPC API

Interacting with XDC requires sending requests to specific JSON-RPC API methods.

"},{"location":"xdcchain/evmtoxdc/","title":"Overview - XDC Chain","text":""},{"location":"xdcchain/evmtoxdc/#migrating-from-evm-to-xdc","title":"Migrating from EVM to XDC","text":"

Migrating a Solidity contract from Ethereum to the XDC network with Truffle involves several steps. The XDC network is a public blockchain that is EVM-compatible and designed to support enterprise-level applications. Truffle is a popular development framework for creating and deploying Solidity contracts.

"},{"location":"xdcchain/evmtoxdc/#step-1-install-truffle","title":"Step 1: Install Truffle","text":"

The first step is to install the XDC network and Truffle. This can be done by following the installation instructions provided by XDC and Truffle.

Installation - Truffle Suite

"},{"location":"xdcchain/evmtoxdc/#step-2-configure-truffle-for-xdc","title":"Step 2: Configure Truffle for XDC","text":"

Next, Truffle needs to be configured to work with the XDC network. This involves creating a new Truffle project and configuring the Truffle config file to connect to the XDC network by using a public RPC connected to the XDC network.

Configuration - Truffle Suite

"},{"location":"xdcchain/evmtoxdc/#step-3-compile-the-contract","title":"Step 3: Compile the Contract","text":"

After updating the Solidity contract, it needs to be compiled for the XDC network. This involves using the Truffle compiler to create a bytecode file that can be deployed on the XDC network.

Compile contracts - Truffle Suite

"},{"location":"xdcchain/evmtoxdc/#step-4-deploy-the-contract","title":"Step 4: Deploy the Contract","text":"

The next step is to deploy the updated contract on the XDC network. This can be done using Truffle\u2019s deployment commands. It is important to ensure that the contract is deployed correctly and securely.

"},{"location":"xdcchain/evmtoxdc/#step-5-test-the-contract","title":"Step 5: Test the Contract","text":"

After deploying the contract, it is important to thoroughly test it on the XDC network. This includes testing all functions and features, as well as testing for security vulnerabilities. You can write tests in Truffle using Javascript to build debug and test contracts ready to be deployed onto the network

Write JavaScript tests - Truffle Suite

"},{"location":"xdcchain/evmtoxdc/#step-6-update-clients-and-interfaces","title":"Step 6: Update Clients and Interfaces","text":"

Once the contract has been migrated and tested, any clients or interfaces that interact with the contract must be updated to be compatible with the XDC network by having them point to the appropriate RPCs on the xdc network.

For a How-To guide showing migration of a dApp from Ethereum to the XDC Network please go to this link.

"},{"location":"xdcchain/introduction/","title":"Introduction","text":""},{"location":"xdcchain/introduction/#introduction","title":"Introduction","text":"

XinFin\u2019s XDC Network is an enterprise-ready, Layer-1, EVM-compatible, open-source, hybrid blockchain protocol specializing in tokenization for real-world decentralized finance. It uses a special type of delegated proof-of-stake (XDPoS) for consensus to ensure quick transaction times, minimal gas fees, and a remarkable 2,000+ transactions per second (TPS).

XDC Network is backed by the XDC Community, leading to the formation of the XDC Foundation, which was established in 2021 to promote the growth and adoption of XDC through collaboration with a community of developers, trade experts, and content creators.

"},{"location":"xdcchain/introduction/#xinfin-delegated-proof-of-staked-authority","title":"XinFin Delegated Proof of Staked Authority","text":"

-

"},{"location":"xdcchain/introduction/#security","title":"Security","text":"

-

"},{"location":"xdcchain/introduction/#fast-finality","title":"Fast Finality","text":"

-

"},{"location":"xdcchain/introduction/#reward","title":"Reward","text":"

-

"},{"location":"xdcchain/introduction/#token-economy","title":"Token Economy","text":"

-

"},{"location":"xdcchain/introduction/#staking-and-governance","title":"Staking and Governance","text":"

-

"},{"location":"xdcchain/rewards/","title":"Rewards Mechanism","text":""},{"location":"xdcchain/rewards/#rewards-mechanism","title":"Rewards Mechanism","text":"

The XDC Network operates on a Delegated Proof of Stake (XDPoS) consensus mechanism, which allows for high transaction throughput, energy efficiency, and security. The network\u2019s rewards mechanism is designed to incentivize Masternode operators and participants who contribute to the stability, security, and growth of the network. This document outlines how the XDC rewards mechanism works, who is eligible for rewards, and how rewards are distributed.

"},{"location":"xdcchain/rewards/#overview-of-xdc-rewards-system","title":"Overview of XDC Rewards System","text":"

In the XDC Network, rewards are primarily distributed to Masternode operators who validate transactions, secure the network, and propose new blocks. Additionally, XDC token holders who delegate their tokens to Masternodes also earn a share of the rewards. The rewards mechanism is structured to:

Incentivize decentralization by encouraging more participants to run Masternodes or delegate their tokens. Reward active participation in the network, such as block validation and staking. Ensure the economic sustainability of the XDC Network over time.

"},{"location":"xdcchain/rewards/#masternode-operator-rewards","title":"Masternode Operator Rewards","text":"

Masternodes are critical to the XDC Network\u2019s operations, responsible for validating transactions and maintaining consensus. To compensate for their role, Masternode operators receive rewards for every block they validate.

Note: Masternodes with better uptime and performance will receive a higher portion of the rewards.

"},{"location":"xdcchain/xdpos/","title":"Overview - XDC Chain","text":""},{"location":"xdcchain/xdpos/#xdpos-xdcs-consensus-mechanism","title":"XDPoS - XDC\u2019s Consensus Mechanism","text":"

XinFin Delegated Proof of Stake(XDPoS) is another form of Proof of Stake(PoS) consensus mechanism to scale up to Thousands of transactions per second. XDPOS concentrates block production in the hands of few semi-trusted entities in order to achieve more scalability than Proof of Work(PoW) or other Proof of Stake blockchains. XDPOS leverages the power of stakeholder to resolve consensus issues in a fair and democratic way. The Self KYC feature added in XinFin XDPoS is more enterprise and regulator friendly.

"},{"location":"xdcchain/xdpos/#common-terms","title":"Common Terms","text":""},{"location":"xdcchain/xdpos/#transition-from-pow-to-xdpos","title":"Transition from PoW to XDPoS","text":"

The traditional PoW mechanism, while effective in securing networks, is highly energy-intensive due to its reliance on solving complex cryptographic puzzles across all nodes in the network. This results in significant electricity consumption and poses environmental concerns. Recognizing these drawbacks, XinFin transitioned away from PoW and adopted Proof of Stake (PoS), a more energy-efficient consensus methodology. Eventually, XinFin advanced to XinFin Delegated Proof of Stake (XDPoS), which further enhances the efficiency and security of the network.

To understand XDC Network\u2019s decision to adopt XDPoS, it\u2019s essential to explore the various consensus mechanisms.

"},{"location":"xdcchain/xdpos/#understanding-consensus-pow-vs-pos-vs-xdpos","title":"Understanding Consensus: PoW vs. PoS vs. XDPoS","text":"

In blockchain technology, consensus refers to a general agreement among nodes in the network, which is crucial for maintaining the integrity and accuracy of the distributed ledger. Unlike centralized systems like banks, where a central authority maintains records, blockchain relies on distributed ledgers to record information. Consensus ensures that all nodes agree on the state of the blockchain, including account balances, transactions, and more.

Proof of Work (PoW) PoW relies on nodes solving cryptographic puzzles to validate transactions and create new blocks. This process requires significant computational power and consumes vast amounts of electricity, making it environmentally unsustainable and costly.

Proof of Stake (PoS) PoS eliminates the need for energy-intensive computations. Instead of miners, PoS relies on validators who lock a portion of their cryptocurrency as a stake. Validators are chosen to propose the next block based on their stake and uptime. When a validator discovers a block that can be added to the blockchain, they validate it by placing a bet on it. The validators receive rewards proportional to their bets.

XinFin Delegated Proof of Stake (XDPoS) XDPoS is an evolution of PoS and offers greater efficiency. It uses a reputation-based system to achieve consensus, where master nodes create blocks in a round-robin manner. The network elects block producers (also known as witnesses) who are responsible for validating transactions and creating the next block. The key features of XDPoS include:

"},{"location":"xdcchain/xdpos/#pros-and-cons-of-xinfin-delegated-proof-of-stake","title":"Pros and Cons of XinFin Delegated Proof of Stake","text":""},{"location":"xdcchain/xdpos/#advantages","title":"Advantages","text":""},{"location":"xdcchain/xdpos/#disadvantages","title":"Disadvantages","text":""},{"location":"xdcchain/xdpos/#why-xdc-network-prefers-xdpos","title":"Why XDC Network Prefers XDPoS","text":"

XDC Network chose XDPoS for its network due to its superior speed, cost efficiency, and scalability. XDPoS offers a more democratic, faster, and effective way to scale the network, making it the ideal consensus mechanism for XDC\u2019s hybrid blockchain platform.

"},{"location":"xdcchain/xdpos2/","title":"Overview - XDC Chain","text":""},{"location":"xdcchain/xdpos2/#xdpos-20","title":"XDPoS 2.0","text":"

Sitting at the core of the XDC Network, XinFin Delegated Proof-of-Stake consensus protocol 2.0 (XDPoS 2.0) regulates the XDC nodes in maintaining the consistency of a decentralized ledger (the blockchain) with strong security and performance guarantees. In this section, we provide an overview of XDPoS 2.0 by introducing its three pillars, including:

  1. Master node election, which specifies how the delegation and proof-of-stake works.

  2. The consensus engine, namely, the HotStuff state machine replication (SMR) protocol, which is the state-of-the-art BFT (Byzantine fault-tolerant) SMR (state-machine replication) protocol. An illustration of its position in XDPoS 2.0 and a brief security analysis will be provided.

  3. Reward mechanism, which incentivizes nodes to join and maintain the XDC Network.

"},{"location":"xdcchain/developers/apothemrpc/","title":"XDC Network - Apothem RPC","text":""},{"location":"xdcchain/developers/apothemrpc/#apothem-testnet-rpc","title":"Apothem Testnet RPC","text":"

The Apothem Testnet is the test environment for the XDC Network. It mirrors the Mainnet\u2019s functionality but operates with test tokens instead of real assets, making it ideal for developers to test and deploy their applications before going live.

Public Networks Similar to the Mainnet, users can access the Apothem Testnet with an internet connection and full node RPC. They can perform all the same actions as on the Mainnet\u2014reading, creating, or validating transactions\u2014without the risks associated with live transactions.

"},{"location":"xdcchain/developers/apothemrpc/#xdc-testnet-specifications","title":"XDC TestNet Specifications","text":""},{"location":"xdcchain/developers/devnetrpc/","title":"XDC Network - Devnet RPC","text":""},{"location":"xdcchain/developers/devnetrpc/#devnet-rpc","title":"Devnet RPC","text":"

The XDC Devnet is a specialized test environment for the XDC Network, designed to closely mirror the Mainnet\u2019s functionality. The Devnet provides developers with a safe, controlled setting to test, deploy, and refine their applications using test tokens instead of real assets. This environment is crucial for ensuring that applications are robust and secure before they go live on the Mainnet.

Public Networks Similar to the Mainnet, users can access the XDC Devnet via an internet connection and a full node RPC. The Devnet allows developers to perform the same operations they would on the Mainnet, including reading blockchain data, creating and validating transactions, and deploying smart contracts. However, since the Devnet operates with test tokens, developers can experiment freely without the financial risks associated with live transactions.

"},{"location":"xdcchain/developers/devnetrpc/#xdc-devnet-specifications","title":"XDC Devnet Specifications","text":""},{"location":"xdcchain/developers/mainnetrpc/","title":"XDC Network - Mainnet RPC","text":""},{"location":"xdcchain/developers/mainnetrpc/#xdc-mainnet-rpc","title":"XDC Mainnet RPC","text":"

The XDC Mainnet is the live, operational environment of the XDC Network, where real transactions occur. The Mainnet is designed to support high-performance applications with low transaction fees and quick finality, making it ideal for enterprise use cases. The primary URL for accessing the XDC Mainnet via RPC. This endpoint allows you to interact with the blockchain by sending requests for data, submitting transactions, and more.

Public Networks

Users with an internet connection and access to a full node RPC can easily access the XDC Network\u2019s public blockchain. They can read, create, or validate transactions executed on the blockchain. The network\u2019s consensus mechanism, XDPoS (XinFin Delegated Proof of Stake), ensures that all nodes agree on the state of the network.

"},{"location":"xdcchain/developers/mainnetrpc/#xdc-mainnet-specifications","title":"XDC MainNet Specifications","text":""},{"location":"xdcchain/developers/mainnetrpc/#apothem-testnet-rpc","title":"Apothem Testnet RPC","text":"

The Apothem Testnet is the test environment for the XDC Network. It mirrors the Mainnet\u2019s functionality but operates with test tokens instead of real assets, making it ideal for developers to test and deploy their applications before going live.

Public Networks Similar to the Mainnet, users can access the Apothem Testnet with an internet connection and full node RPC. They can perform all the same actions as on the Mainnet\u2014reading, creating, or validating transactions\u2014without the risks associated with live transactions.

"},{"location":"xdcchain/developers/mainnetrpc/#xdc-testnet-specifications","title":"XDC TestNet Specifications","text":""},{"location":"xdcchain/developers/mainnetrpc/#devnet-rpc","title":"Devnet RPC","text":"

The XDC Devnet is a specialized test environment for the XDC Network, designed to closely mirror the Mainnet\u2019s functionality. The Devnet provides developers with a safe, controlled setting to test, deploy, and refine their applications using test tokens instead of real assets. This environment is crucial for ensuring that applications are robust and secure before they go live on the Mainnet.

Public Networks Similar to the Mainnet, users can access the XDC Devnet via an internet connection and a full node RPC. The Devnet allows developers to perform the same operations they would on the Mainnet, including reading blockchain data, creating and validating transactions, and deploying smart contracts. However, since the Devnet operates with test tokens, developers can experiment freely without the financial risks associated with live transactions.

"},{"location":"xdcchain/developers/mainnetrpc/#xdc-testnet-specifications_1","title":"XDC TestNet Specifications","text":""},{"location":"xdcchain/developers/quick-guide/","title":"Quick Guide","text":"

Welcome to the Quick Guide for XDC Chain! This document is designed to provide you with a comprehensive overview of the XDC Network, its technology, and the tools you need to start your journey. Whether you\u2019re new to blockchain or an experienced developer, this guide will help you navigate the key resources and get up to speed with the XDC Network.

"},{"location":"xdcchain/developers/quick-guide/#getting-started","title":"Getting Started","text":"

The XDC Network is a powerful, enterprise-grade blockchain platform designed to facilitate secure, efficient, and scalable decentralized applications (DApps) and global trade solutions. If you\u2019re just starting your journey with the XDC Network, this section will help you understand the fundamental concepts, terminology, and processes.

"},{"location":"xdcchain/developers/quick-guide/#mainnet","title":"Mainnet","text":"

The XDC Network\u2019s Mainnet is the live, operational blockchain where actual transactions take place. Understanding the Mainnet is crucial for interacting with the XDC Network in a real-world environment.

"},{"location":"xdcchain/developers/quick-guide/#apothem-testnet","title":"Apothem Testnet","text":"

The Apothem Testnet is the testing environment for the XDC Network. It\u2019s an ideal place to experiment with your DApps, smart contracts, and other blockchain-based solutions before deploying them on the Mainnet.

"},{"location":"xdcchain/developers/quick-guide/#xdc-devnet","title":"XDC Devnet","text":"

The XDC Devnet is a development-focused environment that allows developers to test and deploy their projects in a controlled setting. It\u2019s perfect for experimenting with new features, running simulations, and fine-tuning DApps before launching them on the Mainnet or Testnet.

"},{"location":"xdcchain/developers/quick-guide/#useful-links","title":"Useful Links","text":"

Here are some additional tools and resources that will help you interact with the XDC Network more effectively:

"},{"location":"xdcchain/developers/quick-guide/#xdc-wallets","title":"XDC Wallets:","text":"

To start using XDC, you\u2019ll need a secure wallet\u2014a dedicated app for storing your XDC and interacting with other apps on the XDC Network. Ensuring the safety of your XDC is crucial, so choose from a variety of trusted wallets that offer high security and unique features. Here are some of the top options.

"},{"location":"xdcchain/developers/quick-guide/#additional-tools","title":"Additional Tools:","text":""},{"location":"xdcchain/developers/quick-guide/#community-and-support","title":"Community and Support","text":"

Join the vibrant community of developers, validators, and users who are actively contributing to the XDC Network\u2019s growth and innovation. Engage with the community, ask questions, and share your knowledge.

"},{"location":"xdcchain/developers/quick-guide/#final-note","title":"Final Note","text":"

It\u2019s unnecessary to review every document to have a working knowledge of the XDC Network. Explore the resources as needed, dive deeper into specific sections that interest you, and don\u2019t hesitate to seek support from the community whenever necessary.

Happy building on the XDC Network!

For more tools and details, you can refer to XDC Chain Network Tools and Documents.

"},{"location":"xdcchain/developers/rpc/","title":"XDC Network - RPC","text":""},{"location":"xdcchain/developers/rpc/#network-endpoints","title":"Network Endpoints","text":"

The XDC Network is a robust, enterprise-grade blockchain platform designed for decentralized finance (DeFi), global trade, and other high-demand applications. For developers and users interacting with the XDC Network, the Remote Procedure Call (RPC) interface is a critical component. This guide provides a detailed overview of the RPC endpoints for both the XDC Mainnet and the Apothem Testnet, including their specifications and usage.

"},{"location":"xdcchain/developers/rpc/#what-is-rpc","title":"What is RPC?","text":"

Remote Procedure Call (RPC) is a protocol that allows communication between a client and a server over a network. In the context of blockchain, RPC is used to interact with the blockchain network by sending requests to full nodes. These requests can include reading blockchain data, creating and broadcasting transactions, and deploying smart contracts.

"},{"location":"xdcchain/developers/rpc/#mainnet-environment","title":"Mainnet Environment","text":"Service URL RPC https://erpc.xinfin.network Chain Id 50 Faucet endpoint https://chains.tools/faucet Explorer https://xdcscan.io/"},{"location":"xdcchain/developers/rpc/#apothem-environment","title":"Apothem Environment","text":"Service URL RPC https://rpc.apothem.network Chain Id 51 Faucet endpoint https://faucet.blocksscan.io/ Explorer https://apothem.xdcscan.io/"},{"location":"xdcchain/developers/rpc/#devnet-environment","title":"Devnet Environment","text":"Service URL RPC https://devnetstats.hashlabs.apothem.network/devnet Chain Id 551 Faucet endpoint https://faucet.blocksscan.io/ Explorer https://devnet.xdcscan.io/"},{"location":"xdcchain/developers/wallet-configuration/","title":"Wallet Configuration - XDC Network","text":""},{"location":"xdcchain/developers/wallet-configuration/#wallet-configuration","title":"Wallet configuration","text":"

You can use any Ethereum wallet with XDC. For instance, I will show you how to set up Metamask and Trustwallet for XDC.

Testnet/Apothem

Mainnet

Depending on your location and preference, you can choose from a variety of RPC endpoints for XDC. For more information about the endpoints and their features, please refer to the network information document that we have prepared for you. To ensure the best performance and user experience, you can test the latency of each endpoint before you configure it with your wallet. Refer

"},{"location":"xdcchain/developers/node_operators/bootstrap/","title":"Run XDC Nodes using Bootstrap Script","text":""},{"location":"xdcchain/developers/node_operators/bootstrap/#setup-xdc-masternode-using-bootstrap-script","title":"Setup XDC Masternode using Bootstrap Script","text":""},{"location":"xdcchain/developers/node_operators/bootstrap/#for-mainnet","title":"For Mainnet","text":"

Bootstrap Command XinFin Node Setup:

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n

Examples: After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cmainnet\u201d.

$ sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n[sudo] password for user:\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- mainnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201cDemo_Server.\u201d
Your running network is mainnet\nPlease enter your XinFin MasterNode Name :- Demo_Server\nYour Masternode Name is Demo_Server\n
"},{"location":"xdcchain/developers/node_operators/bootstrap/#for-testnet","title":"For Testnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201ctestnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- testnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Your running network is testnet\nPlease enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\n
"},{"location":"xdcchain/developers/node_operators/bootstrap/#for-devnet","title":"For Devnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cdevnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- devnet\nYour running network is devnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Please enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\nGenerate new private key and wallet address.\nIf you have your own key, you can change after this and restart the node\nType 'Y' or 'y' to continue:\n
"},{"location":"xdcchain/developers/node_operators/docker/","title":"Setup XDC Masternode using Docker","text":""},{"location":"xdcchain/developers/node_operators/docker/#setup-xdc-masternode-using-docker","title":"Setup XDC Masternode using Docker","text":""},{"location":"xdcchain/developers/node_operators/docker/#setting-up-xdc-network-masternode-docker-version","title":"Setting up XDC Network Masternode Docker version","text":"

The server or VPS used for the masternode should be directly facing the internet with a public IP and without NAT.

Operating System: Ubuntu 20.04 64-bit or higher

Should be facing internet directly with public IP & without NAT

Tools: Docker, Docker Compose(1.27.4+)

Setup (For Ubuntu 20.04 64-bit or higher Operating System)

Follow the written steps starting from step 1, or you can watch the video tutorials:

"},{"location":"xdcchain/developers/node_operators/docker/#step-1-clone-repository","title":"Step 1: Clone repository","text":"
git clone https://github.com/XinFinOrg/XinFin-Node.git\n
"},{"location":"xdcchain/developers/node_operators/docker/#step-2-change-directory","title":"Step 2: Change directory","text":"

Then we change the directory to XinFin-Node

cd XinFin-Node\n
"},{"location":"xdcchain/developers/node_operators/docker/#step-3-install-docker","title":"Step 3: Install docker","text":"

We need to install Docker and Docker-Compose by running the following command:

sudo ./setup/install_docker.sh\n
"},{"location":"xdcchain/developers/node_operators/docker/#step-4","title":"Step 4:","text":"

Create a new .env file and copy the env.example file that exist in the mainnet directory. We will ensure we are in the \u201cmainnet\u201d directory by typing these commands. Once in edit mode for the .env file, name your masternode and use an email address in the respective fields

cd mainnet\ncp env.example .env\nnano .env \n
For Testnet
cd testnet\ncp env.example .env\nnano .env\n
"},{"location":"xdcchain/developers/node_operators/docker/#step-5-start-your-node","title":"Step 5: Start your Node","text":"

For Mainnet run the following commands:

cd mainnet\nsudo docker-compose -f docker-compose.yml up -d\n
At this point you should be able to see your masternode on the list of nodes here or as shown below:

For Testnet run the following commands:

cd testnet\nsudo docker-compose -f docker-compose.yml up -d\n
You should be able to see your node listed on the [Apothem Network] page. Select \u201cSwitch to LiveNet\u201d to check LiveNetwork Stats and Select \u201cSwitch to TestNet\u201d for TestNetwork.

Your coinbase address can be found in xdcchain/coinbase.txt file.

For troubleshooting purposes, you can stop the node by using the following command on either Mainnet or Testnet:

sudo docker-compose -f docker-compose.yml down\n

Downloading a Network Snapshot (Mainnet or Apothem)

The following steps are to expedite the syncing process of your node with the XDC Network. If you followed the steps above, your node will take 3-4 days to sync up with the network fully. You can reduce that time by downloading a network snapshot and bringing your node back up after the chain has been downloaded and unpacked.

"},{"location":"xdcchain/developers/node_operators/docker/#mainnet-snapshot","title":"Mainnet Snapshot","text":"

Bring down your node:

sudo docker-compose -f docker-compose.yml down\n
Remove the old xdchain file from the server
rm -rf xdcchain.tar\n
Download the snapshot
wget https://download.xinfin.network/xdcchain.tar\n
Unpack the xdcchain.tar file
tar -xvzf xdcchain.tar\n
The unpacking will take some time, and it will look like this:

The following command will move the xdcchain/XDC to xdcchain/XDC_backup

mv  xdcchain/XDC xdcchain/XDC_backup\nmv XDC xdcchain\n

Then we are going to remove the old \u201cnodekey\u201d file

rm -rf xdcchain/XDC/nodekey\n

The last step is to run the bash upgrade.sh command

bash upgrade.sh\n

This command will bring your node up and it will start syncing to the network. Once up and running, your node will be synced to the network in just a few minutes.

"},{"location":"xdcchain/developers/node_operators/docker/#apothem-snapshot","title":"Apothem Snapshot","text":"

Bring down your node:

sudo docker-compose -f docker-compose.yml down\n

Remove the old xdchain file from the server

rm -rf apothem.tar\n

Download the snapshot

wget https://download.apothem.network/apothem.tar\n

Unpack the apothem.tar file

tar -xvzf apothem.tar\n

Move the xdcchain-testnet

mv XDC xdcchain-testnet\n

Bring up the node

sudo docker-compose -f docker-compose.yml up -d\n
"},{"location":"xdcchain/developers/node_operators/dockerimg/","title":"Docker Image for the XDC Network","text":""},{"location":"xdcchain/developers/node_operators/dockerimg/#docker-image-for-the-xdc-network","title":"Docker Image for the XDC Network","text":""},{"location":"xdcchain/developers/node_operators/dockerimg/#what-is-a-docker-image","title":"What is a Docker Image?","text":"

A Docker image is a lightweight, stand-alone, executable package that includes everything needed to run an application, including code, runtime, libraries, and configurations. In the context of blockchain, Docker images simplify the deployment and management of nodes by enabling developers to encapsulate the entire blockchain environment into a single, replicable package.

"},{"location":"xdcchain/developers/node_operators/dockerimg/#purpose-of-the-xdc-networks-docker-image","title":"Purpose of the XDC Network\u2019s Docker Image","text":"

For the XDC Network, the Docker image provides a standardized and efficient way for developers to deploy, manage, and update their XDC nodes. The XDC Docker image streamlines the node deployment process, reducing configuration errors and minimizing setup time. It allows developers to run nodes in isolated containers, ensuring a consistent environment across different infrastructures.

"},{"location":"xdcchain/developers/node_operators/dockerimg/#key-features-of-the-xdc-docker-image-include","title":"Key features of the XDC Docker image include:","text":"
  1. Ease of Deployment: Developers can deploy XDC nodes with just a few simple commands, reducing the complexity of setup.
  2. Portability: Docker images are portable, meaning they can run consistently across various platforms, including local machines, cloud environments, and virtualized infrastructure.
  3. Version Control: The XDC Docker image includes versioning, allowing developers to choose specific versions for compatibility testing or deployment.
  4. Improved Security: Isolated environments reduce security risks as each container runs independently from the host system.
"},{"location":"xdcchain/developers/node_operators/masternode/","title":"Masternode","text":""},{"location":"xdcchain/developers/node_operators/masternode/#run-a-node","title":"Run a Node","text":"

Nodes are computers or servers that run an application software known as clients to perform essential tasks on a blockchain network. These tasks can include transactions, block creation, consensus, network security, and other operational tasks for the network. The tasks and functionalities a node execute depend on the type of node, with each node having different system requirements and deployment processes. This section will provide details and information on how to run and maintain nodes on the XDC Network.

"},{"location":"xdcchain/developers/node_operators/masternode/#masternodes","title":"Masternodes","text":"

The XDC Network runs on a globally distributed system of masternodes that participate in a Delegated Proof of Stake (DPoS) consensus mechanism. To enhance network integrity and security, Masternodes are required to complete a KYC process and stake 10,000,000 XDC. Masternodes can be identified as \u201cValidator\u201d or \u201cStandby\u201d Masternodes.

"},{"location":"xdcchain/developers/node_operators/masternode/#standby-masternodes","title":"Standby Masternodes","text":"

Standby Masternodes (or \u201cStandby Nodes\u201d) are identical in form and function to Validators but do not participate in validating transactions and block creation. These nodes are on standby to fill the role of Validators that drop from network participation.

To host an XDC Masternode/Standby node, there are specific prerequisites that you need to meet in terms of hardware, software, and staking requirements. Below is a detailed list:

"},{"location":"xdcchain/developers/node_operators/masternode/#hardware-requirements","title":"Hardware Requirements","text":"

To ensure smooth operation and optimal performance of the XDC Masternode, the following hardware specifications are recommended:

"},{"location":"xdcchain/developers/node_operators/masternode/#software-requirements","title":"Software Requirements","text":"

Ensure that you have the following software and dependencies installed on your server before proceeding with the XDC Masternode setup:

"},{"location":"xdcchain/developers/node_operators/masternode/#staking-requirements","title":"Staking Requirements","text":"

To host an XDC Masternode, a certain amount of XDC tokens must be staked. This ensures that the node operator has a vested interest in the security and performance of the network.

"},{"location":"xdcchain/developers/node_operators/masternode/#xdc-wallet-setup","title":"XDC Wallet Setup","text":"

You must set up an XDC wallet to manage your funds and staking:

"},{"location":"xdcchain/developers/node_operators/masternode/#setup-xdc-masternode-using-bootstrap-script","title":"Setup XDC Masternode using Bootstrap Script","text":""},{"location":"xdcchain/developers/node_operators/masternode/#for-mainnet","title":"For Mainnet","text":"

Bootstrap Command for XDC Masternode Setup:

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n

Examples: After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cmainnet\u201d.

$ sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n[sudo] password for user:\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- mainnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201cDemo_Server.\u201d
Your running network is mainnet\nPlease enter your XinFin MasterNode Name :- Demo_Server\nYour Masternode Name is Demo_Server\n
"},{"location":"xdcchain/developers/node_operators/masternode/#for-testnet","title":"For Testnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201ctestnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- testnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Your running network is testnet\nPlease enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\n
"},{"location":"xdcchain/developers/node_operators/masternode/#for-devnet","title":"For Devnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cdevnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- devnet\nYour running network is devnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Please enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\nGenerate new private key and wallet address.\nIf you have your own key, you can change after this and restart the node\nType 'Y' or 'y' to continue:\n
"},{"location":"xdcchain/developers/node_operators/masternode/#how-to-stake-xdc-on-a-masternodestandby-node","title":"How to Stake XDC on a Masternode/Standby node","text":""},{"location":"xdcchain/developers/node_operators/masternode/#prerequisites","title":"Prerequisites","text":"

To stake XDC and run a masternode, you will need the following:

Note: You do not need 10,000,000 XDC to run a node solely for RPC queries or accessing live data from the blockchain. This guide covers staking for masternode candidates.

"},{"location":"xdcchain/developers/node_operators/masternode/#step-by-step-process-to-stake-your-xdc-node","title":"Step-by-Step Process to Stake Your XDC Node","text":""},{"location":"xdcchain/developers/node_operators/masternode/#1-access-the-staking-platform","title":"1. Access the Staking Platform","text":""},{"location":"xdcchain/developers/node_operators/masternode/#2-log-in-to-your-wallet","title":"2. Log In to Your Wallet","text":""},{"location":"xdcchain/developers/node_operators/masternode/#3-become-a-masternode-candidate","title":"3. Become a Masternode Candidate","text":""},{"location":"xdcchain/developers/node_operators/masternode/#4-enter-your-coinbase-address","title":"4. Enter Your Coinbase Address","text":""},{"location":"xdcchain/developers/node_operators/masternode/#5-confirm-and-apply-for-staking","title":"5. Confirm and Apply for Staking","text":""},{"location":"xdcchain/developers/node_operators/masternode/#6-transaction-confirmation","title":"6. Transaction Confirmation","text":""},{"location":"xdcchain/developers/node_operators/masternode/#setup-xdc-masternodestandby-node-using-one-click-installer","title":"Setup XDC Masternode/Standby node using One-Click Installer","text":""},{"location":"xdcchain/developers/node_operators/masternode/#method-1-setup-xinfins-xdc-masternode-one-click-installer","title":"Method 1: Setup XinFin\u2019s XDC Masternode One-click Installer","text":"

To qualify for Masternode on XinFin Network, you need at least 10,000,000 XDC, for the long term.

Operating System:

"},{"location":"xdcchain/developers/node_operators/masternode/#step-1","title":"Step 1:","text":"

Download XDC One-Click Installer (to setup Masternode) for Windows, Linux, and Mac OS and Install on your local machine.

"},{"location":"xdcchain/developers/node_operators/masternode/#step-2","title":"Step 2:","text":"

Now Run the One Click Installer, Make sure you read the Terms properly then click on I Agree button.

Step 3: Create a wallet for Masternode

Step 4: Host your Masternode

"},{"location":"xdcchain/developers/node_operators/masternode/#setup-xdc-masternodestandby-node-using-docker","title":"Setup XDC Masternode/Standby node using Docker","text":""},{"location":"xdcchain/developers/node_operators/masternode/#setting-up-xdc-network-masternode-docker-version","title":"Setting up XDC Network Masternode Docker version","text":"

The server or VPS used for the masternode should be directly facing the internet with a public IP and without NAT.

Operating System: Ubuntu 20.04 64-bit or higher

Should be facing internet directly with public IP & without NAT

Tools: Docker, Docker Compose(1.27.4+)

Setup (For Ubuntu 20.04 64-bit or higher Operating System)

Follow the written steps starting from step 1, or you can watch the video tutorials:

"},{"location":"xdcchain/developers/node_operators/masternode/#step-1-clone-repository","title":"Step 1: Clone repository","text":"
git clone https://github.com/XinFinOrg/XinFin-Node.git\n
"},{"location":"xdcchain/developers/node_operators/masternode/#step-2-change-directory","title":"Step 2: Change directory","text":"

Then we change the directory to XinFin-Node

cd XinFin-Node\n
"},{"location":"xdcchain/developers/node_operators/masternode/#step-3-install-docker","title":"Step 3: Install docker","text":"

We need to install Docker and Docker-Compose by running the following command:

sudo ./setup/install_docker.sh\n
"},{"location":"xdcchain/developers/node_operators/masternode/#step-4","title":"Step 4:","text":"

Create a new .env file and copy the env.example file that exist in the mainnet directory. We will ensure we are in the \u201cmainnet\u201d directory by typing these commands. Once in edit mode for the .env file, name your masternode and use an email address in the respective fields

cd mainnet\ncp env.example .env\nnano .env \n
For Testnet
cd testnet\ncp env.example .env\nnano .env\n
"},{"location":"xdcchain/developers/node_operators/masternode/#step-5-start-your-node","title":"Step 5: Start your Node","text":"

For Mainnet run the following commands:

cd mainnet\nsudo docker-compose -f docker-compose.yml up -d\n
At this point you should be able to see your masternode on the list of nodes here or as shown below:

For Testnet run the following commands:

cd testnet\nsudo docker-compose -f docker-compose.yml up -d\n
You should be able to see your node listed on the [Apothem Network] page. Select \u201cSwitch to LiveNet\u201d to check LiveNetwork Stats and Select \u201cSwitch to TestNet\u201d for TestNetwork.

Your coinbase address can be found in xdcchain/coinbase.txt file.

For troubleshooting purposes, you can stop the node by using the following command on either Mainnet or Testnet:

sudo docker-compose -f docker-compose.yml down\n
"},{"location":"xdcchain/developers/node_operators/masternode/#downloading-a-network-snapshot-mainnet-or-apothem","title":"Downloading a Network Snapshot (Mainnet or Apothem)","text":"

The following steps are to expedite the syncing process of your node with the XDC Network. If you followed the steps above, your node will take 3-4 days to sync up with the network fully. You can reduce that time by downloading a network snapshot and bringing your node back up after the chain has been downloaded and unpacked.

"},{"location":"xdcchain/developers/node_operators/masternode/#mainnet-snapshot","title":"Mainnet Snapshot","text":"

Bring down your node:

sudo docker-compose -f docker-compose.yml down\n
Remove the old xdchain file from the server
rm -rf xdcchain.tar\n
Download the snapshot
wget https://download.xinfin.network/xdcchain.tar\n
Unpack the xdcchain.tar file
tar -xvzf xdcchain.tar\n
The unpacking will take some time, and it will look like this:

img

The following command will move the xdcchain/XDC to xdcchain/XDC_backup

mv  xdcchain/XDC xdcchain/XDC_backup\nmv XDC xdcchain\n

Then we are going to remove the old \u201cnodekey\u201d file

rm -rf xdcchain/XDC/nodekey\n

The last step is to run the bash upgrade.sh command

bash upgrade.sh\n

This command will bring your node up and it will start syncing to the network. Once up and running, your node will be synced to the network in just a few minutes.

"},{"location":"xdcchain/developers/node_operators/masternode/#apothem-snapshot","title":"Apothem Snapshot","text":"

Bring down your node:

sudo docker-compose -f docker-compose.yml down\n

Remove the old xdchain file from the server

rm -rf apothem.tar\n

Download the snapshot

wget https://download.apothem.network/apothem.tar\n

Unpack the apothem.tar file

tar -xvzf apothem.tar\n

Move the xdcchain-testnet

mv XDC xdcchain-testnet\n

Bring up the node

sudo docker-compose -f docker-compose.yml up -d\n
"},{"location":"xdcchain/developers/node_operators/node_architecture/","title":"XDC Node Architecture","text":""},{"location":"xdcchain/developers/node_operators/node_architecture/#xdc-node-architecture","title":"XDC Node Architecture","text":"

The XDC Network is a hybrid blockchain platform designed to support both public and private states, offering enterprises the ability to conduct secure, scalable, and fast transactions. At the core of this network is its node architecture, which plays a crucial role in maintaining the network\u2019s integrity, security, and efficiency. This document provides a comprehensive overview of the XDC Node Architecture, detailing the various components and their functions.

The XDC Network operates on a Delegated Proof of Stake (XDPoS) consensus mechanism, which ensures low energy consumption and high transaction throughput. The network is EVM-compatible, allowing it to support smart contracts and decentralized applications (dApps).

"},{"location":"xdcchain/developers/node_operators/node_architecture/#node-types-in-xdc-network","title":"Node Types in XDC Network","text":"

The XDC Network comprises several types of nodes, each serving a unique function within the ecosystem. These nodes are essential for network operations, including transaction validation, block creation, and consensus.

Masternodes (Validator Nodes):

"},{"location":"xdcchain/developers/node_operators/node_architecture/#full-nodes","title":"Full Nodes:","text":""},{"location":"xdcchain/developers/node_operators/node_architecture/#node-communication-and-network-topology","title":"Node Communication and Network Topology","text":"

The XDC Network employs a peer-to-peer (P2P) communication model where nodes interact directly with each other to share information and propagate transactions.

"},{"location":"xdcchain/developers/node_operators/one-click-installer/","title":"Run XDC Nodes using One-Click Installer","text":""},{"location":"xdcchain/developers/node_operators/one-click-installer/#setup-xdc-masternode-using-one-click-installer","title":"Setup XDC Masternode using One-Click Installer","text":""},{"location":"xdcchain/developers/node_operators/one-click-installer/#method-1-setup-xinfins-xdc-masternode-one-click-installer","title":"Method 1: Setup XinFin\u2019s XDC Masternode One-click Installer","text":"

To qualify for Masternode on XinFin Network, you need at least 10,000,000 XDC, for the long term.

Operating System:

"},{"location":"xdcchain/developers/node_operators/one-click-installer/#step-1","title":"Step 1:","text":"

Download XDC One-Click Installer (to setup Masternode) for Windows, Linux, and Mac OS and Install on your local machine.

"},{"location":"xdcchain/developers/node_operators/one-click-installer/#step-2","title":"Step 2:","text":"

Now Run the One Click Installer, Make sure you read the Terms properly then click on I Agree button.

Step 3: Create a wallet for Masternode

Step 4: Host your Masternode

"},{"location":"xdcchain/developers/node_operators/slashing/","title":"XDC Network - Slashing Mechanism","text":""},{"location":"xdcchain/developers/node_operators/slashing/#xdc-network-slashing-mechanism","title":"XDC Network - Slashing Mechanism","text":"

The XDC Network, utilizing the XDPoS (Delegated Proof of Stake) consensus mechanism, ensures that its validators, known as masternodes, maintain optimal performance to keep the network stable and secure. One of the key features designed to ensure this reliability is the slashing mechanism, which acts as a corrective measure for underperforming masternodes.

"},{"location":"xdcchain/developers/node_operators/slashing/#objective-of-the-slashing-mechanism","title":"Objective of the Slashing Mechanism","text":"

The primary goal of the slashing mechanism is not to penalize or blame masternodes but to maintain a stable and high-performing network. It serves to mitigate issues arising from underperforming masternodes by holding them accountable while ensuring the overall system remains efficient.

"},{"location":"xdcchain/developers/node_operators/slashing/#how-the-xdc-network-slashing-mechanism-works","title":"How the XDC Network Slashing Mechanism Works","text":"

The slashing mechanism operates with a clear set of rules to manage masternode performance:

"},{"location":"xdcchain/developers/node_operators/slashing/#1-non-participation-in-block-signing","title":"1. Non-Participation in Block Signing:","text":""},{"location":"xdcchain/developers/node_operators/slashing/#2-handling-multiple-underperforming-masternodes","title":"2. Handling Multiple Underperforming Masternodes:","text":""},{"location":"xdcchain/developers/node_operators/slashing/#3-role-after-being-slashed","title":"3. Role After Being Slashed:","text":""},{"location":"xdcchain/developers/node_operators/slashing/#properties-of-the-xdc-network-slashing-mechanism","title":"Properties of the XDC Network Slashing Mechanism**","text":""},{"location":"xdcchain/developers/node_operators/slashing/#1-accountability","title":"1. Accountability:","text":""},{"location":"xdcchain/developers/node_operators/slashing/#2-liveness","title":"2. Liveness:","text":""},{"location":"xdcchain/developers/node_operators/slashing/#comparison-to-other-slashing-mechanisms","title":"Comparison to Other Slashing Mechanisms","text":"

The concept of slashing is not unique to the XDC Network and has been implemented in various other blockchain networks, such as Ethereum\u2019s Casper FFG (Friendly Finality Gadget). Casper\u2019s slashing mechanism is designed to prevent the \u201cnothing-at-stake\u201d problem, where validators can choose to support multiple forks of the blockchain. In Casper, if a validator is found to have validated conflicting forks, they are severely penalized by losing a significant portion, or even all, of their staked tokens.

Unlike Casper\u2019s more punitive approach aimed at preventing malicious behavior, the XDC Network\u2019s slashing mechanism is designed to handle unintentional underperformance. Rather than harshly punishing validators for outages or system failures, XDC\u2019s system focuses on ensuring network performance without creating fear of excessive penalties. The design philosophy behind XDC\u2019s slashing mechanism is to avoid deterring participation by maintaining a fair yet firm system.

"},{"location":"xdcchain/developers/node_operators/slashing/#benefits-of-the-xdc-slashing-mechanism","title":"Benefits of the XDC Slashing Mechanism","text":""},{"location":"xdcchain/developers/node_operators/validator_node/","title":"Validator/Standby Node","text":""},{"location":"xdcchain/developers/node_operators/validator_node/#validator-masternode","title":"Validator Masternode","text":"

Validator Masternodes operate and participate in XDC Network\u2019s DPoS consensus engine, validating transactions and block creation.

"},{"location":"xdcchain/developers/node_operators/validator_node/#standby-masternodes","title":"Standby Masternodes","text":"

Standby Masternodes (or \u201cStandby Nodes\u201d) are identical in form and function to Validators but do not participate in validating transactions and block creation. These nodes are on standby to fill the role of Validators that drop from network participation.

"},{"location":"xdcchain/developers/node_operators/validator_node/#setup-xdc-validatorstandby-node-using-bootstrap-script","title":"Setup XDC Validator/Standby Node using Bootstrap Script","text":""},{"location":"xdcchain/developers/node_operators/validator_node/#for-mainnet","title":"For Mainnet","text":"

Bootstrap Command XDC Validator/Standby Node Setup:

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n

Examples: After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cmainnet\u201d.

$ sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n[sudo] password for user:\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- mainnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201cDemo_Server.\u201d
Your running network is mainnet\nPlease enter your XinFin MasterNode Name :- Demo_Server\nYour Masternode Name is Demo_Server\n
"},{"location":"xdcchain/developers/node_operators/validator_node/#for-testnet","title":"For Testnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201ctestnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- testnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Your running network is testnet\nPlease enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\n
"},{"location":"xdcchain/developers/node_operators/validator_node/#for-devnet","title":"For Devnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cdevnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- devnet\nYour running network is devnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Please enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\nGenerate new private key and wallet address.\nIf you have your own key, you can change after this and restart the node\nType 'Y' or 'y' to continue:\n
"},{"location":"xdcchain/developers/node_operators/validator_node/#setup-xdc-masternode-using-one-click-installer","title":"Setup XDC Masternode using One-Click Installer","text":"

To Setup XDC Masternode using One-Click Installer, refer

"},{"location":"xdcchain/governance/overview/","title":"Overview - XDCDAO","text":""},{"location":"xdcchain/governance/overview/#xdc-governance-overview","title":"XDC Governance Overview","text":"

The DAO Treasury within the XDCDAO framework plays a critical role in the XDC Network\u2019s decentralized governance system. It is meticulously designed to manage the community\u2019s collective resources efficiently, securely, and transparently. This section provides a structured overview of the DAO Treasury, highlighting its purpose, operation, funding sources, and significance within the DAOFIN ecosystem.

"},{"location":"xdcchain/governance/overview/#purpose-of-the-dao-treasury","title":"Purpose of the DAO Treasury","text":"

The DAO Treasury\u2019s primary objective is to support the sustainable growth and development of the XDC Network by financing projects and initiatives that align with the community\u2019s goals. It acts as the financial hub for:

"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"XDC Network Docs","text":""},{"location":"#xdc-network-revolutionizing-the-future-of-decentralized-finance-and-global-trade","title":"XDC Network: Revolutionizing the Future of Decentralized Finance and Global Trade","text":"

XDC Network is a pioneering blockchain platform tailored to meet the evolving needs of decentralized finance (DeFi) and global trade. With its unparalleled speed, scalability, and cost-efficiency, XDC Network has become the go-to choice for developers creating decentralized applications (DApps) and for users looking to engage in the next generation of financial and trade ecosystems.

"},{"location":"#key-features-and-benefits-of-xdc-network","title":"Key Features and Benefits of XDC Network","text":""},{"location":"#chains","title":"Chains","text":"

The XDC protocol serves as a messaging and confirmation layer for global payments. Also, the XDC protocol supports smart contracts and Internet of Things (IoT) integrations. As a highly scalable enterprise-grade hybrid blockchain, the XDC protocol boasts a high throughput of 2,000 transactions per second (TPS) and near-instant transaction finality.

XDC Chain

XDC Network is a pioneering blockchain platform tailored to meet the evolving needs of decentralized finance (DeFi) and global trade. With its unparalleled speed, scalability, and cost-efficiency, XDC Network has become the go-to choice for developers creating decentralized applications (DApps) and for users looking to engage in the next generation of financial and trade ecosystems.

"},{"location":"#use-cases","title":"Use Cases","text":""},{"location":"#quick-start","title":"Quick Start","text":"XDC Chain

Get started with XDC Network: Unlock the power of decentralized finance and global trade.

Announcements

Stay updated with the latest XDC Network announcements and developments.

XDC Network: RPC Endpoints

Obtain the RPC Endpoint for XDC Network

XDC Network: Set up Node

XDC Network Masternodes are the backbone of the network, ensuring lightning-fast transaction validation and enhanced security.

Developer Tools

The XDC Chain Network provides a variety of tools and resources to help developers build and deploy applications on the blockchain.

XDC Subnet

XDC Subnet is a technology that allows you to create a secure, scalable, and decentralized network within the XDC Ecosystem.

"},{"location":"announce/","title":"Announcements","text":""},{"location":"announce/#announcement","title":"Announcement","text":"XDC 2.0 Mainnet Release XDC 2.0 Mainnet Release: Key Features and Enhancements October 2, 2024 XinFin Remix Upgrade XinFin Remix is getting a major upgrade and will be launching soon. Coming Soon! Solidity 0.8.23 Integration on XDC Mainnet This EVM upgrade supports the latest version of the Solidity smart contract programming language, version 0.8.23. 2024 June"},{"location":"join-ecosystem/","title":"Index","text":"Join XDC Ecosystem XDC token lies at the heart of XDC Network, and its transformative capabilities are truly awe-inspiring. As a versatile settlement mechanism, XDC fuels the entire ecosystem, enabling lightning-fast and cost-effective transactions while revolutionizing the way DApps function. All dApps

Discover top dApps built on XDC Network Chain, the leading blockchain scaling solution.

RWA

RWA on XDC Network!

DeFi

DeFi on XDC Network!

"},{"location":"join-ecosystem/platforms/dapp/","title":"dApps Built On XDC Network!","text":""},{"location":"join-ecosystem/platforms/defi/","title":"DeFi Built On XDC Network!","text":""},{"location":"join-ecosystem/platforms/rwa/","title":"RWA Built On XDC Network!","text":""},{"location":"showcase/","title":"Showcase","text":""},{"location":"showcase/#smart-contract-introduction","title":"Smart Contract Introduction","text":"

Blockchain technology is a digital ledger that continuously expands by adding records, known as blocks, which are securely connected through cryptography. Each block includes a cryptographic hash of the preceding block, a timestamp, and transaction data. The structure of blockchain ensures that once data is recorded, it is nearly impossible to alter, providing a high level of security. One of the key advantages of blockchain is its decentralized nature, eliminating the need for middlemen, which reduces both time and potential conflicts. Despite its challenges, blockchain technology is recognized for being faster, more economical, and more secure compared to traditional systems, which is why it\u2019s being increasingly adopted by banks and governments.

Now, imagine a contract that automatically executes when certain conditions are met, with the entire process managed by the blockchain network. This is the concept behind smart contracts.

"},{"location":"showcase/#what-are-smart-contracts","title":"What Are Smart Contracts?","text":"

A smart contract is a self-executing program that runs on a blockchain, containing a set of rules agreed upon by the involved parties. Once these predefined rules are satisfied, the contract automatically enforces the terms. Smart contracts facilitate, verify, and enforce the execution of an agreement or transaction without needing an intermediary, representing the simplest form of decentralized automation.

Put simply, a smart contract allows for the exchange of assets\u2014whether money, property, or anything else\u2014without the involvement of a middleman. This leads to trustless execution, where the contract enforces the terms without relying on any party\u2019s honesty or reliability.

Bitcoin was the first blockchain to introduce basic smart contracts, where transactions are only validated if specific conditions are met. Below is an example of a basic smart contract that includes functions to set and retrieve data, with simple operations to modify the data.

"},{"location":"showcase/#overview","title":"Overview","text":""},{"location":"showcase/#key-features-of-smart-contracts","title":"Key Features of Smart Contracts","text":"
  1. Trustworthiness: Smart contracts ensure that your agreements are securely stored on a blockchain, making it impossible for any party to lose or alter the contract. The terms are binding, and both parties must adhere to them.

  2. Transparency: Every detail of the smart contract is visible to all participants before they agree, eliminating the possibility of disputes. The information is open to everyone involved, ensuring clarity and preventing misunderstandings.

  3. Self-Governance: Smart contracts eliminate the need for intermediaries, such as brokers or lawyers, to validate the agreement. This also removes the risk of third-party manipulation, as the contract is automatically executed by the blockchain network.

  4. Precision: Automated contracts not only speed up the process but also reduce costs and eliminate human error. The conditions are clearly defined in the smart contract, ensuring that no detail is overlooked.

  5. Efficiency: Smart contracts automate tasks, saving considerable time that would otherwise be spent manually reviewing and processing agreements.

  6. Cost-Effectiveness: By removing the need for intermediaries, smart contracts can significantly reduce costs. For instance, you don\u2019t need to hire a lawyer to enforce the contract; the code itself ensures compliance.

  7. Security: The data in smart contracts is encrypted and protected by blockchain technology, making it highly secure and reliable for critical processes.

"},{"location":"showcase/#addressing-challenges","title":"Addressing Challenges","text":""},{"location":"showcase/#applications-of-smart-contracts","title":"Applications of Smart Contracts","text":"
  1. Digital Identity Management: Smart contracts allow individuals to maintain control over their digital identities, managing their data, reputation, and assets securely. Businesses can use this technology to streamline the know-your-customer (KYC) process.

  2. Financial Data Integrity: Financial institutions can leverage smart contracts for accurate and transparent data recording, improving financial reporting and reducing auditing expenses. This also enhances market stability by ensuring uniform financial data across organizations.

  3. Healthcare Management: Smart contracts can store personal health records securely on a blockchain, accessible only by authorized personnel. They can also be used to manage various healthcare operations, including drug tracking, compliance with regulations, and managing medical supplies.

  4. Real Estate Transactions: Smart contracts simplify real estate transactions by cutting out intermediaries. For example, rental agreements can be directly managed on the blockchain, reducing costs and making the process more efficient.

"},{"location":"showcase/#conclusion","title":"Conclusion","text":"

Smart contracts offer immense potential and have already shown signs of transforming various industries. However, they are still in the early stages, and much remains to be explored. As organizations become more familiar with blockchain technology and its applications, smart contracts could become easier to implement and more widely trusted. In the future, we might see a blend of traditional and digital contracts, where blockchain technology verifies the terms while physical copies provide additional validation.

"},{"location":"showcase/data-analytics/","title":"Showcase","text":""},{"location":"showcase/data-analytics/#data-and-analytics","title":"Data and Analytics","text":""},{"location":"showcase/data-analytics/#overview","title":"Overview:","text":"

The XDC Network\u2019s data and analytics tools are critical for understanding the dynamics of the blockchain. These tools provide detailed insights into how tokens are used, the behavior of smart contracts, and overall network activity. By leveraging these analytics, stakeholders can make informed decisions and optimize their interactions with the network.

"},{"location":"showcase/data-analytics/#key-features","title":"Key Features:","text":""},{"location":"showcase/data-analytics/#use-cases","title":"Use Cases:","text":""},{"location":"showcase/data-analytics/#xdcscan-mainnet","title":"XDCScan - Mainnet","text":""},{"location":"showcase/data-analytics/#overview_1","title":"Overview:","text":"

XDCScan is the official block explorer for the XDC Network, providing a user-friendly interface to explore and interact with the blockchain. It allows users to search for transactions, view block details, and explore smart contracts deployed on the network. XDCScan is a vital tool for anyone interacting with the XDC Network, from developers to casual users.

"},{"location":"showcase/data-analytics/#key-features_1","title":"Key Features:","text":""},{"location":"showcase/data-analytics/#use-cases_1","title":"Use Cases:","text":""},{"location":"showcase/data-analytics/#xdcscan-testnet-apothem","title":"XDCScan Testnet (Apothem)","text":""},{"location":"showcase/data-analytics/#overview_2","title":"Overview:","text":"

The Apothem XDCScan is the XDC Network\u2019s official test environment. XDCScan Testnet (Apothem) is the block explorer for this testnet, offering all the features of XDCScan but in a testnet context. It is ideal for developers who want to simulate the mainnet environment as closely as possible before deploying their projects.

"},{"location":"showcase/data-analytics/#key-features_2","title":"Key Features:","text":""},{"location":"showcase/data-analytics/#use-cases_2","title":"Use Cases:","text":""},{"location":"showcase/data-analytics/#xdcscan-devnet","title":"XDCScan Devnet","text":""},{"location":"showcase/data-analytics/#overview_3","title":"Overview:","text":"

XDCScan Devnet is a specialized version of XDCScan tailored for the XDC Network\u2019s development environment. It provides a safe and controlled environment for developers to test and debug their smart contracts before deploying them to the mainnet.

"},{"location":"showcase/data-analytics/#key-features_3","title":"Key Features:","text":""},{"location":"showcase/data-analytics/#use-cases_3","title":"Use Cases:","text":""},{"location":"showcase/flattening-smart-contracts/","title":"Showcase","text":""},{"location":"showcase/flattening-smart-contracts/#flattening-smart-contracts-on-the-xdc-network","title":"Flattening Smart Contracts on the XDC Network","text":"

When a smart contract imports a contract that it depends on from another source, that top level smart contract and it\u2019s dependencies will have to be flattened before it can be verified on a block explorer. This section explains how to flatten smart contracts using three different development toolchains; Remix, Truffle, and Hardhat.

For a good overview of flattening smart contracts on the XDC Network please refer to this article.

"},{"location":"showcase/flattening-smart-contracts/#flattening-smart-contracts-with-remix","title":"Flattening Smart Contracts with Remix","text":"

Remix IDE is one of the most user-friendly tools for smart contract development. To flatten a smart contract in Remix:

Refer to know in detail: https://www.xdc.dev/ivan_blocksscan/learn-how-to-flatten-a-smart-contract-and-verify-on-blocksscan-56on

"},{"location":"showcase/flattening-smart-contracts/#flattening-smart-contracts-with-truffle","title":"Flattening Smart Contracts with Truffle","text":"

Truffle is another powerful tool for smart contract development that supports the XDC Network. The process involves:

Refer to know in detail:

"},{"location":"showcase/flattening-smart-contracts/#flattening-smart-contracts-with-hardhat","title":"Flattening Smart Contracts with Hardhat","text":"

Hardhat offers advanced tooling for smart contract developers and supports the XDC Network natively. The flattening process using Hardhat involves:

Refer to know in detail: https://www.xdc.dev/jay_kulkarni_842b41d81b23/deploying-and-verifying-a-pepe-token-on-the-xdc-network-using-hardhat-3nc7

"},{"location":"showcase/tokens/","title":"Showcase","text":""},{"location":"showcase/tokens/#tokens-built-on-xdc","title":"Tokens Built On XDC","text":"

The XDC Network is a powerful blockchain platform designed to support various digital assets and decentralized applications. One of its key features is the ability to create and manage tokens, which can represent anything from currency to assets, data, or even unique digital items. On the XDC Network, tokens are classified into different standards based on their functionality and use cases. Here\u2019s an overview of the major token standards:

"},{"location":"showcase/tokens/#xrc20","title":"XRC20","text":""},{"location":"showcase/tokens/#overview","title":"Overview:","text":"

XRC20 is the most widely used token standard on the XDC Network, similar to the ERC20 standard on Ethereum. XRC20 tokens are fungible, meaning each token is identical in type and value to another token within the same contract. These tokens are primarily used for cryptocurrencies, utility tokens, and other financial instruments.

"},{"location":"showcase/tokens/#key-features","title":"Key Features:","text":""},{"location":"showcase/tokens/#use-cases","title":"Use Cases:","text":""},{"location":"showcase/tokens/#xrc721","title":"XRC721","text":""},{"location":"showcase/tokens/#overview_1","title":"Overview:","text":"

The XRC721 standard allows for the creation of non-fungible tokens (NFTs) on the XDC Network. Unlike XRC20 tokens, XRC721 tokens are unique and cannot be exchanged on a one-to-one basis. Each XRC721 token has a distinct value and set of characteristics, making them ideal for representing ownership of unique items or digital collectibles.

"},{"location":"showcase/tokens/#key-features_1","title":"Key Features:","text":""},{"location":"showcase/tokens/#use-cases_1","title":"Use Cases:","text":""},{"location":"showcase/tokens/#xrc404","title":"XRC404","text":""},{"location":"showcase/tokens/#overview_2","title":"Overview:","text":"

XRC404 is a specialized token standard designed for hybrid tokens on the XDC Network. These tokens combine features of both fungible and non-fungible tokens, offering a new level of flexibility for developers and businesses.

"},{"location":"showcase/tokens/#key-features_2","title":"Key Features:","text":""},{"location":"showcase/tokens/#use-cases_2","title":"Use Cases:","text":""},{"location":"showcase/xdcstats/","title":"Showcase","text":""},{"location":"showcase/xdcstats/#xdc-stats","title":"XDC Stats","text":""},{"location":"showcase/xdcstats/#overview","title":"Overview:","text":"

XDC Stats is a comprehensive analytics platform designed for the XDC Network. It provides real-time data and insights into various aspects of the blockchain, including token transactions, smart contract activity, and network performance. XDC Stats is essential for developers, investors, and users who need to monitor the network\u2019s health and activity levels.

Mainnet Stats | XinFin Network Stats

"},{"location":"showcase/xdcstats/#key-features","title":"Key Features:","text":""},{"location":"showcase/xdcstats/#use-cases","title":"Use Cases:","text":""},{"location":"showcase/wallet/xdc-wallet/","title":"Showcase - XDC Web Wallet","text":"

XDC Web wallet: https://betawallet.xinfin.network/

"},{"location":"subnet/","title":"XDC Subnet","text":""},{"location":"subnet/#xdc-subnet","title":"XDC Subnet","text":"

XDC Subnet is a technology that allows you to create a secure, scalable, and decentralized network within the XDC Ecosystem. It enables various use cases, including creating private subnets, deploying decentralized applications (dApps), and more. Are you ready to embark on a journey into the world of secure, scalable, and decentralized networks? Look no further than XDC Subnet, the cutting-edge technology that empowers you to create a digital realm tailored to your needs within the thriving XDC Ecosystem.

"},{"location":"subnet/#motivation-design-rationale","title":"Motivation & Design Rationale","text":"

As a leading Layer-1 (L1) public blockchain, XinFin\u2019s XDC network has attrated many enterprise and institutional customers. Besides the high performance and high security that XDC already offers, these customers also demand privacy, meaning that their transactions and ledger should not be disclosed to the public. This requirement prohibits them from directly submitting transactions to XDC. Instead, they should only checkpoint snapshots of their ledger to XDC in order to extract XDC\u2019s security.

From a system perspective, \u201csecurity via checkpointing\u201d is achieved via Layer-2 (L2) techniques, such as rollups and subnets. The most popular rollup technique, namely optimistic rollup, is not suitable for our use case. This is because while transaction execution is offloaded to L2, all these L2 transactions are still submitted to L1 as a record. Another popular rollup called zero-knowledge (ZK) rollup solves this problem. But ZK computation is slow, and the type of use cases it can currently support is very limited (such as token transfers), which cannot fulfill the diverse business needs of XDC\u2019s enterprise and institutional customers.

On the other hand, subnet is a perfect solution. By subnet, the customer runs a blockchain and checkpoints its critical consensus data to the parent chain. This way, not only is privacy preserved, the subnet can have its own security and resiliency besides those provided by the parent chain. This is particularly useful to enterprise and institutional customers who may collaborate with untrusted partners. A common criticism against subnet solutions is the high entry bar and operational cost of running a blockchain. However, in XDC\u2019s case, this is indeed welcomed becomes enterprise and institutional customers prefer owning the infrastructure in a private and isolated domain.

Motivated by this opportunity, XDC\u2019s core protocol team has tailor-designed a subnet solution for XDC\u2019s enterprise and institutional customers. It has the following main features: 1. the subnet will be a sovereign, permissioned, and high-performing blockchain wholly owned by the customer. 2. the subnet will be driven by XDC2.0, the most advanced and secure consensus engine originally-built for XDC in-house, and will be deployed to the XDC mainnet, too. 3. a security level equivalent to the sum security of the subnet AND XDC mainnet. 4. native EVM smart contract support. 5. total privacy (i.e., no visibility) of the subset transactions on the XDC mainnet. 6. full access and compatibility to XDC\u2019s abundant SDK and tools, such as the explorer and forensic monitoring system.

"},{"location":"subnet/#architecture","title":"Architecture","text":"

The architecture consists of the following key components owned by the customer:

"},{"location":"subnet/Installation_guide/","title":"Installation Guide","text":"

In the rapidly evolving landscape of blockchain technology, staying ahead of the curve is essential. One of the most intriguing advancements in the world of blockchain is the concept of blockchain subnets. In this comprehensive guide, we will dive deep into what blockchain subnets are, how they work, and why they are becoming a game-changer in the blockchain industry.

What Are Blockchain Subnets? Blockchain subnets are like specialized branches of a blockchain network. They allow you to create smaller, independent networks within a larger blockchain ecosystem. Think of them as self-contained mini-blockchains, each with its own unique features and functionalities. These subnets operate alongside the main blockchain but offer more flexibility and scalability.

How Do Blockchain Subnets Work? Blockchain subnets work by segregating the main blockchain into smaller, more manageable parts. This segmentation brings several advantages such as Scalability, Customization, Privacy and Security.

Setting Up Your Own Blockchain Subnet XDC Subnet is a powerful technology that allows you to create a secure, scalable, and decentralized network within the XDC Ecosystem. It enables various use cases, including creating private subnets, deploying decentralized applications (DApps), and more. In this guide, we\u2019ll walk you through the steps to set up your own XDC Subnet, opening doors to a world of possibilities.

Step 1: Uninstall Old Versions

Before you dive into setting up XDC Subnet, ensure that you don\u2019t have any conflicting packages from previous installations. Run the following command to uninstall them:

for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done\n

Enter fullscreen mode Exit fullscreen mode

Step 2: Set Up the Docker Repository

To install Docker Engine, you need to set up the Docker repository. Follow these steps:

  1. Update the apt package index and install required packages:

    $ sudo apt-get update $ sudo apt-get install ca-certificates curl gnupg

Enter fullscreen mode Exit fullscreen mode

  1. Add Docker\u2019s official GPG key:

    $ sudo install -m 0755 -d /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg - dearmor -o /etc/apt/keyrings/docker.gpg $ sudo chmod a+r /etc/apt/keyrings/docker.gpg

Enter fullscreen mode Exit fullscreen mode

  1. Use the following command to set up the repository:

    $ echo \\ \u201cdeb [arch=\u201d\\((dpkg - print-architecture)\" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \\ \"\\)(. /etc/os-release && echo \u201c$VERSION_CODENAME\u201d)\u201d stable\u201d | \\ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Enter fullscreen mode Exit fullscreen mode

  1. Update the apt package index again:

    $ sudo apt-get update

Enter fullscreen mode Exit fullscreen mode

Step 3: Install Docker Engine

  1. Now, you can install Docker Engine, containerd, and Docker Compose by running the following command:

    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Enter fullscreen mode Exit fullscreen mode

  1. Verify the installation by running:

    $ sudo docker run hello-world

Enter fullscreen mode Exit fullscreen mode

  1. Update the apt package index & Test the installation.

    $ sudo apt-get update $ docker compose version

Enter fullscreen mode Exit fullscreen mode

Your Docker installation will be successfully completed using these steps!

"},{"location":"subnet/Installation_guide/#with-docker-set-up-lets-move-on-to-setting-up-xdc-subnet","title":"With Docker set up, let\u2019s move on to setting up XDC Subnet.","text":"

Step 4: Clone the Subnet Repository

Clone the Subnet repository and change the directory:

git clone https://github.com/XinFinOrg/XinFin-Node.git\ncd XinFin-Node/subnet/deployment-generator/\n

Enter fullscreen mode Exit fullscreen mode

Step 5: Create a Docker Environment File

Create a docker.env file with parameters similar to docker.env.example, & make necessary configurations by entering below command.

cp docker.env.example docker.env\n

Enter fullscreen mode Exit fullscreen mode

Below is an example of the minimum file required for configs generation, Update the below parameters with your data in the docker.env file. Refer to check out in detail Config Explanation.

Enter fullscreen mode Exit fullscreen mode

docekr.env file:

#deployment config\nCONFIG_PATH= /XinFin-Node/subnet/deployment-generator\n#subnet config\nNETWORK_NAME=testsubnet\nNUM_SUBNET=1\nNUM_MACHINE=3\nMAIN_IP=192.168.1.1\n#parentchain config\nPARENTCHAIN=devnet\nPARENTCHAIN_WALLET=0x0000000000000000000000000000000000000000\nPARENTCHAIN_WALLET_PK=0x0000000000000000000000000000000000000000000000000000000000000000\n

Enter fullscreen mode Exit fullscreen mode

Step 6: Pull the Latest Subnet Generator Image

Pull the latest Subnet Generator image with this command:

sudo docker pull xinfinorg/subnet-generator:latest\n

Enter fullscreen mode Exit fullscreen mode

Step 7: Generate Configurations

Generate configurations, this will create a new generated directory.

docker run --env-file docker.env -v $(pwd)/generated:/app/generated xinfinorg/subnet-generator:latest && cd generated\n

Enter fullscreen mode Exit fullscreen mode

Follow the generated instructions in commands.txt to start Subnet Nodes and make sure they are mining.

Deploy subnet on machine1:

docker compose - env-file docker-compose.env - profile machine1 pull\ndocker compose - env-file docker-compose.env - profile machine1 up -d\n

Enter fullscreen mode Exit fullscreen mode

Step 8: Deploy the Checkpoint Smart Contract

Again, follow the generated instructions in commands.txt to deploy the Checkpoint Smart Contract to the \u201cdeployment-generator\u201d folder.

Run \u201ccd..\u201d command to get back to the \u201cdeployment-generator\u201d folder.

cd ~/.XinFin-Node/subnet/deployment-generator\ndocker run --env-file docker.env \\\n    -v $(pwd)/generated/deployment.json:/app/generated/deployment.json \\\n    --entrypoint 'bash' xinfinorg/subnet-generator:latest ./deploy_csc.sh\n

Enter fullscreen mode Exit fullscreen mode

Execute the following command to deploy the Checkpoint Smart Contract:

This will provide you with the Checkpoint Smart Contract address (checkpoint deployed to:)

Step 9: Deploy Subnet Services

Follow the instructions in commands.txt to deploy Subnet Services (relayer, stats-server, frontend) to the \u201cdeployment-generator/generated\u201d folder:

cd ~/.XinFin-Node/subnet/deployment-generator/generated\ndocker compose --env-file docker-compose.env --profile services pull\ndocker compose --env-file docker-compose.env --profile services up -d\n

Enter fullscreen mode Exit fullscreen mode

Step 10: Check the Status

docker ps -a\n

Enter fullscreen mode Exit fullscreen mode

Step 11: Explore the Subnet UI

Finally, explore the Subnet UI by accessing it at :5000.

Congratulations! You\u2019ve successfully set up your XDC Subnet, enabling you to harness the full potential of XDC Network\u2019s blockchain technology.

Checkout the guide for XDC Subnet user interface.

"},{"location":"subnet/Installation_guide/#some-common-issues-and-solutions","title":"Some Common Issues and Solutions:","text":"

Issue 1: Finding the System\u2019s IP Address

Question: If I do not have the private IP, where can I find the IP address of my system?

Answer: To determine your system\u2019s IP address, use the following command:

ip a\n

Enter fullscreen mode Exit fullscreen mode

Issue 2: Locating the Checkpoint Smart Contract Address

Question: Where can I find the checkpoint smart contract address?

Answer: After executing the command below, you will obtain the \u201ccheckpoint smart contract address.\u201d Please consult the \u201ccommand.txt\u201d file for the necessary commands.

cd ~/.XinFin-Node/subnet/deployment-generator\ndocker run - env-file docker.env \\\n-v $(pwd)/generated/deployment.json:/app/generated/deployment.json \\\n - entrypoint 'bash' xinfinorg/subnet-generator:latest ./deploy_csc.sh\n

Enter fullscreen mode Exit fullscreen mode

Issue 3: Resolving \u201cNo Such File or Directory\u201d Errors

Question: What should I do if I encounter the \u201cno such file or directory\u201d error repeatedly?

Answer: To address this, execute the command below to generate new configuration files. This will create a new directory to replace the existing one. Once you have the new directory, follow the subsequent steps as outlined in the \u201ccommand.txt\u201d file.

docker run - env-file docker.env -v $(pwd)/generated:/app/generated xinfinorg/subnet-generator:latest && cd generated\n

Enter fullscreen mode Exit fullscreen mode

Issue 4: Determining the Exact Config Path for \u201cdocker.env\u201d

Question: How can I find the exact configuration path to update in the \u201cdocker.env\u201d file?

Answer: To obtain the precise configuration path, use the \u201cpwd\u201d command, which will provide you with the necessary information.

pwd\n

Enter fullscreen mode Exit fullscreen mode

Issue 5: Troubleshooting \u2018CSC Deployment Failed\u2019 Issue: Checkpoint Smart Contract Deployment

Question: Encountering a \u201cCSC deployment failed\u201d issue during the deployment of the Checkpoint Smart Contract?

Answer: Please verify that the provided Private Key contains sufficient funds for both the Smart Contract deployment and subsequent transactions.

Blockchain subnets represent a new frontier in blockchain technology. They offer the scalability, customization, and security needed to drive innovation across various industries. As blockchain subnets continue to gain momentum, staying informed about their capabilities and potential applications is crucial for anyone involved in blockchain development or adoption.

If you have any questions or need assistance, don\u2019t hesitate to reach out to the XDC Network community on XDC.Dev. Start your XDC Subnet journey today!

"},{"location":"subnet/components/","title":"Upgrading the Subnet","text":"

404 Upgrading the Subnet

"},{"location":"subnet/setting_up_your_subnet/","title":"Setting Up Your Own XDC-Subnet Tutorial","text":"

Setting Up Your Own XDC-Subnet Tutorial

"},{"location":"subnet/upgrading_subnet/","title":"Upgrading the Subnet","text":""},{"location":"subnet/upgrading_subnet/#upgrading-the-subnet","title":"Upgrading the Subnet","text":""},{"location":"subnet/upgrading_subnet/#updating-configs","title":"Updating Configs","text":""},{"location":"subnet/upgrading_subnet/#upgrading-subnet-deployment","title":"Upgrading Subnet Deployment","text":""},{"location":"subnet/upgrading_subnet/#create-a-subnet-backup","title":"Create a Subnet backup","text":"
  1. Shutdown the subnet

  2. Make a copy of xdcchain directory

"},{"location":"subnet/upgrading_subnet/#update-subnet-versions","title":"Update Subnet Versions","text":"
  1. Go to docker-compose.yml under generated directory.
  2. Change the docker image tag of your desired component(s).
  3. Run:
      docker compose --env-file docker-compose.env --profile machine1 up -d\n  docker compose --env-file docker-compose.env --profile services up -d\n

Using latest tag is not recommended since not all components version are not guaranteed to be compatible.

"},{"location":"subnet/upgrading_subnet/#updating-services-configs","title":"Updating Services Configs","text":"
  1. Shut down subnet services
    docker compose --env-file docker-compose.env --profile services down\n
  2. Update configuration (usually ENVs inside common.env file)

  3. Start subnet services

    docker compose --env-file docker-compose.env --profile services up -d\n
"},{"location":"subnet/using_subnet/","title":"UI Usage Guide","text":""},{"location":"subnet/using_subnet/#ui-usage-guide","title":"UI Usage Guide","text":"

The guide for XDC Subnet user interface

"},{"location":"subnet/using_subnet/#homepage","title":"Homepage","text":"

Once subnet is successfully deployed. The homepage will show the following.

  1. The Subnet blockchain state. You can see the current \u2018Not Confirmed\u2019 and \u2018Confirmed\u2019 blocks. \u2018Confirmed\u2019 or \u2018committed\u2019 blocks should be 3 blocks behind latest blocks.
  2. The Subnet blockchain AS KNOWN by the Parentchain. The Relayer periodically calls the Checkpoint Smart Contract to update the Subnet status (default every 2 minutes).
  3. The Network Info card shows the Subnet throughput state, by default Blocktime should be every 2 seconds. It also indicates the Parentchain network
  4. The Relayer Info card shows the Relayer status. Which Checkpoint Smart Contract (CSC) it calls, Subnet blocks in the backlog, and the remaining wallet funds.
  5. The Masternodes Info card shows the Subnet nodes status. By default, all Subnet nodes are Masternodes and all should be active.

In the lower half of the homepage there are more information as shown.

  1. This card shows further details of subnet blocks, including their height, hash, proposer, and confirmation status. The left side of \u2018confirmation status\u2019 shows the block being committed in the Subnet chain and the right side shows the block hash being recorded in the Parent chain.

  2. This card shows a detailed view of the subnet nodes including their address. The status also differrentiates inactive nodes to \u2018penalty\u2019 or \u2018standby\u2019

  3. Additionally, you can select the UI theme (light or dark) by toggling this button.

"},{"location":"subnet/using_subnet/#confirmation-checker","title":"Confirmation Checker","text":"

After navigating with the left menu bar to the Confirmation Checker of the Subnet, this will be shown.

The input box accepts Block height, Block hash, and even TX hash.

After your input, the search engine will traverse the chain and display the info accodingly. Below is an example of Block height search.

  1. Confirmation status of the block (or the block that TX belongs to)
  2. The block detailed information
  3. The Parentchain block where the Subnet block was recorded

Next is another example of a Block hash search.

  1. Confirmation status of the block (or the block that TX belongs to)
  2. The block detailed information
  3. As the Subnet block has not been checkpointed in the Parentchain, the UI is displaying height 0.
"},{"location":"subnet/using_subnet/#subnet-management","title":"Subnet Management","text":"

Subnet management is used for adding and removing Masternodes in the Subnet. To manage the subnet, you need to use the Grandmaster Account, as only the Grandmaster has the right to manage the Subnet.

You can find the Grandmaster Key in the keys.json file.

After making a modification with Subnet management, the change will take effect in the next epoch (900 blocks).

When adding a Masternode address in the management, the new Masternode server should also be started up and added to the network.

"},{"location":"subnet/using_subnet/#1-log-in-to-the-wallet-and-connect-to-the-subnet","title":"1. Log in to the Wallet and Connect to the Subnet","text":"

To manage the subnet, you need to use your Grandmaster Account. Find the Grandmaster Key in the keys.json file and import this account into your wallet.

  1. Go to the correct tab and switch to the Grandmaster Account.
  2. Click the Connect Wallet button.

  3. Choose your wallet and allow the subnet network to be added. The wallet will automatically switch to this network, as shown below:

If the wallet doesn\u2019t switch to the subnet automatically, follow the instructions on the page to fill in the network details manually and connect to the subnet.

  1. Connect the account and network.

You will see a confirmation page like this:

"},{"location":"subnet/using_subnet/#2-node-operations","title":"2. Node Operations","text":""},{"location":"subnet/using_subnet/#21-add-nodes-in-a-subnet","title":"2.1 Add Nodes in a Subnet","text":"

Subnet nodes are managed by two files. To add a node, create the corresponding subnetX.env file and add an entry in docker-compose.yml. Apply the changes to add the node to the subnet. (To remove a node, delete the related configuration file)

To add a node, follow these steps:

  1. Go to the generated directory and run the add-node.sh script. Enter the key when prompted:

    cd .scripts/add-node.sh\n
  2. Update the subnet settings with the following commands:

    docker-compose --env-file docker-compose.env --profile machine1 up -d\ndocker-compose --env-file docker-compose.env --profile services up -d\n
"},{"location":"subnet/using_subnet/#22-add-candidate","title":"2.2 Add candidate","text":"
  1. Switch to the Master List Tab
  2. Click the Add a new master candidate button to add the node as a master node. Delegation amount must be at least 10,000,000 Subnet tokens.
"},{"location":"subnet/using_subnet/#23-change-node-delegation","title":"2.3 Change node delegation","text":""},{"location":"subnet/using_subnet/#24-remove-a-node","title":"2.4 Remove a node","text":"
  1. In the Master List Tab, select the node you want to remove, and click the Remove button.
  2. After removal, the node\u2019s delegated XDC will be reset to zero, and the node information will be removed from the list after one epoch.
"},{"location":"subnet/using_subnet/#faucet","title":"Faucet","text":"

In Subnets, all native tokens are initially assigned to the Grandmaster Wallet. To allow users to use the Subnet, we have to distribute the tokens out of the Grandmaster. We have provided convenient scripts for you to easily share Subnet tokens to your users.

"},{"location":"subnet/using_subnet/#one-time-transfer","title":"One-time Transfer","text":"

Under generated directory run the Faucet script.

./scripts/faucet.sh\n

The script will ask for your source wallet private key. You can use the Grandmaster Wallet(check keys.json file for the private key). Then input the destination wallet and the transfer amount.

"},{"location":"subnet/using_subnet/#faucet-server","title":"Faucet Server","text":"

Under generated directory run the Faucet server script.

./scripts/faucet-server.sh\n

The script will ask for your source wallet private key. you can use the Grandmaster Wallet(check keys.json for the private key). By default, the server is hosted on port 5211 of your machine. Then, on your browser, visit the url: http://127.0.0.1:5211

Input your destination wallet or feel free to generate a random wallet via Address Generator.

Submit and wait for confirmation.

You can host this on any server and allow users to make token requests by themselves.

"},{"location":"subnet/using_subnet/#transfer-subnet-funds-without-faucet","title":"Transfer Subnet Funds Without Faucet","text":"

The Faucet is not neccessary needed for funds transfer, most Ethereum compatible web3 wallet will also work.

First import a new wallet with the Grandmaster private key. Then add a custom network pointing to your Subnet RPC URL. Finally, use the web3 wallet for tokens transfer.

"},{"location":"subnet/using_subnet/#faucet-source-code","title":"Faucet Source Code","text":"

Please feel free to check the below repositories for the Subnet Faucet source code.

https://github.com/XinFinOrg/XinFin-Node/tree/master/subnet/deployment-generator/scripts

https://github.com/XinFinOrg/XinFin-Node/tree/master/subnet/deployment-generator/src/faucet.js

"},{"location":"subnet/using_subnet/#blockchain-explorer","title":"Blockchain Explorer","text":"

You may optionally use an external blocks explorer if you require verbose browsing such as block detail, accounts browsing, contracts browsing. We can recommend Chainlens-free as one of the solution. Please follow the instructions as the previous link. You only need to pass one of the Subnet\u2019s RPC as a variable in the docker-compose command, which will most likely be NODE_ENDPOINT=http://localhost:8545 or NODE_ENDPOINT=http://<MAIN_IP>:8545.

"},{"location":"subnet/components/api_library/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/api_library/#api-library","title":"API Library","text":"

This section specifies the API library we develop for the subnet users to confirm subnet transactions.

"},{"location":"subnet/components/api_library/#specifications","title":"Specifications","text":"

TBW

"},{"location":"subnet/components/checkpoint_contract/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/checkpoint_contract/#checkpoint-smart-contract","title":"Checkpoint Smart Contract","text":"

This section specifies the Checkpoint Smart Contract in the parent chain that protects the child chain.

"},{"location":"subnet/components/checkpoint_contract/#design","title":"Design","text":""},{"location":"subnet/components/checkpoint_contract/#overview","title":"Overview","text":"

The primary function of the parent chain smart contract is to receive block data from the subnet node, verify it, and store it.

Noteworthy aspects:

"},{"location":"subnet/components/checkpoint_contract/#specifics","title":"Specifics","text":""},{"location":"subnet/components/checkpoint_contract/#checkpoint","title":"Checkpoint","text":"

The Checkpoint contract implements a blockchain checkpoint system, which verifies and stores block header information for subnetworks. Here are some key functions and features:

Logic Flow:

  1. Checkpoint uses the following parameters for contract construction:

  2. address[] initial_validator_set: List of initial validator addresses

  3. bytes genesis_header: block0HexRLP
  4. bytes block1_header: block1HexRLP
  5. uint64 gap: GAP block number on public chain
  6. uint64 epoch: EPOCH block number on public chain

  7. Relayers need to fetch every block data from the subnet node.

  8. Users can retrieve the information of each block using methods such as getHeader.

"},{"location":"subnet/components/checkpoint_contract/#lite-checkpoint","title":"Lite Checkpoint","text":"

Lite Checkpoint is a lightweight block header checkpoint. It implements several functions, including:

Logic Flow:

  1. Lite Checkpoint uses the following parameters for contract construction:

  2. address[] initialValidatorSet: List of initial validator addresses

  3. bytes block1: block1HexRLP
  4. uint64 gap: GAP block number on public chain
  5. uint64 epoch: EPOCH block number on public chain

  6. Relayers only need to fetch gap/epoch block data and fetch the following consecutive roundNumber blocks to confirm the signed gap/epoch block from the subnet node.

  7. Users can get gap/epoch block information from methods such as getHeader.

"},{"location":"subnet/components/checkpoint_contract/#upgradeable-module","title":"Upgradeable module","text":"

The Upgradeable module mainly revolves around the concept of transparent proxies and the ability to upgrade the underlying logic contracts without changing the contract\u2019s address.

"},{"location":"subnet/components/checkpoint_contract/#proxygateway-smart-contract","title":"ProxyGateway Smart Contract","text":"

The ProxyGateway smart contract plays a central role in this module. It inherits from ProxyAdmin and primarily serves the purpose of creating and managing transparent upgradeable proxies (TransparentUpgradeableProxy).

Key Components and Functionalities:

Logic Flow:

  1. Initialization:

The process begins with the ProxyGateway contract, which serves as a central hub for creating transparent upgradeable proxies. The contract owner has the capability to create either \u201cfull\u201d or \u201clite\u201d proxies.

  1. Proxy Creation:

  2. The owner calls either the createFullProxy or createLiteProxy function based on the desired type of proxy.

  3. The specified logic contract\u2019s MODE is checked to ensure it matches the desired proxy type.
  4. A new TransparentUpgradeableProxy is created with the specified logic contract, the ProxyGateway as the admin, and any necessary initialization data.
  5. The new proxy\u2019s address is stored in the cscProxies mapping under its corresponding type.
  6. The CreateProxy event is emitted to log the creation of the new proxy.

  7. Upgrading the Proxy:

When there\u2019s a need to upgrade the underlying logic of the proxy (for instance, to introduce new features or fix bugs):

Users and other contracts can interact with the proxy just as they would with a regular contract. However, behind the scenes, all function calls and data accesses are delegated to the current logic contract that the proxy points to.

  1. Querying and Data Access:

Users and contracts can still query data, access functions, or invoke transactions on the proxy\u2019s address. The proxy transparently delegates these to the underlying logic contract, ensuring continuity of operations.

  1. Advanced Management:

Through the ProxyAdmin functionality, the owner can further manage the proxy, such as changing the admin or even downgrading to a previous version of the logic contract if needed.

"},{"location":"subnet/components/checkpoint_contract/#spec","title":"Spec","text":""},{"location":"subnet/components/checkpoint_contract/#apis","title":"APIs","text":""},{"location":"subnet/components/checkpoint_contract/#algorithms-and-rules","title":"Algorithms and Rules","text":"

Block header verification follows two principle rules: 1. Received block should have consistent round number and block number associated with its parent block. 2. Received block should have enough certificates signed by the list of block signers.

Once a block header is checked and stored, the contract will examine whether there are 3 consecutive blocks that have 3 consetive round number. If that is the case, all of the direct ancestor blocks that are prior to these 3 consecutive blocks will be committed.

"},{"location":"subnet/components/relayer/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/relayer/#relayer","title":"Relayer","text":"

This section specifies the relayer that checkpoints the subnet chain to the parent chain.

"},{"location":"subnet/components/relayer/#design","title":"Design","text":""},{"location":"subnet/components/relayer/#background","title":"Background","text":"

There is a strong demand from the banking industry to adopt XDC. One of the key requirements to enter the field is the ability to support subnets so that banks are able to keep the sensitive transactions within their own domain (privacy concern) but at the same time, have the ability to continuously audit the result (hash) of the subnet transactions on the XDC mainnet (security concern).

Since the mainnet and subnets will be running as two independent node cluster, we will need to figure out a method to bridge them together to perform the auditing feature mentioned above. This is where \u201crelayer\u201d is coming into play.

"},{"location":"subnet/components/relayer/#high-level-architectural-diagram","title":"High-level architectural diagram","text":"

At high level, the relayer is able to: 1. Pull necessary data from both subnet and mainnet 2. Process and submit subnet block data as smart contract transactions into mainnet 3. When subnet masternodes list changes, report the new list and change height to the mainnet using grand-master account.

"},{"location":"subnet/components/relayer/#relayer-mode","title":"Relayer Mode","text":"

There are 2 relayer modes \u2018Full\u2019 and \u2018Lite\u2019 where the default mode is \u2018Full\u2019. In the full mode, all subnet block headers are checkpointed to the parent chain. In the lite mode, only the Epoch and Epoch gap subnet block headers are checkpointed in the parent chain (blocks 451,900,1351,1800, and so on). The Epoch and Epoch gap blocks stores important information regarding subnet validators selection. For further reading please check Checkpoint Smart Contract.

"},{"location":"subnet/components/relayer/#choosing-full-or-lite-relayer","title":"Choosing Full or Lite Relayer","text":"

The Full mode has the advantage of being more \u2018complete\u2019 and more \u2018current\u2019 as blocks are getting confirmed in the parent chain almost immediately. The Lite mode has the advantage of using lower parent chain gas fee as the Relayer is only submitting to once every 450 blocks.

"},{"location":"subnet/components/relayer/#deployment","title":"Deployment","text":"

In the deployment RELAYER_MODE config is only relevant for Checkpoint Smart Contract (CSC) deployment. The relayer itself is able to detect the CSC type automatically and push block headers accordingly.

"},{"location":"subnet/components/subnet_chain/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/subnet_chain/#subnet-chain","title":"Subnet Chain","text":"

This section specifies the subnet itself, a sovereign, permissioned, and high-performing blockchain.

"},{"location":"subnet/components/subnet_chain/#design","title":"Design","text":"

XDC subnet is a blockchain network tailored for private and consortium use cases. It is powered by XDC2.0, which is the core engine of XDC network and enables state-of-the-art security against Byzantine attacks with forensics, fast transaction confirmation, and low energy consumption. It is also designed to enable secure checkpointing to XDC mainnet, so that it can harness the security, finality, and accountability of mainnet.

"},{"location":"subnet/components/subnet_chain/#xdc20-protocol","title":"XDC2.0 Protocol","text":"

As the core engine of both XDC mainnet and subnet, XDC2.0 maintains the consistency of the blockchain with strong security and performance guarantees. The Delegated Proof-of-Stake subprotocol elects a committee of masternodes. The masternodes run the state-of-the-art HotStuff consensus subprotocol to settle block generation and verification and confirm transactions. Besides, XDC2.0 protocol enables its unique feature, namely forensic monitoring. When the adversary corrupts more than \u2153 masternodes and violates safety, forensic monitoring can detect those actions and report irrefutable evidence of the culprits.

The distinction between XDC2.0 for subnet and mainnet is that for subnet the masternodes are permissioned whereas for mainnet they are permissionless.

"},{"location":"subnet/components/subnet_chain/#your-own-blockchain-network","title":"Your Own Blockchain Network","text":"

XDC subnet is completely owned by you. You, the owner of the subnet, are capable of controlling several aspects of the subnet.

First, the owner regulates the master node list. More specifically, the join/retire of mater nodes is done by smart contract calls that only the owner has access to. Also, underperforming or misbehaving masternodes could be expelled by the owner. This is in contrast with XDC mainnet, where masternodes join or leave willingly as long as they follow the rule enforced by the protocol.

Second, the blockchain genesis can be configured by the owner. The owner is able to distribute initial tokens and create accounts, as well as deploy system-level smart contracts on the blockchain.

Last, the owner can customize blockchain parameters, such as epoch length, max masternode number, the quorum certificate threshold, the reward per epoch, etc.

"},{"location":"subnet/components/subnet_chain/#integrating-with-xdc-mainnet","title":"Integrating with XDC mainnet","text":"

Integrating with XDC mainnet will enable subnet to harness the security, finality, and accountability of XDC mainnet. This requires the subnet owner to deploy a smart contract (XDC will provide) to XDC mainnet and report block headers and masternode changes to the smart contract.

As long as the mainnet is secure, the block header information of the subnet is securely stored on the mainnet. Users can also query the mainnet for finality to enhance the confidence that the subnet transaction is indeed finalized. The subnet can also report the culprits to the forensic server of XDC mainnet when its forensic monitor module detects safety violations. When the culprit report is validated, necessary measurements should be taken by the owner to reestablish the security of the subnet.

It is worth noting that the subnet can be deployed as a standalone, independent blockchain network without integrating with XDC mainnet. The choice is up to the owner whether to harness the advantages of XDC mainnet.

"},{"location":"subnet/components/subnet_chain/#api","title":"API","text":"

Subnet-specific APIs

"},{"location":"subnet/components/subswap/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/subswap/#subswap","title":"Subswap","text":""},{"location":"subnet/components/subswap/#design","title":"Design","text":"

Topic: Design of Subswap Cross-Chain Transfer System on XDC Zero

Subswap is cross-chain application built on XDC Zero to provide seamless cross-chain transfer capabilities. It is structured in a multi-layered architecture, with each layer handling distinct functions to ensure smooth, secure, and efficient transactions across blockchain networks. This document provides a design overview of each layer, illustrating the components and their roles within the Subswap system.

"},{"location":"subnet/components/subswap/#system-architecture","title":"System Architecture","text":"

Subswap is organized into three layers:

  1. Layer 0 - XDC Zero (Core Infrastructure)
  2. Relayer: Manages the transfer of data and assets between blockchains by relaying transaction information across chains.
  3. Oracle: Provides reliable and up-to-date data for cross-chain operations, ensuring that the transfer protocols operate with accurate information.
  4. Endpoint: Serves as the core communication channel within XDC Zero, connecting the layers and ensuring transactions flow smoothly.
  5. Front-End Management: Handles the user interface and manages interactions with the underlying protocols, offering a streamlined experience for users initiating cross-chain transfers.

  6. Layer 1 - Treasury

  7. Cross-Chain Transfer Frontend: User-facing interface for initiating and tracking cross-chain transactions. This frontend simplifies the user experience, making it easier for users to start transfers between different blockchains.
  8. Mint/Burn Contract: Manages asset issuance and burning on different chains. This contract mints new assets on the target chain while burning them on the source chain, maintaining asset consistency across networks.
  9. Lock/Unlock Contract: Locks assets on the source chain and unlocks them on the target chain, ensuring that the asset\u2019s total supply remains consistent and secure across chains.

  10. Layer 2 - Swap Protocol

  11. Swap Frontend: Provides a user-friendly interface for initiating swaps between different assets on the Subswap platform.
  12. Swap Contract: Executes the swap logic, managing the conversion of assets based on the predefined terms and rates, ensuring that users receive the correct assets after a swap.
"},{"location":"subnet/components/subswap/#design-considerations","title":"Design Considerations","text":""},{"location":"subnet/components/subswap/#conclusion","title":"Conclusion","text":"

Subswap leverages XDC Zero\u2019s powerful infrastructure to deliver an efficient cross-chain transfer service. By layering its architecture, Subswap can maintain security, scalability, and ease of use, meeting the needs of users looking for seamless asset transfers across multiple blockchain networks.

"},{"location":"subnet/components/subswap/#constructionif-you-want-to-make-a-cross-chain-transfer","title":"Construction(if you want to make a cross chain transfer)","text":""},{"location":"subnet/components/subswap/#spec","title":"Spec","text":""},{"location":"subnet/components/subswap/#subswap-api-documentation","title":"Subswap API Documentation","text":"

This document provides an API reference for the Subswap contracts, specifically for the ParentnetTreasury and SubnetTreasury contracts. These contracts facilitate cross-chain asset transfers by minting, burning, locking, and unlocking tokens between chains.

"},{"location":"subnet/components/subswap/#restricted-access-functions","title":"Restricted Access Functions","text":""},{"location":"subnet/components/subswap/#parentnettreasury","title":"ParentnetTreasury","text":"
  1. changeEndpoint(address endpoint) -> void
  2. Description: Allows the contract owner to set a new endpoint address.
  3. Parameters:
  4. Access: onlyOwner

  5. setEndpoint(address endpoint) -> void

  6. Description: Sets a new endpoint address, restricted to calls from the current endpoint.
  7. Parameters:
  8. Access: onlyEndpoint

  9. mint(...) -> void

  10. Description: Mints tokens on the SubnetTreasury chain in response to a cross-chain transfer.
  11. Parameters:
  12. Access: onlyEndpoint
"},{"location":"subnet/components/subswap/#subnettreasury","title":"SubnetTreasury","text":"
  1. changeEndpoint(address endpoint) -> void
  2. Description: Allows the contract owner to set a new endpoint address.
  3. Parameters:
  4. Access: onlyOwner

  5. setEndpoint(address endpoint) -> void

  6. Description: Sets a new endpoint address, restricted to calls from the current endpoint.
  7. Parameters:
  8. Access: onlyEndpoint

  9. unlock(address token, uint256 amount, address recv) -> void

  10. Description: Unlocks tokens on the current chain, sending them to the specified address.
  11. Parameters:
  12. Access: onlyEndpoint
"},{"location":"subnet/components/subswap/#public-functions","title":"Public Functions","text":""},{"location":"subnet/components/subswap/#parentnettreasury_1","title":"ParentnetTreasury","text":"
  1. burn(...) -> void
  2. Description: Burns tokens on the ParentnetTreasury side to initiate a cross-chain transfer, sending a message to SubnetTreasury to mint tokens.
  3. Parameters:
  4. Events:

  5. test(uint256 rid, address rua, bytes memory data) -> void

  6. Description: Sends arbitrary data to the specified chain via the endpoint, for testing purposes.
  7. Parameters:

  8. getEndpoint() -> address

  9. Description: Returns the current endpoint address.
"},{"location":"subnet/components/subswap/#subnettreasury_1","title":"SubnetTreasury","text":"
  1. lock(...) -> void
  2. Description: Locks tokens on the SubnetTreasury side to initiate a cross-chain transfer, sending a message to ParentnetTreasury to mint tokens.
  3. Parameters:
  4. Events:

  5. getChainId() -> uint256

  6. Description: Returns the chain ID of the current chain.

  7. getEndpoint() -> address

  8. Description: Returns the current endpoint address.
"},{"location":"subnet/components/subswap/#algorithms-and-rules","title":"Algorithms and Rules","text":""},{"location":"subnet/components/subswap/#minting-and-burning","title":"Minting and Burning","text":""},{"location":"subnet/components/subswap/#locking-and-unlocking","title":"Locking and Unlocking","text":""},{"location":"subnet/components/subswap/#endpoint-and-cross-chain-communication","title":"Endpoint and Cross-Chain Communication","text":""},{"location":"subnet/components/xdc_zero/","title":"Upgrading the Subnet","text":""},{"location":"subnet/components/xdc_zero/#xdczero","title":"XDCZero","text":""},{"location":"subnet/components/xdc_zero/#design","title":"Design","text":"

XDC-Zero is a cross-chain framework that allows interoperability between XDC-Subnet and the XDC network. It ensures frictionless data transmission and rigorous validation across the Subnet and the Parentchain.

"},{"location":"subnet/components/xdc_zero/#key-components","title":"Key Components","text":""},{"location":"subnet/components/xdc_zero/#oracle","title":"Oracle","text":"

Acting as the architectural keystone, the Oracle ensures the safe transfer of pivotal data, notably block headers, bridging source and target blockchains. Utilizing CSC contracts, the system guarantees not just steadfast data transfer but also the safeguarding of crucial block header details on the destination blockchain. Such functionalities affirm the data\u2019s integrity and coherence throughout chains.

"},{"location":"subnet/components/xdc_zero/#relayer","title":"Relayer","text":"

The Relayer functions as the essential conduit for transactional precision. Its core duty is to extract payload data from the source chain\u2019s Endpoint contract and channel it to the counterpart on the target chain. With this mechanism in place, XDC ZERO promises the exact and secure relay of transaction data, fostering efficient cross-chain synergies.

"},{"location":"subnet/components/xdc_zero/#endpoint","title":"Endpoint","text":"

The XDC Zero Endpoint stands as the nexus for cross-chain communication, adeptly receiving and dispatching data packets across disparate blockchain networks. It offers indispensable services for the fluid operation of the cross-chain paradigm:

At its core, the Endpoint functions as the orchestrator for all cross-chain data activities, ensuring data is meticulously received, processed, and channeled to its rightful destination.

"},{"location":"subnet/components/xdc_zero/#frontend","title":"Frontend","text":"

Experience a user-centric interface to manage the endpoint contracts spanning different chains. View the chain entities already synchronized with the current endpoint contract and effortlessly onboard new chain entities as per requirements.

"},{"location":"subnet/components/xdc_zero/#endpoint-workflow","title":"Endpoint workflow","text":""},{"location":"subnet/components/xdc_zero/#workflow","title":"Workflow","text":""},{"location":"subnet/components/xdc_zero/#api-documentation","title":"API Documentation","text":""},{"location":"subnet/components/xdc_zero/#restricted-access-functions","title":"Restricted Access Functions","text":"

Functions accessible only by the contract owner or authorized clients.

  1. send(uint256 rid, address rua, bytes data)

  2. Description: Sends a packet to the designated receive chain.

  3. Parameters:

  4. validateTransactionProof(uint256 csid, bytes key, bytes[] calldata receiptProof, bytes[] calldata transactionProof, bytes32 blockHash)

  5. Description: Validates transaction and receipt proofs, ensuring secure cross-chain communication.

  6. Parameters:

  7. registerChain(uint256 chainId, IFullCheckpoint csc, Endpoint endpoint)

  8. Description: Registers a new chain for packet reception.

  9. Parameters:

  10. approveApplication(uint256 rid, address rua, address sua)

  11. Description: Approves both a receive and send application for cross-chain interaction.

  12. Parameters:

  13. approveRua(uint256 rid, address rua)

  14. Description: Approves a receive application (rua) for a specific chain.

  15. Parameters:

  16. approveSua(address sua)

  17. Description: Approves a send application (sua) for packet sending.

  18. Parameters:

  19. revokeApplication(uint256 rid, address rua, address sua)

  20. Description: Revokes approval for both a receive and send application.

  21. Parameters:

  22. revokeRua(uint256 rid, address rua)

  23. Description: Revokes approval for a specific receive application.

  24. Parameters:

  25. revokeSua(address sua)

  26. Description: Revokes approval for a send application.
  27. Parameters:
"},{"location":"subnet/components/xdc_zero/#public-functions","title":"Public Functions","text":"

Functions accessible by any user or contract on the blockchain.

  1. packetHash() returns (bytes32)

  2. Description: Retrieves the hash for the Packet event.

  3. getRlp(bytes memory key, bytes[] calldata proof, bytes32 root) returns (bytes memory)

  4. Description: Retrieves RLP data based on a Merkle Patricia proof.

  5. getFailureDataLength(uint256 rid) returns (uint256)

  6. Description: Retrieves the count of failed data entries for a specified receive chain.

  7. getReceiveChainLastIndex(uint256 chainId) returns (uint256)

  8. Description: Retrieves the last index for a specified receive chain.

  9. getSendChain(uint256 chainId) returns (Chain memory)

  10. Description: Retrieves details of a send chain based on its ID.

  11. getSendChainIds() returns (uint256[] memory)

  12. Description: Returns an array of all registered send chain IDs.

  13. allowanceRua(uint256 rid, address rua) returns (bool)

  14. Description: Checks if a receive application is approved for a specific chain.

  15. Parameters:

  16. allowanceSua(address sua) returns (bool)

  17. Description: Checks if a send application is approved.
  18. Parameters:
"},{"location":"subnet/components/xdc_zero/#algorithms-and-rules","title":"Algorithms and Rules","text":""},{"location":"subnet/install_guide/config_explanation/","title":"Upgrading the Subnet","text":""},{"location":"subnet/install_guide/config_explanation/#configs-explanation","title":"Configs Explanation","text":""},{"location":"subnet/install_guide/config_explanation/#files-under-generated-directory","title":"Files under \u2018generated\u2019 directory","text":"

After the generator has succesfully run, all generated files will be under \u2018generated\u2019 directory. These files can be edited if you would like to further customize your subnet. Below is a description of each generated file and how it is used.

"},{"location":"subnet/install_guide/config_explanation/#commonenv","title":"common.env","text":""},{"location":"subnet/install_guide/config_explanation/#subnetenv","title":"subnet*.env","text":""},{"location":"subnet/install_guide/config_explanation/#subnet-ports","title":"Subnet Ports","text":"
  1. Subnet Nodes - 3 ports are used per each subnet, RPC port, WS port, and Peering port. The port number is incremented by 1 for the next subnet node. For example subnet1\u2019s RPC is 8545, subnet2\u2019s RPC will be 8546 and so on.
  2. RPC PORT - 8545, 8546, 8547, \u2026 This is the API port, for outside chain communication to issue transaction or query chaindata.
  3. WS PORT - 9555, 9556, 9557, \u2026 This is not used currently.
  4. Peering port - 20303, 20304, 20305, \u2026 This is used for subnet nodes and bootnode peering and communication.
  5. Subnet ports config can be changed in subnetX.env for each individual subnet.
  6. Bootnode - port 20301
  7. Bootnode port can be changed at BOOTNODE_PORT under common.env. Also in each subnetX.env, BOOTNODES port has to be changed.
  8. Stats Server (UI backend) - port 5213.
  9. UI Frontend - port 5214.
  10. Relayer UI - port 5215.
  11. Faucet Server - port 5211
  12. Generator UI - port 5210.
"},{"location":"subnet/install_guide/f%26q/","title":"Upgrading the Subnet","text":""},{"location":"subnet/install_guide/f%26q/#frequently-asked-questions","title":"Frequently Asked Questions","text":""},{"location":"subnet/install_guide/f%26q/#subnet-launch","title":"Subnet Launch","text":""},{"location":"subnet/install_guide/f%26q/#common-issues","title":"Common Issues","text":""},{"location":"subnet/install_guide/f%26q/#troubleshooting-scripts","title":"Troubleshooting Scripts","text":"

This will check your current block in Subnet

This will check the number of peers of your Subnet node

"},{"location":"subnet/install_guide/f%26q/#subnet-node-requirements","title":"Subnet Node Requirements","text":"

Even one node is enough to start the Subnet blockchain! However, for better decentralized security, 3+ nodes are recommended. At least \u2154 of all nodes must be online and honest to mine blocks.

"},{"location":"subnet/install_guide/f%26q/#development-and-testing","title":"Development and Testing","text":"

It\u2019s recommended to use the testnet, as the devnet will be less stable due to frequent development changes.

"},{"location":"subnet/install_guide/f%26q/#managing-subnet-tokens","title":"Managing Subnet Tokens","text":"

In XDC-Subnet, all initial tokens are assigned to the Grandmaster wallet (check keys.json). You can transfer tokens to any wallet address. For easy transfers, refer to the Faucet documentation.

A Faucet server script is provided for you to deploy under generated/scripts/faucet-server.sh. Anyone with access to the faucet page can request tokens. Please refer to the faucet page for more details.

"},{"location":"subnet/install_guide/f%26q/#security-and-sensitive-files","title":"Security and Sensitive Files","text":"

The following files contain sensitive information and should be stored securely:

"},{"location":"subnet/install_guide/f%26q/#configuration-changes","title":"Configuration Changes","text":"

You can update the common.env file to change the Relayer key. Refer to the service configuration documentation for more details.

"},{"location":"subnet/install_guide/f%26q/#troubleshooting","title":"Troubleshooting","text":"

For troubleshooting support, join our Telegram Support Group. For suggestions or requests, you can also reach out via:

"},{"location":"subnet/install_guide/launch_subnet/","title":"Upgrading the Subnet","text":""},{"location":"subnet/install_guide/launch_subnet/#launch-a-subnet","title":"Launch a Subnet","text":""},{"location":"subnet/install_guide/launch_subnet/#requirements","title":"Requirements","text":""},{"location":"subnet/install_guide/launch_subnet/#video-walkthrough","title":"Video Walkthrough","text":""},{"location":"subnet/install_guide/launch_subnet/#generate-subnet-configs-with-ui","title":"Generate Subnet Configs With UI","text":"
  1. Pull generator.sh script from the generator Github repo

    curl -O https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/subnet/deployment-generator/scripts/generate.sh\n
  2. Run the configuration generator, this will start a local webserver

    chmod +x generate.sh\n./generate.sh\ncd generated\n
  3. Go to http://localhost:5210/ in your browser. If you are running this on a remote server.

    first use ssh tunnel: ssh -N -L localhost:5210:localhost:5210 USERNAME@IP_ADDRESS -i SERVER_KEY_FILE **if you're using VSCode to SSH, the port might be forwarded to your machine automatically (no need for above step)

  4. Config the Subnet options per your requirement.

  5. follow the generated instructions in commands.txt. In general, the steps are:

  6. Once successfully deployed, you can check out UI usage guide

"},{"location":"subnet/install_guide/launch_subnet/#removing-subnet","title":"Removing Subnet","text":""},{"location":"subnet/install_guide/launch_subnet/#shutdown-subnet","title":"Shutdown Subnet","text":"

Under generated directory

docker compose --env-file docker-compose.env --profile services down \ndocker compose --env-file docker-compose.env --profile machine1 down\n
"},{"location":"subnet/install_guide/launch_subnet/#deleting-subnet","title":"Deleting Subnet","text":"

Remove xdcchain*, bootnodes, and stats-service directories Warning: this cannot be undone

rm -rf xdcchain* bootnodes stats-service\n
"},{"location":"xdcchain/","title":"XDC Chain","text":"XDC Chain

The XDC Network is a cutting-edge blockchain platform designed to revolutionize the way businesses manage and exchange data, assets, and financial records. Boasting impressive speed and scalability, the XDC Network is capable of handling a high volume of transactions with minimal delays, making it ideal for enterprise-level applications. Its low transaction fees further enhance its appeal, allowing businesses to conduct operations cost-effectively.

What truly sets the XDC Network apart is its military-grade security, ensuring that all data exchanges and asset transfers are protected against potential threats. This level of security is crucial for industries where trust and confidentiality are paramount. By leveraging the XDC Network, businesses can streamline their operations, improve record-keeping accuracy, and facilitate more efficient and secure data exchanges. Whether it's in finance, supply chain management, or trade, the XDC Network provides a robust and reliable infrastructure that empowers businesses to thrive in the digital age.

Developers

User guide to get started on XDC Chain

Governance

XDC Network is a community-oriented ecosystem, meticulously built upon the foundation of decentralized governance.

XDC Ecosystem

XDC ecosystem and developer tools

Run a Masterode

How to run a XDC Masternode

JSON-RPC API

Interacting with XDC requires sending requests to specific JSON-RPC API methods.

"},{"location":"xdcchain/evmtoxdc/","title":"Overview - XDC Chain","text":""},{"location":"xdcchain/evmtoxdc/#migrating-from-evm-to-xdc","title":"Migrating from EVM to XDC","text":"

Migrating a Solidity contract from Ethereum to the XDC network with Truffle involves several steps. The XDC network is a public blockchain that is EVM-compatible and designed to support enterprise-level applications. Truffle is a popular development framework for creating and deploying Solidity contracts.

"},{"location":"xdcchain/evmtoxdc/#step-1-install-truffle","title":"Step 1: Install Truffle","text":"

The first step is to install the XDC network and Truffle. This can be done by following the installation instructions provided by XDC and Truffle.

Installation - Truffle Suite

"},{"location":"xdcchain/evmtoxdc/#step-2-configure-truffle-for-xdc","title":"Step 2: Configure Truffle for XDC","text":"

Next, Truffle needs to be configured to work with the XDC network. This involves creating a new Truffle project and configuring the Truffle config file to connect to the XDC network by using a public RPC connected to the XDC network.

Configuration - Truffle Suite

"},{"location":"xdcchain/evmtoxdc/#step-3-compile-the-contract","title":"Step 3: Compile the Contract","text":"

After updating the Solidity contract, it needs to be compiled for the XDC network. This involves using the Truffle compiler to create a bytecode file that can be deployed on the XDC network.

Compile contracts - Truffle Suite

"},{"location":"xdcchain/evmtoxdc/#step-4-deploy-the-contract","title":"Step 4: Deploy the Contract","text":"

The next step is to deploy the updated contract on the XDC network. This can be done using Truffle\u2019s deployment commands. It is important to ensure that the contract is deployed correctly and securely.

"},{"location":"xdcchain/evmtoxdc/#step-5-test-the-contract","title":"Step 5: Test the Contract","text":"

After deploying the contract, it is important to thoroughly test it on the XDC network. This includes testing all functions and features, as well as testing for security vulnerabilities. You can write tests in Truffle using Javascript to build debug and test contracts ready to be deployed onto the network

Write JavaScript tests - Truffle Suite

"},{"location":"xdcchain/evmtoxdc/#step-6-update-clients-and-interfaces","title":"Step 6: Update Clients and Interfaces","text":"

Once the contract has been migrated and tested, any clients or interfaces that interact with the contract must be updated to be compatible with the XDC network by having them point to the appropriate RPCs on the xdc network.

For a How-To guide showing migration of a dApp from Ethereum to the XDC Network please go to this link.

"},{"location":"xdcchain/introduction/","title":"Introduction","text":""},{"location":"xdcchain/introduction/#introduction","title":"Introduction","text":"

XinFin\u2019s XDC Network is an enterprise-ready, Layer-1, EVM-compatible, open-source, hybrid blockchain protocol specializing in tokenization for real-world decentralized finance. It uses a special type of delegated proof-of-stake (XDPoS) for consensus to ensure quick transaction times, minimal gas fees, and a remarkable 2,000+ transactions per second (TPS).

XDC Network is backed by the XDC Community, leading to the formation of the XDC Foundation, which was established in 2021 to promote the growth and adoption of XDC through collaboration with a community of developers, trade experts, and content creators.

"},{"location":"xdcchain/introduction/#xinfin-delegated-proof-of-staked-authority","title":"XinFin Delegated Proof of Staked Authority","text":"

-

"},{"location":"xdcchain/introduction/#security","title":"Security","text":"

-

"},{"location":"xdcchain/introduction/#fast-finality","title":"Fast Finality","text":"

-

"},{"location":"xdcchain/introduction/#reward","title":"Reward","text":"

-

"},{"location":"xdcchain/introduction/#token-economy","title":"Token Economy","text":"

-

"},{"location":"xdcchain/introduction/#staking-and-governance","title":"Staking and Governance","text":"

-

"},{"location":"xdcchain/rewards/","title":"Rewards Mechanism","text":""},{"location":"xdcchain/rewards/#rewards-mechanism","title":"Rewards Mechanism","text":"

The XDC Network operates on a Delegated Proof of Stake (XDPoS) consensus mechanism, which allows for high transaction throughput, energy efficiency, and security. The network\u2019s rewards mechanism is designed to incentivize Masternode operators and participants who contribute to the stability, security, and growth of the network. This document outlines how the XDC rewards mechanism works, who is eligible for rewards, and how rewards are distributed.

"},{"location":"xdcchain/rewards/#overview-of-xdc-rewards-system","title":"Overview of XDC Rewards System","text":"

In the XDC Network, rewards are primarily distributed to Masternode operators who validate transactions, secure the network, and propose new blocks. Additionally, XDC token holders who delegate their tokens to Masternodes also earn a share of the rewards. The rewards mechanism is structured to:

Incentivize decentralization by encouraging more participants to run Masternodes or delegate their tokens. Reward active participation in the network, such as block validation and staking. Ensure the economic sustainability of the XDC Network over time.

"},{"location":"xdcchain/rewards/#masternode-operator-rewards","title":"Masternode Operator Rewards","text":"

Masternodes are critical to the XDC Network\u2019s operations, responsible for validating transactions and maintaining consensus. To compensate for their role, Masternode operators receive rewards for every block they validate.

Note: Masternodes with better uptime and performance will receive a higher portion of the rewards.

"},{"location":"xdcchain/xdpos/","title":"Overview - XDC Chain","text":""},{"location":"xdcchain/xdpos/#xdpos-xdcs-consensus-mechanism","title":"XDPoS - XDC\u2019s Consensus Mechanism","text":"

XinFin Delegated Proof of Stake(XDPoS) is another form of Proof of Stake(PoS) consensus mechanism to scale up to Thousands of transactions per second. XDPOS concentrates block production in the hands of few semi-trusted entities in order to achieve more scalability than Proof of Work(PoW) or other Proof of Stake blockchains. XDPOS leverages the power of stakeholder to resolve consensus issues in a fair and democratic way. The Self KYC feature added in XinFin XDPoS is more enterprise and regulator friendly.

"},{"location":"xdcchain/xdpos/#common-terms","title":"Common Terms","text":""},{"location":"xdcchain/xdpos/#transition-from-pow-to-xdpos","title":"Transition from PoW to XDPoS","text":"

The traditional PoW mechanism, while effective in securing networks, is highly energy-intensive due to its reliance on solving complex cryptographic puzzles across all nodes in the network. This results in significant electricity consumption and poses environmental concerns. Recognizing these drawbacks, XinFin transitioned away from PoW and adopted Proof of Stake (PoS), a more energy-efficient consensus methodology. Eventually, XinFin advanced to XinFin Delegated Proof of Stake (XDPoS), which further enhances the efficiency and security of the network.

To understand XDC Network\u2019s decision to adopt XDPoS, it\u2019s essential to explore the various consensus mechanisms.

"},{"location":"xdcchain/xdpos/#understanding-consensus-pow-vs-pos-vs-xdpos","title":"Understanding Consensus: PoW vs. PoS vs. XDPoS","text":"

In blockchain technology, consensus refers to a general agreement among nodes in the network, which is crucial for maintaining the integrity and accuracy of the distributed ledger. Unlike centralized systems like banks, where a central authority maintains records, blockchain relies on distributed ledgers to record information. Consensus ensures that all nodes agree on the state of the blockchain, including account balances, transactions, and more.

Proof of Work (PoW) PoW relies on nodes solving cryptographic puzzles to validate transactions and create new blocks. This process requires significant computational power and consumes vast amounts of electricity, making it environmentally unsustainable and costly.

Proof of Stake (PoS) PoS eliminates the need for energy-intensive computations. Instead of miners, PoS relies on validators who lock a portion of their cryptocurrency as a stake. Validators are chosen to propose the next block based on their stake and uptime. When a validator discovers a block that can be added to the blockchain, they validate it by placing a bet on it. The validators receive rewards proportional to their bets.

XinFin Delegated Proof of Stake (XDPoS) XDPoS is an evolution of PoS and offers greater efficiency. It uses a reputation-based system to achieve consensus, where master nodes create blocks in a round-robin manner. The network elects block producers (also known as witnesses) who are responsible for validating transactions and creating the next block. The key features of XDPoS include:

"},{"location":"xdcchain/xdpos/#pros-and-cons-of-xinfin-delegated-proof-of-stake","title":"Pros and Cons of XinFin Delegated Proof of Stake","text":""},{"location":"xdcchain/xdpos/#advantages","title":"Advantages","text":""},{"location":"xdcchain/xdpos/#disadvantages","title":"Disadvantages","text":""},{"location":"xdcchain/xdpos/#why-xdc-network-prefers-xdpos","title":"Why XDC Network Prefers XDPoS","text":"

XDC Network chose XDPoS for its network due to its superior speed, cost efficiency, and scalability. XDPoS offers a more democratic, faster, and effective way to scale the network, making it the ideal consensus mechanism for XDC\u2019s hybrid blockchain platform.

"},{"location":"xdcchain/xdpos2/","title":"Overview - XDC Chain","text":""},{"location":"xdcchain/xdpos2/#xdpos-20","title":"XDPoS 2.0","text":"

Sitting at the core of the XDC Network, XinFin Delegated Proof-of-Stake consensus protocol 2.0 (XDPoS 2.0) regulates the XDC nodes in maintaining the consistency of a decentralized ledger (the blockchain) with strong security and performance guarantees. In this section, we provide an overview of XDPoS 2.0 by introducing its three pillars, including:

  1. Master node election, which specifies how the delegation and proof-of-stake works.

  2. The consensus engine, namely, the HotStuff state machine replication (SMR) protocol, which is the state-of-the-art BFT (Byzantine fault-tolerant) SMR (state-machine replication) protocol. An illustration of its position in XDPoS 2.0 and a brief security analysis will be provided.

  3. Reward mechanism, which incentivizes nodes to join and maintain the XDC Network.

"},{"location":"xdcchain/developers/apothemrpc/","title":"XDC Network - Apothem RPC","text":""},{"location":"xdcchain/developers/apothemrpc/#apothem-testnet-rpc","title":"Apothem Testnet RPC","text":"

The Apothem Testnet is the test environment for the XDC Network. It mirrors the Mainnet\u2019s functionality but operates with test tokens instead of real assets, making it ideal for developers to test and deploy their applications before going live.

Public Networks Similar to the Mainnet, users can access the Apothem Testnet with an internet connection and full node RPC. They can perform all the same actions as on the Mainnet\u2014reading, creating, or validating transactions\u2014without the risks associated with live transactions.

"},{"location":"xdcchain/developers/apothemrpc/#xdc-testnet-specifications","title":"XDC TestNet Specifications","text":""},{"location":"xdcchain/developers/devnetrpc/","title":"XDC Network - Devnet RPC","text":""},{"location":"xdcchain/developers/devnetrpc/#devnet-rpc","title":"Devnet RPC","text":"

The XDC Devnet is a specialized test environment for the XDC Network, designed to closely mirror the Mainnet\u2019s functionality. The Devnet provides developers with a safe, controlled setting to test, deploy, and refine their applications using test tokens instead of real assets. This environment is crucial for ensuring that applications are robust and secure before they go live on the Mainnet.

Public Networks Similar to the Mainnet, users can access the XDC Devnet via an internet connection and a full node RPC. The Devnet allows developers to perform the same operations they would on the Mainnet, including reading blockchain data, creating and validating transactions, and deploying smart contracts. However, since the Devnet operates with test tokens, developers can experiment freely without the financial risks associated with live transactions.

"},{"location":"xdcchain/developers/devnetrpc/#xdc-devnet-specifications","title":"XDC Devnet Specifications","text":""},{"location":"xdcchain/developers/mainnetrpc/","title":"XDC Network - Mainnet RPC","text":""},{"location":"xdcchain/developers/mainnetrpc/#xdc-mainnet-rpc","title":"XDC Mainnet RPC","text":"

The XDC Mainnet is the live, operational environment of the XDC Network, where real transactions occur. The Mainnet is designed to support high-performance applications with low transaction fees and quick finality, making it ideal for enterprise use cases. The primary URL for accessing the XDC Mainnet via RPC. This endpoint allows you to interact with the blockchain by sending requests for data, submitting transactions, and more.

Public Networks

Users with an internet connection and access to a full node RPC can easily access the XDC Network\u2019s public blockchain. They can read, create, or validate transactions executed on the blockchain. The network\u2019s consensus mechanism, XDPoS (XinFin Delegated Proof of Stake), ensures that all nodes agree on the state of the network.

"},{"location":"xdcchain/developers/mainnetrpc/#xdc-mainnet-specifications","title":"XDC MainNet Specifications","text":""},{"location":"xdcchain/developers/mainnetrpc/#apothem-testnet-rpc","title":"Apothem Testnet RPC","text":"

The Apothem Testnet is the test environment for the XDC Network. It mirrors the Mainnet\u2019s functionality but operates with test tokens instead of real assets, making it ideal for developers to test and deploy their applications before going live.

Public Networks Similar to the Mainnet, users can access the Apothem Testnet with an internet connection and full node RPC. They can perform all the same actions as on the Mainnet\u2014reading, creating, or validating transactions\u2014without the risks associated with live transactions.

"},{"location":"xdcchain/developers/mainnetrpc/#xdc-testnet-specifications","title":"XDC TestNet Specifications","text":""},{"location":"xdcchain/developers/mainnetrpc/#devnet-rpc","title":"Devnet RPC","text":"

The XDC Devnet is a specialized test environment for the XDC Network, designed to closely mirror the Mainnet\u2019s functionality. The Devnet provides developers with a safe, controlled setting to test, deploy, and refine their applications using test tokens instead of real assets. This environment is crucial for ensuring that applications are robust and secure before they go live on the Mainnet.

Public Networks Similar to the Mainnet, users can access the XDC Devnet via an internet connection and a full node RPC. The Devnet allows developers to perform the same operations they would on the Mainnet, including reading blockchain data, creating and validating transactions, and deploying smart contracts. However, since the Devnet operates with test tokens, developers can experiment freely without the financial risks associated with live transactions.

"},{"location":"xdcchain/developers/mainnetrpc/#xdc-testnet-specifications_1","title":"XDC TestNet Specifications","text":""},{"location":"xdcchain/developers/quick-guide/","title":"Quick Guide","text":"

Welcome to the Quick Guide for XDC Chain! This document is designed to provide you with a comprehensive overview of the XDC Network, its technology, and the tools you need to start your journey. Whether you\u2019re new to blockchain or an experienced developer, this guide will help you navigate the key resources and get up to speed with the XDC Network.

"},{"location":"xdcchain/developers/quick-guide/#getting-started","title":"Getting Started","text":"

The XDC Network is a powerful, enterprise-grade blockchain platform designed to facilitate secure, efficient, and scalable decentralized applications (DApps) and global trade solutions. If you\u2019re just starting your journey with the XDC Network, this section will help you understand the fundamental concepts, terminology, and processes.

"},{"location":"xdcchain/developers/quick-guide/#mainnet","title":"Mainnet","text":"

The XDC Network\u2019s Mainnet is the live, operational blockchain where actual transactions take place. Understanding the Mainnet is crucial for interacting with the XDC Network in a real-world environment.

"},{"location":"xdcchain/developers/quick-guide/#apothem-testnet","title":"Apothem Testnet","text":"

The Apothem Testnet is the testing environment for the XDC Network. It\u2019s an ideal place to experiment with your DApps, smart contracts, and other blockchain-based solutions before deploying them on the Mainnet.

"},{"location":"xdcchain/developers/quick-guide/#xdc-devnet","title":"XDC Devnet","text":"

The XDC Devnet is a development-focused environment that allows developers to test and deploy their projects in a controlled setting. It\u2019s perfect for experimenting with new features, running simulations, and fine-tuning DApps before launching them on the Mainnet or Testnet.

"},{"location":"xdcchain/developers/quick-guide/#useful-links","title":"Useful Links","text":"

Here are some additional tools and resources that will help you interact with the XDC Network more effectively:

"},{"location":"xdcchain/developers/quick-guide/#xdc-wallets","title":"XDC Wallets:","text":"

To start using XDC, you\u2019ll need a secure wallet\u2014a dedicated app for storing your XDC and interacting with other apps on the XDC Network. Ensuring the safety of your XDC is crucial, so choose from a variety of trusted wallets that offer high security and unique features. Here are some of the top options.

"},{"location":"xdcchain/developers/quick-guide/#additional-tools","title":"Additional Tools:","text":""},{"location":"xdcchain/developers/quick-guide/#community-and-support","title":"Community and Support","text":"

Join the vibrant community of developers, validators, and users who are actively contributing to the XDC Network\u2019s growth and innovation. Engage with the community, ask questions, and share your knowledge.

"},{"location":"xdcchain/developers/quick-guide/#final-note","title":"Final Note","text":"

It\u2019s unnecessary to review every document to have a working knowledge of the XDC Network. Explore the resources as needed, dive deeper into specific sections that interest you, and don\u2019t hesitate to seek support from the community whenever necessary.

Happy building on the XDC Network!

For more tools and details, you can refer to XDC Chain Network Tools and Documents.

"},{"location":"xdcchain/developers/rpc/","title":"XDC Network - RPC","text":""},{"location":"xdcchain/developers/rpc/#network-endpoints","title":"Network Endpoints","text":"

The XDC Network is a robust, enterprise-grade blockchain platform designed for decentralized finance (DeFi), global trade, and other high-demand applications. For developers and users interacting with the XDC Network, the Remote Procedure Call (RPC) interface is a critical component. This guide provides a detailed overview of the RPC endpoints for both the XDC Mainnet and the Apothem Testnet, including their specifications and usage.

"},{"location":"xdcchain/developers/rpc/#what-is-rpc","title":"What is RPC?","text":"

Remote Procedure Call (RPC) is a protocol that allows communication between a client and a server over a network. In the context of blockchain, RPC is used to interact with the blockchain network by sending requests to full nodes. These requests can include reading blockchain data, creating and broadcasting transactions, and deploying smart contracts.

"},{"location":"xdcchain/developers/rpc/#mainnet-environment","title":"Mainnet Environment","text":"Service URL RPC https://erpc.xinfin.network Chain Id 50 Faucet endpoint https://chains.tools/faucet Explorer https://xdcscan.io/"},{"location":"xdcchain/developers/rpc/#apothem-environment","title":"Apothem Environment","text":"Service URL RPC https://rpc.apothem.network Chain Id 51 Faucet endpoint https://faucet.blocksscan.io/ Explorer https://apothem.xdcscan.io/"},{"location":"xdcchain/developers/rpc/#devnet-environment","title":"Devnet Environment","text":"Service URL RPC https://devnetstats.hashlabs.apothem.network/devnet Chain Id 551 Faucet endpoint https://faucet.blocksscan.io/ Explorer https://devnet.xdcscan.io/"},{"location":"xdcchain/developers/wallet-configuration/","title":"Wallet Configuration - XDC Network","text":""},{"location":"xdcchain/developers/wallet-configuration/#wallet-configuration","title":"Wallet configuration","text":"

You can use any Ethereum wallet with XDC. For instance, I will show you how to set up Metamask and Trustwallet for XDC.

Testnet/Apothem

Mainnet

Depending on your location and preference, you can choose from a variety of RPC endpoints for XDC. For more information about the endpoints and their features, please refer to the network information document that we have prepared for you. To ensure the best performance and user experience, you can test the latency of each endpoint before you configure it with your wallet. Refer

"},{"location":"xdcchain/developers/node_operators/bootstrap/","title":"Run XDC Nodes using Bootstrap Script","text":""},{"location":"xdcchain/developers/node_operators/bootstrap/#setup-xdc-masternode-using-bootstrap-script","title":"Setup XDC Masternode using Bootstrap Script","text":""},{"location":"xdcchain/developers/node_operators/bootstrap/#for-mainnet","title":"For Mainnet","text":"

Bootstrap Command XinFin Node Setup:

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n

Examples: After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cmainnet\u201d.

$ sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n[sudo] password for user:\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- mainnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201cDemo_Server.\u201d
Your running network is mainnet\nPlease enter your XinFin MasterNode Name :- Demo_Server\nYour Masternode Name is Demo_Server\n
"},{"location":"xdcchain/developers/node_operators/bootstrap/#for-testnet","title":"For Testnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201ctestnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- testnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Your running network is testnet\nPlease enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\n
"},{"location":"xdcchain/developers/node_operators/bootstrap/#for-devnet","title":"For Devnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cdevnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- devnet\nYour running network is devnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Please enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\nGenerate new private key and wallet address.\nIf you have your own key, you can change after this and restart the node\nType 'Y' or 'y' to continue:\n
"},{"location":"xdcchain/developers/node_operators/docker/","title":"Setup XDC Masternode using Docker","text":""},{"location":"xdcchain/developers/node_operators/docker/#setup-xdc-masternode-using-docker","title":"Setup XDC Masternode using Docker","text":""},{"location":"xdcchain/developers/node_operators/docker/#setting-up-xdc-network-masternode-docker-version","title":"Setting up XDC Network Masternode Docker version","text":"

The server or VPS used for the masternode should be directly facing the internet with a public IP and without NAT.

Operating System: Ubuntu 20.04 64-bit or higher

Should be facing internet directly with public IP & without NAT

Tools: Docker, Docker Compose(1.27.4+)

Setup (For Ubuntu 20.04 64-bit or higher Operating System)

Follow the written steps starting from step 1, or you can watch the video tutorials:

"},{"location":"xdcchain/developers/node_operators/docker/#step-1-clone-repository","title":"Step 1: Clone repository","text":"
git clone https://github.com/XinFinOrg/XinFin-Node.git\n
"},{"location":"xdcchain/developers/node_operators/docker/#step-2-change-directory","title":"Step 2: Change directory","text":"

Then we change the directory to XinFin-Node

cd XinFin-Node\n
"},{"location":"xdcchain/developers/node_operators/docker/#step-3-install-docker","title":"Step 3: Install docker","text":"

We need to install Docker and Docker-Compose by running the following command:

sudo ./setup/install_docker.sh\n
"},{"location":"xdcchain/developers/node_operators/docker/#step-4","title":"Step 4:","text":"

Create a new .env file and copy the env.example file that exist in the mainnet directory. We will ensure we are in the \u201cmainnet\u201d directory by typing these commands. Once in edit mode for the .env file, name your masternode and use an email address in the respective fields

cd mainnet\ncp env.example .env\nnano .env \n
For Testnet
cd testnet\ncp env.example .env\nnano .env\n
"},{"location":"xdcchain/developers/node_operators/docker/#step-5-start-your-node","title":"Step 5: Start your Node","text":"

For Mainnet run the following commands:

cd mainnet\nsudo docker-compose -f docker-compose.yml up -d\n
At this point you should be able to see your masternode on the list of nodes here or as shown below:

For Testnet run the following commands:

cd testnet\nsudo docker-compose -f docker-compose.yml up -d\n
You should be able to see your node listed on the [Apothem Network] page. Select \u201cSwitch to LiveNet\u201d to check LiveNetwork Stats and Select \u201cSwitch to TestNet\u201d for TestNetwork.

Your coinbase address can be found in xdcchain/coinbase.txt file.

For troubleshooting purposes, you can stop the node by using the following command on either Mainnet or Testnet:

sudo docker-compose -f docker-compose.yml down\n

Downloading a Network Snapshot (Mainnet or Apothem)

The following steps are to expedite the syncing process of your node with the XDC Network. If you followed the steps above, your node will take 3-4 days to sync up with the network fully. You can reduce that time by downloading a network snapshot and bringing your node back up after the chain has been downloaded and unpacked.

"},{"location":"xdcchain/developers/node_operators/docker/#mainnet-snapshot","title":"Mainnet Snapshot","text":"

Bring down your node:

sudo docker-compose -f docker-compose.yml down\n
Remove the old xdchain file from the server
rm -rf xdcchain.tar\n
Download the snapshot
wget https://download.xinfin.network/xdcchain.tar\n
Unpack the xdcchain.tar file
tar -xvzf xdcchain.tar\n
The unpacking will take some time, and it will look like this:

The following command will move the xdcchain/XDC to xdcchain/XDC_backup

mv  xdcchain/XDC xdcchain/XDC_backup\nmv XDC xdcchain\n

Then we are going to remove the old \u201cnodekey\u201d file

rm -rf xdcchain/XDC/nodekey\n

The last step is to run the bash upgrade.sh command

bash upgrade.sh\n

This command will bring your node up and it will start syncing to the network. Once up and running, your node will be synced to the network in just a few minutes.

"},{"location":"xdcchain/developers/node_operators/docker/#apothem-snapshot","title":"Apothem Snapshot","text":"

Bring down your node:

sudo docker-compose -f docker-compose.yml down\n

Remove the old xdchain file from the server

rm -rf apothem.tar\n

Download the snapshot

wget https://download.apothem.network/apothem.tar\n

Unpack the apothem.tar file

tar -xvzf apothem.tar\n

Move the xdcchain-testnet

mv XDC xdcchain-testnet\n

Bring up the node

sudo docker-compose -f docker-compose.yml up -d\n
"},{"location":"xdcchain/developers/node_operators/dockerimg/","title":"Docker Image for the XDC Network","text":""},{"location":"xdcchain/developers/node_operators/dockerimg/#docker-image-for-the-xdc-network","title":"Docker Image for the XDC Network","text":""},{"location":"xdcchain/developers/node_operators/dockerimg/#what-is-a-docker-image","title":"What is a Docker Image?","text":"

A Docker image is a lightweight, stand-alone, executable package that includes everything needed to run an application, including code, runtime, libraries, and configurations. In the context of blockchain, Docker images simplify the deployment and management of nodes by enabling developers to encapsulate the entire blockchain environment into a single, replicable package.

"},{"location":"xdcchain/developers/node_operators/dockerimg/#purpose-of-the-xdc-networks-docker-image","title":"Purpose of the XDC Network\u2019s Docker Image","text":"

For the XDC Network, the Docker image provides a standardized and efficient way for developers to deploy, manage, and update their XDC nodes. The XDC Docker image streamlines the node deployment process, reducing configuration errors and minimizing setup time. It allows developers to run nodes in isolated containers, ensuring a consistent environment across different infrastructures.

"},{"location":"xdcchain/developers/node_operators/dockerimg/#key-features-of-the-xdc-docker-image-include","title":"Key features of the XDC Docker image include:","text":"
  1. Ease of Deployment: Developers can deploy XDC nodes with just a few simple commands, reducing the complexity of setup.
  2. Portability: Docker images are portable, meaning they can run consistently across various platforms, including local machines, cloud environments, and virtualized infrastructure.
  3. Version Control: The XDC Docker image includes versioning, allowing developers to choose specific versions for compatibility testing or deployment.
  4. Improved Security: Isolated environments reduce security risks as each container runs independently from the host system.
"},{"location":"xdcchain/developers/node_operators/masternode/","title":"Masternode","text":""},{"location":"xdcchain/developers/node_operators/masternode/#run-a-node","title":"Run a Node","text":"

Nodes are computers or servers that run an application software known as clients to perform essential tasks on a blockchain network. These tasks can include transactions, block creation, consensus, network security, and other operational tasks for the network. The tasks and functionalities a node execute depend on the type of node, with each node having different system requirements and deployment processes. This section will provide details and information on how to run and maintain nodes on the XDC Network.

"},{"location":"xdcchain/developers/node_operators/masternode/#masternodes","title":"Masternodes","text":"

The XDC Network runs on a globally distributed system of masternodes that participate in a Delegated Proof of Stake (DPoS) consensus mechanism. To enhance network integrity and security, Masternodes are required to complete a KYC process and stake 10,000,000 XDC. Masternodes can be identified as \u201cValidator\u201d or \u201cStandby\u201d Masternodes.

"},{"location":"xdcchain/developers/node_operators/masternode/#standby-masternodes","title":"Standby Masternodes","text":"

Standby Masternodes (or \u201cStandby Nodes\u201d) are identical in form and function to Validators but do not participate in validating transactions and block creation. These nodes are on standby to fill the role of Validators that drop from network participation.

To host an XDC Masternode/Standby node, there are specific prerequisites that you need to meet in terms of hardware, software, and staking requirements. Below is a detailed list:

"},{"location":"xdcchain/developers/node_operators/masternode/#hardware-requirements","title":"Hardware Requirements","text":"

To ensure smooth operation and optimal performance of the XDC Masternode, the following hardware specifications are recommended:

"},{"location":"xdcchain/developers/node_operators/masternode/#software-requirements","title":"Software Requirements","text":"

Ensure that you have the following software and dependencies installed on your server before proceeding with the XDC Masternode setup:

"},{"location":"xdcchain/developers/node_operators/masternode/#staking-requirements","title":"Staking Requirements","text":"

To host an XDC Masternode, a certain amount of XDC tokens must be staked. This ensures that the node operator has a vested interest in the security and performance of the network.

"},{"location":"xdcchain/developers/node_operators/masternode/#xdc-wallet-setup","title":"XDC Wallet Setup","text":"

You must set up an XDC wallet to manage your funds and staking:

"},{"location":"xdcchain/developers/node_operators/masternode/#setup-xdc-masternode-using-bootstrap-script","title":"Setup XDC Masternode using Bootstrap Script","text":""},{"location":"xdcchain/developers/node_operators/masternode/#for-mainnet","title":"For Mainnet","text":"

Bootstrap Command for XDC Masternode Setup:

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n

Examples: After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cmainnet\u201d.

$ sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n[sudo] password for user:\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- mainnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201cDemo_Server.\u201d
Your running network is mainnet\nPlease enter your XinFin MasterNode Name :- Demo_Server\nYour Masternode Name is Demo_Server\n
"},{"location":"xdcchain/developers/node_operators/masternode/#for-testnet","title":"For Testnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201ctestnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- testnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Your running network is testnet\nPlease enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\n
"},{"location":"xdcchain/developers/node_operators/masternode/#for-devnet","title":"For Devnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cdevnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- devnet\nYour running network is devnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Please enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\nGenerate new private key and wallet address.\nIf you have your own key, you can change after this and restart the node\nType 'Y' or 'y' to continue:\n
"},{"location":"xdcchain/developers/node_operators/masternode/#how-to-stake-xdc-on-a-masternodestandby-node","title":"How to Stake XDC on a Masternode/Standby node","text":""},{"location":"xdcchain/developers/node_operators/masternode/#prerequisites","title":"Prerequisites","text":"

To stake XDC and run a masternode, you will need the following:

Note: You do not need 10,000,000 XDC to run a node solely for RPC queries or accessing live data from the blockchain. This guide covers staking for masternode candidates.

"},{"location":"xdcchain/developers/node_operators/masternode/#step-by-step-process-to-stake-your-xdc-node","title":"Step-by-Step Process to Stake Your XDC Node","text":""},{"location":"xdcchain/developers/node_operators/masternode/#1-access-the-staking-platform","title":"1. Access the Staking Platform","text":""},{"location":"xdcchain/developers/node_operators/masternode/#2-log-in-to-your-wallet","title":"2. Log In to Your Wallet","text":""},{"location":"xdcchain/developers/node_operators/masternode/#3-become-a-masternode-candidate","title":"3. Become a Masternode Candidate","text":""},{"location":"xdcchain/developers/node_operators/masternode/#4-enter-your-coinbase-address","title":"4. Enter Your Coinbase Address","text":""},{"location":"xdcchain/developers/node_operators/masternode/#5-confirm-and-apply-for-staking","title":"5. Confirm and Apply for Staking","text":""},{"location":"xdcchain/developers/node_operators/masternode/#6-transaction-confirmation","title":"6. Transaction Confirmation","text":""},{"location":"xdcchain/developers/node_operators/masternode/#setup-xdc-masternodestandby-node-using-one-click-installer","title":"Setup XDC Masternode/Standby node using One-Click Installer","text":""},{"location":"xdcchain/developers/node_operators/masternode/#method-1-setup-xinfins-xdc-masternode-one-click-installer","title":"Method 1: Setup XinFin\u2019s XDC Masternode One-click Installer","text":"

To qualify for Masternode on XinFin Network, you need at least 10,000,000 XDC, for the long term.

Operating System:

"},{"location":"xdcchain/developers/node_operators/masternode/#step-1","title":"Step 1:","text":"

Download XDC One-Click Installer (to setup Masternode) for Windows, Linux, and Mac OS and Install on your local machine.

"},{"location":"xdcchain/developers/node_operators/masternode/#step-2","title":"Step 2:","text":"

Now Run the One Click Installer, Make sure you read the Terms properly then click on I Agree button.

Step 3: Create a wallet for Masternode

Step 4: Host your Masternode

"},{"location":"xdcchain/developers/node_operators/masternode/#setup-xdc-masternodestandby-node-using-docker","title":"Setup XDC Masternode/Standby node using Docker","text":""},{"location":"xdcchain/developers/node_operators/masternode/#setting-up-xdc-network-masternode-docker-version","title":"Setting up XDC Network Masternode Docker version","text":"

The server or VPS used for the masternode should be directly facing the internet with a public IP and without NAT.

Operating System: Ubuntu 20.04 64-bit or higher

Should be facing internet directly with public IP & without NAT

Tools: Docker, Docker Compose(1.27.4+)

Setup (For Ubuntu 20.04 64-bit or higher Operating System)

Follow the written steps starting from step 1, or you can watch the video tutorials:

"},{"location":"xdcchain/developers/node_operators/masternode/#step-1-clone-repository","title":"Step 1: Clone repository","text":"
git clone https://github.com/XinFinOrg/XinFin-Node.git\n
"},{"location":"xdcchain/developers/node_operators/masternode/#step-2-change-directory","title":"Step 2: Change directory","text":"

Then we change the directory to XinFin-Node

cd XinFin-Node\n
"},{"location":"xdcchain/developers/node_operators/masternode/#step-3-install-docker","title":"Step 3: Install docker","text":"

We need to install Docker and Docker-Compose by running the following command:

sudo ./setup/install_docker.sh\n
"},{"location":"xdcchain/developers/node_operators/masternode/#step-4","title":"Step 4:","text":"

Create a new .env file and copy the env.example file that exist in the mainnet directory. We will ensure we are in the \u201cmainnet\u201d directory by typing these commands. Once in edit mode for the .env file, name your masternode and use an email address in the respective fields

cd mainnet\ncp env.example .env\nnano .env \n
For Testnet
cd testnet\ncp env.example .env\nnano .env\n
"},{"location":"xdcchain/developers/node_operators/masternode/#step-5-start-your-node","title":"Step 5: Start your Node","text":"

For Mainnet run the following commands:

cd mainnet\nsudo docker-compose -f docker-compose.yml up -d\n
At this point you should be able to see your masternode on the list of nodes here or as shown below:

For Testnet run the following commands:

cd testnet\nsudo docker-compose -f docker-compose.yml up -d\n
You should be able to see your node listed on the [Apothem Network] page. Select \u201cSwitch to LiveNet\u201d to check LiveNetwork Stats and Select \u201cSwitch to TestNet\u201d for TestNetwork.

Your coinbase address can be found in xdcchain/coinbase.txt file.

For troubleshooting purposes, you can stop the node by using the following command on either Mainnet or Testnet:

sudo docker-compose -f docker-compose.yml down\n
"},{"location":"xdcchain/developers/node_operators/masternode/#downloading-a-network-snapshot-mainnet-or-apothem","title":"Downloading a Network Snapshot (Mainnet or Apothem)","text":"

The following steps are to expedite the syncing process of your node with the XDC Network. If you followed the steps above, your node will take 3-4 days to sync up with the network fully. You can reduce that time by downloading a network snapshot and bringing your node back up after the chain has been downloaded and unpacked.

"},{"location":"xdcchain/developers/node_operators/masternode/#mainnet-snapshot","title":"Mainnet Snapshot","text":"

Bring down your node:

sudo docker-compose -f docker-compose.yml down\n
Remove the old xdchain file from the server
rm -rf xdcchain.tar\n
Download the snapshot
wget https://download.xinfin.network/xdcchain.tar\n
Unpack the xdcchain.tar file
tar -xvzf xdcchain.tar\n
The unpacking will take some time, and it will look like this:

img

The following command will move the xdcchain/XDC to xdcchain/XDC_backup

mv  xdcchain/XDC xdcchain/XDC_backup\nmv XDC xdcchain\n

Then we are going to remove the old \u201cnodekey\u201d file

rm -rf xdcchain/XDC/nodekey\n

The last step is to run the bash upgrade.sh command

bash upgrade.sh\n

This command will bring your node up and it will start syncing to the network. Once up and running, your node will be synced to the network in just a few minutes.

"},{"location":"xdcchain/developers/node_operators/masternode/#apothem-snapshot","title":"Apothem Snapshot","text":"

Bring down your node:

sudo docker-compose -f docker-compose.yml down\n

Remove the old xdchain file from the server

rm -rf apothem.tar\n

Download the snapshot

wget https://download.apothem.network/apothem.tar\n

Unpack the apothem.tar file

tar -xvzf apothem.tar\n

Move the xdcchain-testnet

mv XDC xdcchain-testnet\n

Bring up the node

sudo docker-compose -f docker-compose.yml up -d\n
"},{"location":"xdcchain/developers/node_operators/node_architecture/","title":"XDC Node Architecture","text":""},{"location":"xdcchain/developers/node_operators/node_architecture/#xdc-node-architecture","title":"XDC Node Architecture","text":"

The XDC Network is a hybrid blockchain platform designed to support both public and private states, offering enterprises the ability to conduct secure, scalable, and fast transactions. At the core of this network is its node architecture, which plays a crucial role in maintaining the network\u2019s integrity, security, and efficiency. This document provides a comprehensive overview of the XDC Node Architecture, detailing the various components and their functions.

The XDC Network operates on a Delegated Proof of Stake (XDPoS) consensus mechanism, which ensures low energy consumption and high transaction throughput. The network is EVM-compatible, allowing it to support smart contracts and decentralized applications (dApps).

"},{"location":"xdcchain/developers/node_operators/node_architecture/#node-types-in-xdc-network","title":"Node Types in XDC Network","text":"

The XDC Network comprises several types of nodes, each serving a unique function within the ecosystem. These nodes are essential for network operations, including transaction validation, block creation, and consensus.

Masternodes (Validator Nodes):

"},{"location":"xdcchain/developers/node_operators/node_architecture/#full-nodes","title":"Full Nodes:","text":""},{"location":"xdcchain/developers/node_operators/node_architecture/#node-communication-and-network-topology","title":"Node Communication and Network Topology","text":"

The XDC Network employs a peer-to-peer (P2P) communication model where nodes interact directly with each other to share information and propagate transactions.

"},{"location":"xdcchain/developers/node_operators/one-click-installer/","title":"Run XDC Nodes using One-Click Installer","text":""},{"location":"xdcchain/developers/node_operators/one-click-installer/#setup-xdc-masternode-using-one-click-installer","title":"Setup XDC Masternode using One-Click Installer","text":""},{"location":"xdcchain/developers/node_operators/one-click-installer/#method-1-setup-xinfins-xdc-masternode-one-click-installer","title":"Method 1: Setup XinFin\u2019s XDC Masternode One-click Installer","text":"

To qualify for Masternode on XinFin Network, you need at least 10,000,000 XDC, for the long term.

Operating System:

"},{"location":"xdcchain/developers/node_operators/one-click-installer/#step-1","title":"Step 1:","text":"

Download XDC One-Click Installer (to setup Masternode) for Windows, Linux, and Mac OS and Install on your local machine.

"},{"location":"xdcchain/developers/node_operators/one-click-installer/#step-2","title":"Step 2:","text":"

Now Run the One Click Installer, Make sure you read the Terms properly then click on I Agree button.

Step 3: Create a wallet for Masternode

Step 4: Host your Masternode

"},{"location":"xdcchain/developers/node_operators/slashing/","title":"XDC Network - Slashing Mechanism","text":""},{"location":"xdcchain/developers/node_operators/slashing/#xdc-network-slashing-mechanism","title":"XDC Network - Slashing Mechanism","text":"

The XDC Network, utilizing the XDPoS (Delegated Proof of Stake) consensus mechanism, ensures that its validators, known as masternodes, maintain optimal performance to keep the network stable and secure. One of the key features designed to ensure this reliability is the slashing mechanism, which acts as a corrective measure for underperforming masternodes.

"},{"location":"xdcchain/developers/node_operators/slashing/#objective-of-the-slashing-mechanism","title":"Objective of the Slashing Mechanism","text":"

The primary goal of the slashing mechanism is not to penalize or blame masternodes but to maintain a stable and high-performing network. It serves to mitigate issues arising from underperforming masternodes by holding them accountable while ensuring the overall system remains efficient.

"},{"location":"xdcchain/developers/node_operators/slashing/#how-the-xdc-network-slashing-mechanism-works","title":"How the XDC Network Slashing Mechanism Works","text":"

The slashing mechanism operates with a clear set of rules to manage masternode performance:

"},{"location":"xdcchain/developers/node_operators/slashing/#1-non-participation-in-block-signing","title":"1. Non-Participation in Block Signing:","text":""},{"location":"xdcchain/developers/node_operators/slashing/#2-handling-multiple-underperforming-masternodes","title":"2. Handling Multiple Underperforming Masternodes:","text":""},{"location":"xdcchain/developers/node_operators/slashing/#3-role-after-being-slashed","title":"3. Role After Being Slashed:","text":""},{"location":"xdcchain/developers/node_operators/slashing/#properties-of-the-xdc-network-slashing-mechanism","title":"Properties of the XDC Network Slashing Mechanism**","text":""},{"location":"xdcchain/developers/node_operators/slashing/#1-accountability","title":"1. Accountability:","text":""},{"location":"xdcchain/developers/node_operators/slashing/#2-liveness","title":"2. Liveness:","text":""},{"location":"xdcchain/developers/node_operators/slashing/#comparison-to-other-slashing-mechanisms","title":"Comparison to Other Slashing Mechanisms","text":"

The concept of slashing is not unique to the XDC Network and has been implemented in various other blockchain networks, such as Ethereum\u2019s Casper FFG (Friendly Finality Gadget). Casper\u2019s slashing mechanism is designed to prevent the \u201cnothing-at-stake\u201d problem, where validators can choose to support multiple forks of the blockchain. In Casper, if a validator is found to have validated conflicting forks, they are severely penalized by losing a significant portion, or even all, of their staked tokens.

Unlike Casper\u2019s more punitive approach aimed at preventing malicious behavior, the XDC Network\u2019s slashing mechanism is designed to handle unintentional underperformance. Rather than harshly punishing validators for outages or system failures, XDC\u2019s system focuses on ensuring network performance without creating fear of excessive penalties. The design philosophy behind XDC\u2019s slashing mechanism is to avoid deterring participation by maintaining a fair yet firm system.

"},{"location":"xdcchain/developers/node_operators/slashing/#benefits-of-the-xdc-slashing-mechanism","title":"Benefits of the XDC Slashing Mechanism","text":""},{"location":"xdcchain/developers/node_operators/validator_node/","title":"Validator/Standby Node","text":""},{"location":"xdcchain/developers/node_operators/validator_node/#validator-masternode","title":"Validator Masternode","text":"

Validator Masternodes operate and participate in XDC Network\u2019s DPoS consensus engine, validating transactions and block creation.

"},{"location":"xdcchain/developers/node_operators/validator_node/#standby-masternodes","title":"Standby Masternodes","text":"

Standby Masternodes (or \u201cStandby Nodes\u201d) are identical in form and function to Validators but do not participate in validating transactions and block creation. These nodes are on standby to fill the role of Validators that drop from network participation.

"},{"location":"xdcchain/developers/node_operators/validator_node/#setup-xdc-validatorstandby-node-using-bootstrap-script","title":"Setup XDC Validator/Standby Node using Bootstrap Script","text":""},{"location":"xdcchain/developers/node_operators/validator_node/#for-mainnet","title":"For Mainnet","text":"

Bootstrap Command XDC Validator/Standby Node Setup:

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n

Examples: After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cmainnet\u201d.

$ sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\n[sudo] password for user:\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- mainnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201cDemo_Server.\u201d
Your running network is mainnet\nPlease enter your XinFin MasterNode Name :- Demo_Server\nYour Masternode Name is Demo_Server\n
"},{"location":"xdcchain/developers/node_operators/validator_node/#for-testnet","title":"For Testnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201ctestnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- testnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Your running network is testnet\nPlease enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\n
"},{"location":"xdcchain/developers/node_operators/validator_node/#for-devnet","title":"For Devnet","text":"

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter \u201cdevnet\u201d.

sudo su -c \"bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)\" root\nPlease enter your XinFin Network (mainnet/testnet/devnet) :- devnet\nYour running network is devnet\n
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as \u201ctest01\u201d
Please enter your XinFin MasterNode Name :- test01\nYour Masternode Name is test01\nGenerate new private key and wallet address.\nIf you have your own key, you can change after this and restart the node\nType 'Y' or 'y' to continue:\n
"},{"location":"xdcchain/developers/node_operators/validator_node/#setup-xdc-masternode-using-one-click-installer","title":"Setup XDC Masternode using One-Click Installer","text":"

To Setup XDC Masternode using One-Click Installer, refer

"},{"location":"xdcchain/governance/overview/","title":"Overview - XDCDAO","text":""},{"location":"xdcchain/governance/overview/#xdc-governance-overview","title":"XDC Governance Overview","text":"

The DAO Treasury within the XDCDAO framework plays a critical role in the XDC Network\u2019s decentralized governance system. It is meticulously designed to manage the community\u2019s collective resources efficiently, securely, and transparently. This section provides a structured overview of the DAO Treasury, highlighting its purpose, operation, funding sources, and significance within the DAOFIN ecosystem.

"},{"location":"xdcchain/governance/overview/#purpose-of-the-dao-treasury","title":"Purpose of the DAO Treasury","text":"

The DAO Treasury\u2019s primary objective is to support the sustainable growth and development of the XDC Network by financing projects and initiatives that align with the community\u2019s goals. It acts as the financial hub for:

"}]} \ No newline at end of file diff --git a/subnet/install_guide/launch_subnet/index.html b/subnet/install_guide/launch_subnet/index.html index 7c20206..b5469b0 100644 --- a/subnet/install_guide/launch_subnet/index.html +++ b/subnet/install_guide/launch_subnet/index.html @@ -1248,6 +1248,7 @@

Generate Subnet Configs With UIIf you are running this on a remote server.

first use ssh tunnel: ssh -N -L localhost:5210:localhost:5210 USERNAME@IP_ADDRESS -i SERVER_KEY_FILE + **if you're using VSCode to SSH, the port might be forwarded to your machine automatically (no need for above step)