The decentralized origin for Flare builders ☀️.
This website is built using Docusaurus, a modern static site generator.
developer-hub/examples contains commonly used code snippets for Python, Javascript, Rust and Go.
Ensure you have the following tools installed:
- Node.js v20
- nvm for managing multiple Node.js versions
Once you have Node.js v20 installed, you can set up the project dependencies:
npm install
To start the local development server:
npm run start
This command will launch a development server and automatically open your default browser. Most changes you make in the project will be reflected live, without the need to restart the server.
To ensure consistency across the project, you should format all docs using Prettier:
npm run format
Important: Prettier support for MDXv3 is still a work in progress (see this issue). If necessary, you can manually exclude sections from Prettier by adding {/* prettier-ignore */}
in your code.
All developer-hub/examples code snippets use language-specific formatting tools.
To create a production build of the Flare Developer Hub:
npm run build
This will generate static content and place it in the build
directory.
Note: The search functionality will only work with a production build, so make sure to test it using a production environment.
To generate the Solidity contract documentation from the flare-smart-contracts-v2
repository:
-
Switch Node.js Version:
Theflare-smart-contracts-v2
project requires Node.js v18, while thedeveloper-hub
requires Node.js v20. Usenvm
to switch between versions:nvm use 18
-
Run the Documentation Generation Script:
Navigate to thedocgen
folder, make the script executable, and run it:cd docgen chmod +x generate-solidity-docs.sh ./generate-solidity-docs.sh
This will pull the latest smart contracts and generate the documentation.
-
Switch Back to Node.js v20:
After generating the Solidity documentation, switch back to Node.js v20 fordeveloper-hub
:nvm use 20
Contributions to Flare Developer Hub are welcome. Read CONTRIBUTING.md before making your first PR.