Skip to content

flare-foundation/developer-hub

Repository files navigation

Flare Developer Hub

The decentralized origin for Flare builders ☀️.

This site is built with Docusaurus, a modern static site generator.

🚀 Getting Started

Prerequisites

Ensure the following tools are installed:

Installation

  1. Clone the repository:

    git clone https://github.com/flare-foundation/developer-hub.git
    cd developer-hub
  2. Install dependencies:

    npm install
  3. Start the local development server:

    npm run start

    This launches the development server and automatically opens your default browser. Live reloading ensures changes appear instantly.

🧑‍💻 Code Examples

Browse commonly used snippets in developer-hub/examples/.

Supported languages:

  • Python
  • JavaScript
  • Rust
  • Go

🛠️ Development Guidelines

Documentation Formatting

Ensure consistent formatting using Prettier:

npm run format

Note: Prettier support for MDXv3 is evolving (tracking issue). If needed, bypass Prettier by using:

{/* prettier-ignore */}

Code Formatting

All code examples in examples/ follow language-specific formatters.

🏗️ Building for Production

To create a production-ready build:

npm run build

The static files are generated in the build directory. To serve the production build locally:

npm run serve

Tip: Test search functionality using a production build.

📄 Autogenerate Solidity Documentation

To generate Solidity documentation:

  1. Switch to Node.js v18:

    nvm use 18
  2. Run the Documentation Generator:

    cd docgen
    chmod +x generate-solidity-docs.sh
    ./generate-solidity-docs.sh

    This pulls the latest smart contracts and generates docs.

  3. Switch Back to Node.js v20:

    nvm use 20

🔄 Automations

Ensure uv dependencies are synced:

cd automations
uv sync

Automated Tasks

  1. Update Feed IDs:

    Generate and save feed IDs in anchor_feeds.json and block_latency_feeds.json:

    uv run feed_table_generator.py
  2. Update Contract Addresses:

    Fetch and save contract addresses in solidity_reference.json:

    uv run solidity_reference_table_generator.py
  3. Run All Automations:

    Execute all tasks at once:

    npm run automations

🤝 Contributing

Contributions are welcome! Before your first PR, read the CONTRIBUTING.md.