Skip to content

Quickstart Guide

cfxdevkit edited this page Dec 19, 2024 · 1 revision

Welcome to the core-hardhat-template quickstart guide! This template provides the hardhat configurations needed to deploy on Conflux Core blockchain. Follow the steps below to get started quickly.

Repository URL: https://github.com/cfxdevkit/core-hardhat-template


Prerequisites

Before using the template locally, ensure you have the following installed on your system:

  1. Git: For cloning and managing the repository.
  2. VS Code: For local development.
  3. Docker: Required to run the preconfigured development environment locally.

Note: Using the template in Codespace don't require any prerequisites


Using the Template Repository

This repository is a GitHub template, meaning you can easily create a new project based on it. Here's how:

Step 1: Use the Template

  1. Navigate to the template repository: https://github.com/cfxdevkit/core-hardhat-template.
  2. Click the green Use this template button in the top-right corner of the page, next to the Watch, Fork, and Star buttons.

Step 2: Choose an Option

When you click Use this template, you'll see two options:

1. Create a New Repository

  • Select this option to create a new repository in your GitHub account based on this template.
  • Provide a name for your new repository and click Create repository from template.
  • Once created, you can clone the repository or open it directly in VS Code or Codespaces.

2. Open in Codespace

  • Select this option to immediately open the repository in GitHub Codespaces.
  • A new Codespace will be created in your account with the preconfigured development environment ready to use.

Cloning Locally and Using VS Code

If you prefer to work locally, follow these steps after creating a repository using the template:

  1. Clone Your Repository
    Open a terminal and run the following command to clone your new repository:

    git clone https://github.com/your-username/your-repository-name.git
  2. Open in VS Code
    Navigate to the repository directory:

    cd your-repository-name

    Then, open the repository in VS Code:

    code .
  3. Rebuild the Devcontainer (Optional)
    If you have the Remote - Containers extension installed in VS Code, you can use the included devcontainer configuration:

    • Click Reopen in Container when prompted.
    • Wait for the environment to build and start.

Dependency Installation

Once your environment is set up (either locally or in a Codespace), install the required dependencies by running the following command:

npm install

After the installation is complete, you can use the hh command to access Hardhat functionalities with ease, including tab autocompletion for faster workflow.

You're now ready to start developing and deploying smart contracts on Conflux Core!


Next Steps

You are now ready to start creating your contracts with Hardhat!

Visit the Hardhat Guide for a quick introduction to Hardhat and a step-by-step guide to deploying your first contract.


Enjoy creating your project with the core-hardhat-template!