Skip to content

Commit

Permalink
Merge pull request #9 from XinFinOrg/subnet-update
Browse files Browse the repository at this point in the history
reorganize subnet docs
  • Loading branch information
AnilChinchawale authored Jan 30, 2025
2 parents d77e7a0 + b62da13 commit 1583992
Show file tree
Hide file tree
Showing 17 changed files with 218 additions and 139 deletions.
2 changes: 1 addition & 1 deletion docs/subnet/components/api_library.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Upgrading the Subnet
title: API
---
# API Library
This section specifies the API library we develop for the subnet users to confirm subnet transactions.
Expand Down
2 changes: 1 addition & 1 deletion docs/subnet/components/checkpoint_contract.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Upgrading the Subnet
title: CSC
---
# Checkpoint Smart Contract

Expand Down
2 changes: 1 addition & 1 deletion docs/subnet/components/relayer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Upgrading the Subnet
title: Relayer
---
# Relayer

Expand Down
5 changes: 5 additions & 0 deletions docs/subnet/components/repos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Repos
---

## Subnet Repositories
3 changes: 1 addition & 2 deletions docs/subnet/components/subnet_chain.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Upgrading the Subnet
# TODO: title
title: XDC Subnet
---

# Subnet Chain
Expand Down
2 changes: 1 addition & 1 deletion docs/subnet/components/subswap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Upgrading the Subnet
title: Subswap
---
# Subswap

Expand Down
2 changes: 1 addition & 1 deletion docs/subnet/components/xdc_zero.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Upgrading the Subnet
title: XDC Zero
---
# XDCZero

Expand Down
9 changes: 9 additions & 0 deletions docs/subnet/contact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Contact
---

## Contact Us
For feedback, bug report, request, or general Subnet discussion please feel free to make a post on [XDC Forum](https://forum.xinfin.org/) or [GitHub Issues](https://github.com/XinFinOrg/XDC-Subnet/issues)


For troubleshooting, you can talk to us at [Telegram Support Group](./deployment/3_troubleshooting.md#telegram-troubleshooting-support-group) and we will check as soon as possible.
52 changes: 52 additions & 0 deletions docs/subnet/install_guide/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Changelog
---

# Subnet Deployment Generator Changelog

### v1.0.0 - 2024/10/03
- Added Configuration Generator UI
- Added XDC-Zero configuration generation
- Added Faucet and Faucet Server
- Added helper scripts
- Changed default ports of components to prevent clashing
- Stats Server - port 5213
- Frontend - port 5214
- Relayer - port 5215
- Faucet Server - port 5211
- Generator UI - port 5210
- Documentation update
- added Subnet setup video walkthrough
- added FAQ section
- added Contact section
- Minor bug fixes


### v0.3.2 - 2024/08/15
- Changed frontend default due to clashing from 5000 to 5555

### v0.3.1 - 2024/07/24
- Use testnet by default
- Remove admin api by default
- Added PUBLIC_IP optional config in deployment-generator
- Bump component versions

### v0.2.1 - 2024/01/09
- New generation style, pulls script from github to run multiple docker images instead of generating from single image.
- New Checkpoint Smart Contract (CSC) deployment image
- Supports upgradable CSC
- Bump components versions
- Fix bugs
- Code refactor, optimization
### v0.1.6
- Bump relayer version to support gas fee changes
### v0.1.5
- Added OS=mac option in 'docker.env'. This option is intended for single machine testing environment only.
### v0.1.4
- Added custom keys functionality
'docker.env' now accepts GRANDMASTER_PK and SUBNETS_PK. Where SUBNETS_PK can have multiple keys separated by a comma ','. Number of subnet keys must equal NUM_SUBNET. Keys are randomized if not provided.
- Added RELAYER_MODE in 'docker.env', CSC deployment will select from 'full' or 'lite' smart contract, default 'full'.
- Automate CHECKPOINT_CONTRACT copy-paste step (manual action no longer required).
- PARENTCHAIN_WALLET is no longer required in 'docker.env', the address will be derived from PARENTCHAIN_WALLET_PK.
- Disabled parentchain observer in docker-compose.yml, unused for now (due to long startup time).
- Bump default subnet components stable versions
38 changes: 38 additions & 0 deletions docs/subnet/install_guide/common_issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Common Issues
---
### Common Issues
- **Subnet blocks are not being mined**.

1. First confirm that the Subnet nodes are able to communicate with each other through the network layer. Run the check peer script `generated/scripts/check-peers.sh` the number of peers should be one less than number of subnet nodes. For example, if there are 3 Subnet nodes in total, each node should have 2 peers.

2. If the nodes are peering but still not mining, it could be a low memory issue. In Docker configs you can try to increase memory or swap. Then, in case of fresh Subnet, [delete data and start the nodes again](../install_guide/launch_subnet.md/#deleting-subnet). ![Docker Memory Config](../img/docker_mem.png)!

3. Docker engine in Mac OS can be inconsistent after long-running or high-load. It could help to restart the machine and [hard reset the subnet](../install_guide/launch_subnet.md/#deleting-subnet) to get it running.


- **Subnet node does not boot with error log `Fatal: Error starting protocol stack: listen unix /work/xdcchain/XDC.ipc: bind: invalid argument`**

This is due to the volume mount path being too long. The mounth path is your current directory (also can check with `pwd` command). Please move the `generated` folder to a shorter path and try again.


- **Docker image startup fails with `SIGKILL` or `Error code: 137` found in logs. (Issue found in Frontend image)**

This error occurs because Docker ran Out Of Memory (OOM). You can increase the memory limit in [Docker settings](https://docs.docker.com/desktop/settings/mac/#:~:text=lower%20the%20number.-,Memory,-.%20By%20default%2C%20Docker)



### Troubleshooting Scripts


- `generated/scripts/check-mining.sh`

This will check your current block in Subnet

- `generated/scripts/check-peers.sh`

This will check the number of peers of your Subnet node


### Telegram Troubleshooting Support Group
https://t.me/+jvkX6LaLEEthZWM1
3 changes: 1 addition & 2 deletions docs/subnet/install_guide/config_explanation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Upgrading the Subnet
# TODO: title
title: Configs Explanation
---

# Configs Explanation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,8 @@
---
title: Upgrading the Subnet
# TODO: title
title: FAQ
---

# Frequently Asked Questions
## Subnet Launch
### Common Issues
- **Subnet blocks are not being mined**.

1. First confirm that the Subnet nodes are able to communicate with each other through the network layer. Run the check peer script `generated/scripts/check-peers.sh` the number of peers should be one less than number of subnet nodes. For example, if there are 3 Subnet nodes in total, each node should have 2 peers.

2. If the nodes are peering but still not mining, it could be a low memory issue. In Docker configs you can try to increase memory or swap. Then, in case of fresh Subnet, [delete data and start the nodes again](../install_guide/launch_subnet.md/#deleting-subnet). ![Docker Memory Config](../img/docker_mem.png)!

3. Docker engine in Mac OS can be inconsistent after long-running or high-load. It could help to restart the machine and [hard reset the subnet](../install_guide/launch_subnet.md/#deleting-subnet) to get it running.


- **Subnet node does not boot with error log `Fatal: Error starting protocol stack: listen unix /work/xdcchain/XDC.ipc: bind: invalid argument`**

This is due to the volume mount path being too long. The mounth path is your current directory (also can check with `pwd` command). Please move the `generated` folder to a shorter path and try again.


- **Docker image startup fails with `SIGKILL` or `Error code: 137` found in logs. (Issue found in Frontend image)**

This error occurs because Docker ran Out Of Memory (OOM). You can increase the memory limit in [Docker settings](https://docs.docker.com/desktop/settings/mac/#:~:text=lower%20the%20number.-,Memory,-.%20By%20default%2C%20Docker)



### Troubleshooting Scripts


- `generated/scripts/check-mining.sh`

This will check your current block in Subnet

- `generated/scripts/check-peers.sh`

This will check the number of peers of your Subnet node



## Subnet Node Requirements

- **How many Subnet nodes should I have?**
Expand Down
5 changes: 2 additions & 3 deletions docs/subnet/install_guide/launch_subnet.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Upgrading the Subnet
# TODO: title
title: Launch a Subnet
---

# Launch a Subnet
Expand Down Expand Up @@ -29,7 +28,7 @@ title: Upgrading the Subnet

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
curl -O https://raw.githubusercontent.com/XinFinOrg/Subnet-Deployment/master/deployment-generator/scripts/generate.sh
```

2. Run the configuration generator, this will start a local webserver
Expand Down
7 changes: 7 additions & 0 deletions docs/subnet/using_subnet/explorer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Using Subnet
---

## Blockchain Explorer

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](https://github.com/web3labs/chainlens-free/tree/master/docker-compose) as one of the solution. Please follow the instructions as the previous link. You only need to pass one of the Subnet's 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`.
58 changes: 58 additions & 0 deletions docs/subnet/using_subnet/faucet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Using Subnet
---
## Faucet

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.

### One-time Transfer

Under `generated` directory run the Faucet script.

```
./scripts/faucet.sh
```

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.

![Example](../img/faucet.png)

### Faucet Server

Under `generated` directory run the Faucet server script.

```
./scripts/faucet-server.sh
```

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`

![Example](../img/faucet-server1.png)

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

![Example](../img/faucet-server2.png)

Submit and wait for confirmation.

![Example](../img/faucet-server3.png)

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

### Transfer Subnet Funds Without Faucet

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.


### Faucet Source Code

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

https://github.com/XinFinOrg/Subnet-Deployment/tree/master/deployment-generator/scripts

https://github.com/XinFinOrg/Subnet-Deployment/tree/master/deployment-generator/src/faucet.js

Loading

0 comments on commit 1583992

Please sign in to comment.