Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lu-jumba/decentralized_hosting_server
An ambitious implementation of a blockchain-based decentralized hosting server built with Substrate in Rust
https://github.com/lu-jumba/decentralized_hosting_server
blockchain blockchain-technology ipfs multichain reactjs rust substrate
Last synced: 7 days ago
JSON representation
An ambitious implementation of a blockchain-based decentralized hosting server built with Substrate in Rust
- Host: GitHub
- URL: https://github.com/lu-jumba/decentralized_hosting_server
- Owner: lu-jumba
- Created: 2024-10-21T14:31:53.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-10-21T15:31:34.000Z (2 months ago)
- Last Synced: 2024-12-14T12:28:22.705Z (14 days ago)
- Topics: blockchain, blockchain-technology, ipfs, multichain, reactjs, rust, substrate
- Language: Rust
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
Blockchain-Based Decentralized Hosting Server in Rust
Project Overview
This project is a blockchain-based decentralized hosting server built with Substrate in Rust, featuring decentralized application (dApp) hosting, role-based access control, staking and validator management, and cross-chain compatibility.
It integrates with IPFS for decentralized storage and provides a React-based dashboard for users to upload, manage, and interact with decentralized applications.Key Features
Substrate-Based Blockchain:
A modular and extensible blockchain framework built using Substrate.
dApp Hosting: Users can upload decentralized applications (dApps) that are stored on IPFS and approved by network admins before being made available for download.Role-Based Access Control (RBAC):
Admin, Validator, and User roles define the permissions and actions that network participants can perform.Staking Mechanism:
Users can become validators by staking tokens, participating in block validation, and earning rewards.
Cross-Chain Compatibility: Users can send messages and tokens between different blockchain networks, including Ethereum and Binance Smart Chain.React Dashboard:
A user-friendly frontend to interact with the blockchain, manage nodes, upload/download dApps, and handle cross-chain transfers.IPFS Integration:
Decentralized storage for hosting and downloading dApps.Project Structure
The project is divided into two main components:Substrate Node (Blockchain Backend):
Built using Rust and Substrate, this includes all the necessary pallets for handling the core blockchain logic, dApp management, and cross-chain communication.React Dashboard (Frontend):
A React-based frontend that interacts with the blockchain, allowing users to manage their dApps, monitor node health, and handle cross-chain transactions.Directory Structure
Prerequisites
Rust (for Substrate development)
Node.js (for React dashboard)
IPFS (for decentralized storage)
1. Substrate Node Setup
Install Rust and Substrate dependencies:
bash
curl https://sh.rustup.rs -sSf | sh
rustup default stable
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
Clone the repository and build the Substrate node:
bash
git clone https://github.com/yourusername/blockchain-hosting-server.git
cd blockchain-hosting-server/substrate-node/
cargo build --release
Run the Substrate node:
bash
./target/release/node-template --dev --tmp
2. IPFS Setup
Install IPFS:
bash
wget https://dist.ipfs.io/go-ipfs/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
tar -xvzf go-ipfs_v0.12.2_linux-amd64.tar.gz
cd go-ipfs
sudo bash install.sh
Start the IPFS daemon:
bash
ipfs init
ipfs daemon
3. React Dashboard Setup
Install Node.js dependencies:
bash
cd blockchain-hosting-server/react-dashboard/
npm install
Run the React dashboard:
bash
npm start
Key Functionalities
1. dApp Upload and Approval Process
Users upload dApps using the dashboard. Each dApp is stored on IPFS and submitted for approval by network admins.2. Admins review and approve or reject the dApp.
Approved dApps become available for download via the dashboard.3. Staking and Validator Management
Users can stake tokens to become validators and participate in the consensus mechanism (e.g., block validation).
Validators are rewarded for producing valid blocks.4. Cross-Chain Message Transfers
Users can send messages and tokens to other blockchains (e.g., Ethereum or Binance Smart Chain) using the Cross-Chain Bridge.
Cross-chain messages are routed through the pallet and recorded on the chain.Testing
Comprehensive tests for the Substrate runtime and React components, as well as integration tests for the full workflow.
1. Running Substrate Tests
From the substrate-node directory:
bash
cargo test
2. Running React Tests
From the react-dashboard directory:
bash
npm test
3. Running Integration Tests
From the substrate-node directory:
bash
cargo test --test integration_tests
Deployment
Deploying the Substrate Node
After testing, deploy the Substrate node using your preferred cloud provider (AWS, DigitalOcean, etc.). The node should be launched with public RPC and WebSocket endpoints.
Deploying the React Dashboard
Build the React application:
bash
npm run build
Deploy the build/ folder to a hosting service like Netlify, Vercel, or AWS S3.
Contributing
Contributions are welcome! Please follow these steps:
Fork the repository.
Create a new branch with your feature or bugfix.
Submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For any inquiries or issues, please contact the project maintainer at [email protected]