This project provides a smart contract on the Ethereum blockchain for managing employee keys securely and efficiently. It leverages blockchain technology to ensure secure and immutable key management.
Before running this project, ensure you have the following tools installed:
- Node.js
- Hardhat
- npm
- A blockchain node provider such as Alchemy or Infura
- An Ethereum wallet like MetaMask
Follow these steps to get the project up and running:
git clone https://github.com/your-repo/EmployeeKeyManagement.git
cd EmployeeKeyManagementnpm installCreate a .env file to securely store your private credentials:
touch .envInside the .env file, add:
PRIVATE_KEY=<your-private-key>
ALCHEMY_API_URL=<your-alchemy-api-url>
CONTRACT_ADDRESS=<your-contract-address> # Leave empty for now; will be filled after deployingRun the following command to deploy your contract on your chosen network:
npx hardhat run scripts/deploy.js --network <network-name>After deployment, copy the contract address from the console output and update the CONTRACT_ADDRESS variable in your .env file.
Once the contract is deployed and everything is set, start the server:
npm start server.js- Test the contract:
npx hardhat test- Compile the contract:
npx hardhat compile- Deploy to a test network:
npx hardhat run scripts/deploy.js --network rinkebyThis project is licensed under the MIT License. See the LICENSE file for details.
lahiruthpala