Skip to content

Latest commit

 

History

History
209 lines (162 loc) · 4.65 KB

File metadata and controls

209 lines (162 loc) · 4.65 KB

Contributing to Validator Costs Calculator

Thank you for your interest in contributing to the Ethereum Validator Cost Calculator! This guide will help you get started.

Getting Started

Prerequisites

  • Node.js 18+ or Node.js 20+
  • npm or yarn
  • Git

Setup

  1. Fork the repository
  2. Clone your fork:
git clone https://github.com/YOUR_USERNAME/validatorcosts.git
cd validatorcosts
  1. Install dependencies:
npm install
  1. Start development server:
npm run develop
  1. Open http://localhost:8000

Development Workflow

Making Changes

  1. Create a new branch:
git checkout -b feature/your-feature-name
  1. Make your changes
  2. Test your changes:
npm run type-check  # TypeScript validation
npm run build       # Production build test
  1. Commit with clear messages:
git commit -m "Add feature: description of changes"

Code Style

  • TypeScript: Strict mode enabled, use proper types
  • React: Functional components with hooks
  • Tailwind: Use utility classes, follow existing patterns
  • Formatting: Consistent with existing code style

Project Structure

src/
├── components/     # Reusable React components
├── pages/          # Gatsby pages
├── services/       # Business logic and API calls
├── types/          # TypeScript type definitions
└── styles/         # Global styles (Tailwind)

Areas for Contribution

High Priority

  • Additional staking platforms
  • More accurate cost models
  • Performance optimizations
  • Mobile UX improvements

Medium Priority

  • Internationalization (i18n)
  • Historical data visualization
  • Export features (PDF, CSV)
  • Accessibility improvements

Enhancement Ideas

  • Multi-validator calculator
  • MEV-Boost revenue estimation
  • Geographic cost database
  • Cloud hosting cost comparison
  • Slashing risk calculator

Pull Request Process

  1. Update README.md if you change functionality
  2. Add your changes to CHANGELOG.md (if exists)
  3. Ensure all tests pass
  4. Update documentation as needed
  5. Submit PR with clear description

PR Guidelines

  • Title: Clear, concise description
  • Description: What, why, and how
  • Screenshots: For UI changes
  • Testing: Describe how you tested
  • Breaking Changes: Clearly marked

Adding Staking Platforms

To add a new platform, edit src/services/calculatorService.ts:

export function getStakingPlatforms(): StakingPlatform[] {
  return [
    // ... existing platforms
    {
      name: 'Platform Name',
      feePercentage: 5,           // Platform fee percentage
      minimumStake: 0.01,         // Minimum stake in ETH
      hasLiquidityToken: true,    // Whether they offer LST
      liquidityTokenName: 'pETH', // LST token name
      description: 'Platform description for users',
    },
  ];
}

Updating Default Values

Edit src/pages/index.tsx:

const [soloParams, setSoloParams] = useState<SoloValidatorParams>({
  hardwareCost: 1500,
  internetCost: 10,
  setupTime: 4,
  maintenanceHours: 1,
  // ... other params
});

Testing

Manual Testing Checklist

  • Calculator loads and displays data
  • Real-time API calls work
  • All input fields update correctly
  • Results recalculate properly
  • Dark/light mode works
  • Responsive on mobile
  • No console errors
  • Build completes successfully

Browser Testing

Test in:

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Mobile browsers

Bug Reports

When filing a bug report, include:

  1. Description: Clear description of the issue
  2. Steps to Reproduce: Numbered steps
  3. Expected Behavior: What should happen
  4. Actual Behavior: What actually happens
  5. Screenshots: If applicable
  6. Environment:
    • Browser & version
    • OS
    • Device (if mobile)

Feature Requests

Include:

  1. Use Case: Why is this needed?
  2. Proposed Solution: How should it work?
  3. Alternatives: Other approaches considered
  4. Additional Context: Any other relevant info

Code of Conduct

Our Standards

  • Be respectful and inclusive
  • Accept constructive criticism
  • Focus on what's best for the community
  • Show empathy towards others

Unacceptable Behavior

  • Harassment or discriminatory language
  • Trolling or insulting comments
  • Personal or political attacks
  • Publishing others' private information

Questions?

  • Open an issue for discussion
  • Join the EthStaker community
  • Check existing issues and PRs first

License

By contributing, you agree that your contributions will be licensed under the MIT License.


Thank you for contributing to the Ethereum community! 🚀