CryptoPages a decentralized web application (dApp) for buying and selling pre-owned books, built on the Ethereum blockchain. The platform connects book sellers and buyers directly, eliminating the need for intermediaries, while leveraging blockchain technology to provide secure, transparent, and tamper-proof transactions.
To run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/TVVinudev/CryptoPages.git
-
Navigate to the project directory:
cd CryptoPages -
open UI file and Install the dependencies:
npm install
-
To obtain the private key and secret key for IPFS, create an account in PINATA. Include the PRIVATE_KEY and SECRET_KEY veriables obtained from the PINATA in a.env file that you add to the project.
-
Run the file
npm run dev
To interact with the blockchain and deploy the smart contract, follow these steps:
-
Install Hardhat and the required dependencies:
cd Contract npm install -D hardhat @nomicfoundation/hardhat-toolbox -
Set up your environment variables by creating a
.envfile in the root of the project with the following content:API_KEY=your_sepolia_rpc_url PRIVATE_KEY=your_private_key
Replace
your_sepolia_rpc_urlwith your own Sepolia network URL (e.g., from Infura or Alchemy), andyour_private_keywith the private key of your Sepolia account. -
Here's the
hardhat.config.jsfile you'll be using:require("@nomicfoundation/hardhat-toolbox"); /** @type import('hardhat/config').HardhatUserConfig */ module.exports = { solidity: "0.8.28", networks: { localhost: { url: "http://127.0.0.1:8545/", }, sepolia: { url: process.env.SEPOLIA_URL, accounts: [process.env.PRIVATE_KEY], }, }, };
- Replace
YOUR_ALCHEMY_API_KEYwith your actual Alchemy API key for the Sepolia network. - Ensure the
.envfile is added to your.gitignoreto avoid exposing sensitive information like private keys.