Giter Site home page Giter Site logo

hardhat-reef-template's Introduction

Hardhat-reef-template

Hardhat-reef-template is used to create a new Hardhat project for the Reef-chain. It includes all the essentials dependencies used to develop Reef contracts.

Installing

Clone template and configure the new project name.

git clone [email protected]:reef-defi/hardhat-reef-template.git project-name

Install all dependencies with yarn.

You are good to go!

Running

Write scripts under the scripts directory and run them using the following run template...

yarn hardhat run scripts/{script-name}.js

The default Greeter contract script can be run using the following command...

yarn hardhat run scripts/sample-script.js

Configure

Define your Reef chain URL in hardhat.config.js (by default ws://127.0.0.1:9944):

Hardhat-reef uses the default network reef. If the user wants to run the script on the other network, he can do so in CLI with --network {network-name} flag.

Example:

yarn hardhat run scripts/sample-script.js --network hardhat

Users can define the network configuration in hardhat.config.js. He can switch the defaultNetwork to the desired one.

Configuring the Reef network, the user can edit its URL. If the URL exists (can be pinged), the system will automatically connect to it, else it will run internal Reef-Node and try to connect to it.

The default configuration has reef defined as the default network, and its URL is set to: ws://127.0.0.1:9944.

module.exports = {
	solidity: "0.7.3",
  defaultNetwork: "reef" // just an example of picking the desired network. This line is not needed!
};

Users can modify their values by replacing the existing ones like so...

module.exports = {
	solidity: "0.7.3",
  networks: {
		reef: {
			url: "ws://127.0.0.1:9944",
		}
	},
};

Connect to the reef-testnet...

module.exports = {
	solidity: "0.7.3",
  networks: {
		reef: {
			url: "wss://rpc-testnet.reefscan.com/ws",
		}
	},
};

hardhat-reef-template's People

Contributors

frenkiee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.