Setting up a Node project
Setting up a Node project for smart-contracts
Last updated
Was this helpful?
Setting up a Node project for smart-contracts
Last updated
Was this helpful?
To start a new project, create a directory for it:
Then we will initialize our node project inside the newly created folder:
This will create a package.json
file, which will evolve as your project grows, such as when installing dependencies with npm install
There are two broads type of packages stored in the npm registry: libraries and executables. Installed libraries are used like any other piece of JavaScript code, but executables are special.
A third binary was included when installing node: . This is used to run executables installed locally in your project.
For our local blockchain development, we will need to install certain packages/libraries so that we can create a local blockchain network within our local systems. For this we can either Truffle or Hardhat.
In this guide, we will be going with using Hardhat.
Before you get coding, you should add to your project to track changes.
By far, the most used tool is , often in conjunction with for hosting purposes. Indeed, you will find the full source code and history of all OpenZeppelin software in our .
Don’t commit secrets such as mnemonics, private keys and API keys to version control! Make sure you files with secrets.