How to Get Started with Substrate Recipes

Apr 19, 2022 | Blockchain

If you’re keen on building your own blockchain and want a practical guide, then Substrate Recipes is your perfect cookbook! This guide not only provides foundational knowledge but also practical examples that let you roll up your sleeves and start cooking. Let’s dive into how to get started!

Get Started

Ready to roll up your sleeves and cook some blockchain? Follow along as we explore the repository structure and how to build the Substrate Recipes book locally.

Repository Structure

The Substrate Recipes repository is organized into five primary directories, each serving a unique purpose:

  • Text: The source of the book, written in markdown, which describes the code in the other directories.
  • Pallets: Reusable modules (pallets) for use in FRAME-based runtimes.
  • Runtimes: Specific runtimes for Substrate nodes.
  • Consensus: Various consensus engines used by Substrate nodes.
  • Nodes: Complete Substrate nodes, ready to run.

Building This Book Locally

If you want to build the book on your own machine, you will need mdBook, ideally the same version used in the Rust language. Follow these steps to get started:

  • Install mdBook:
  • bash
    $ cargo install mdbook --vers [version-num]
    
  • Build the book:
  • bash
    $ mdbook build
    
  • You can find the output in the book subdirectory.
  • To view the book in your web browser:
  • bash
    $ mdbook serve
    

    The default address to view the book will be located at http://localhost:3000.

How the Code Works: An Analogy

Think of building a Substrate-based blockchain like preparing a gourmet meal. Each directory in the repository is like an ingredient in your recipe:

  • Text: The cookbook that informs you about the dish you’re preparing.
  • Pallets: Specialized ingredients like spices that you can use to enhance the flavors (features) of your dish (blockchain).
  • Runtimes: The main food item that brings everything together – without it, there’s nothing to serve!
  • Consensus: The cooking technique that defines how your dish should be prepared, ensuring that all ingredients harmonize well together.
  • Nodes: The final dish ready to be served, a complete meal for your guests (users).

Troubleshooting Ideas

If you encounter issues while building or serving the book, here are some troubleshooting ideas:

  • Ensure you have the correct version of mdBook installed.
  • Check that you have all the dependencies for Rust installed correctly.
  • Make sure you’re running the server on the correct localhost port (3000).
  • If you’re unsure about any commands, feel free to check their documentation or community forums.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Using Recipes in External Projects

The pallets and runtimes provided in this repository are tested and ready to be used in other Substrate-based blockchains. Just remember, consistency is key: you must use the same upstream Substrate version throughout your project.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox