This project is a decentralized application (Dapp) built using Golang, Solidity for smart contracts, and Next.js for the frontend. The Dapp focuses on securely storing and managing personal secrets or memories.
- Smart Contract Language: Solidity
- Backend Language: Golang
- Frontend Framework: Next.js
- Development Tools: Truffle, Ganache, jq
- Node.js: Ensure Node.js is installed. Download it from nodejs.org.
- Truffle: Install Truffle globally:
npm install -g truffle
- jq: This project uses
jq
to process JSON files. Installjq
based on your operating system:- Ubuntu/Debian:
sudo apt-get install jq
- macOS:
brew install jq
- Windows: Download
jq
from the jq releases page and follow the installation instructions.
- Ubuntu/Debian:
-
Clone the Repository:
git clone https://github.com/samarthasthan/lockchain.git
-
Install Dependencies: Navigate to the
smart-contract
directory and install the necessary dependencies:cd lifetime-secret-memory-keeper/smart-contract npm install
- Compile the Contract:
Compile the smart contract with:
This generates compiled contract artifacts in the
truffle compile
build/contracts/
directory.
- Deploy the Contract:
Ensure you have a blockchain environment set up (e.g., Ganache, an Ethereum testnet). Deploy the contract using:
Replace
truffle migrate --network development
development
with your network configuration if needed.
The truffle-config.js
file contains configuration settings for Truffle, including network configurations and compiler settings. Modify this file according to your deployment environment.
To run Ganache CLI with a specific network ID and accounts configuration:
ganache-cli --networkId 1337 --host 0.0.0.0 --port 8545
- Environment Variables: Set up a
.env
file with necessary environment variables (e.g., private keys, Infura/Alchemy project IDs) if required by your configuration. - Truffle Documentation: For more details on Truffle, refer to the Truffle documentation.
- Compilation Errors: Ensure your Solidity code is correct and compatible with the compiler version specified in
truffle-config.js
. - Migration Issues: Check migration scripts and ensure your blockchain environment is properly set up.
This project is licensed under the MIT License. See the LICENSE file for details.