Proof of Work (v1)
Overview
This document explains the Proof of Work (PoW) implementation for the Lysa Testnet (v1). It is intended for developers and stakeholders who wish to participate in the network by running nodes, mining, or interacting with the blockchain using GSMC as the native gas token.
1. Introduction
The Lysa Testnet (v1) is built on a modified version of the Go-Ethereum (Geth) client, supporting a PoW consensus mechanism. This testnet enables decentralized applications and asset tokenization within the Go! SmartChain AI ecosystem while allowing stakeholders to validate transactions and secure the network.
Key Features
Custom blockchain with GSMC as the gas fee currency.
Proof of Work mining for network security and block validation.
Open participation for developers and stakeholders.
Externally accessible RPC nodes for interaction with the network.
2. Network Setup
2.1. Node Deployment on GCP VM
Stakeholders can deploy a node on a GCP VM by following these steps:
Provision of a GCP VM
Clone and Build the Custom Geth Client
Update the repository URL and check out the specific branch:
Initialize the Blockchain
Ensure the genesis.json is properly configured:
If the genesis.json file does not exist, create it in the directory with the following content:
Start Local the Node
To start the local Geth node and connect to the network, follow these steps:
1. Start the Local Node
Run the following command to start the local node:
2. Attach to the Geth Node
Once the node is running, attach to it using the following command:
3. Add the Remote Node as a Peer
To join the network and establish communication with the remote node, run:
4. Check Connected Peers
To verify that the peer was successfully added, run:
You should see details of the connected peer.
5. Check the Current Block Number
To verify the current block number synced by your local node:
This confirms that the node is actively syncing and participating in the network.
Options for Executing Geth
Option 1: Use the Full Path in Commands
Option 2: Run the Command from the Build Directory
Option 3: Copy the Binary to an Accessible Location
3. Mining GSMC on Lysa Testnet
3.1. Mining Setup
Developers and stakeholders can mine GSMC to validate transactions and secure the network.
Start Mining
To start mining on the Lysa Testnet, use the command below. Make sure to replace YOUR_WALLET_ADDRESS
with your actual Ethereum wallet address where you will receive mining rewards.
Check Mining Status
To check if your node is mining successfully, you can attach to your Geth node using the following command and check the mining status:
Then run:
This will return true if your node is mining.
3.2. Rewards and Gas Fees
Block Reward: Miners receive GSMC tokens as a reward for each successfully mined block.
Transaction Fees: Transactions on the network require GSMC as gas. The fees are paid to miners as a reward for processing transactions and securing the network.
Difficulty Adjustment: The mining difficulty is adjusted dynamically based on the total network hash rate to ensure that block times remain consistent.
4. Interacting with the Network
4.1. Connecting to the Network
Developers can interact with the Lysa Testnet using the ethers.js library as detailed below. This setup assumes that the necessary environment variables have been defined in a .env file.
Example of ethers.js Script for Transactions
4.2. Deploying Smart Contracts
Smart contracts can be deployed using tools like Hardhat or Truffle.
Example Deployment with Hardhat
Sending Transactions via Web3.js
5. Monitoring & Performance Metrics
Transaction Throughput (TPS): Measures the number of transactions the network can handle per second.
Block Finality Time: Tracks the time it takes for a block to be considered final.
Validator Uptime: Monitors the uptime and performance of network validators.
6. Next Steps & Mainnet Readiness
As the testnet stabilizes and matures, preparations will be made for a transition to the mainnet. This includes:
Security Enhancements: Implementing additional security measures and audits.
Staking Mechanisms: Introducing staking for network validators.
Community Participation: Increasing community involvement in network governance and decision-making.
Feedback & Improvement
We encourage stakeholders to report any issues and suggest improvements through GitHub or community forums to help enhance the network's robustness and functionality.
Last updated