Installation
Installation of the Smartcontracts
Last updated
Was this helpful?
Installation of the Smartcontracts
Last updated
Was this helpful?
Smartcontracts are running inside the container and uses the framework.
Therefore, the local computer that wants to install the Smartcontracts has to be with Installed and .
Once installed, the terminal should show that docker
and docker-compose
commands are available:
Upon installation of Git, you can clone the Lighthouse Github repository into your computer:
Open in the terminal the folder of the Lighthouse Smartcontracts: Then create .env file with the following key values:
Here: MOONBEAM_DEPLOYER_ADRESS is Wallet Address of Claim verifier. MOONBEAM_DEPLOYER_KEY is the Wallet's private key that will deploy contracts on the Network. MOONBEAM_REMOTE_HTTP is the HTTPS URL of Moonbeam node.
After installation, you can run the Docker compose to set up the Smartcontracts. The first setup will take some time, as it downloads the dependencies from the network:
In order to interact with Smartcontracts, please enter into the Container:
This will enter into the Container. As Lighthouse smartcontracts built with Hardhat, the commands to compiling smartcontracts, deploying smartcontracts, testing or running scripts are done via Hardhat command line tool.
Here are the most common commands:
We run the scripts defined in scripts/
folder. The deployment scripts have deploy-
prefix. Visit the deployment scripts and change the parameters passed to constructors. For example above command deployes LighthouseTier.sol
contract.
Additionally we pass a --network
argument with the network name. To change network settings or toadd another Blockchain networks (Such as Ethereum Mainnet, Ethereum Rinkeby Testnet) you can edit hardhat.config.js
file inside the root folder.
Deploying on a new network steps:
First deploy the Tier contract: npx hardhat run scripts/deploy/tier.js --network networkName Once the tier is deployed, update the scripts/addresses.js by adding a new script.
Deploy the Tier Wrapper npx hardhat run scripts/deploy/tier-wrapper.js --network networkName, update the addresses.js
Then deploy the scripts/deploy/project.js , then update the addesses.js
Then deploy the scripts/deploy/project-wrapper, then update the addresses.js.
Then deploy the registration contract. scripts/deploy/registration.js, update the addresses.js
Then deploy the prefund contract. scripts/deploy/prefund.js, update the addresses.js
Then deploy the auction contract. scripts/deploy/auction.js, update the addreses.js
Then deploy the burn contract. scripts/deploy/burn.js, update the addresses.js
Finally, deploy the burn contracts on scripts/deploy/burn-tasks.js, update the addresses.js
IMPORTANT, make sure that you check the deployment scripts, before calling them. Some of them are using the handwritten code.
Some of them are automatically detecting the network id by addresses.js. Therefore before deploying the scripts, add the network section to the addresses.js's addresses object.
The project contract and project wrapper contract asks for the kyc verifier. Use for testing purpose the address that deploys the contract
Testing contracts are done via calling npx hardhat test
command by passing test script file. In Lighthouse tests are enumerated with number prefix. For example tests/1-tier.js
is the LighthouseTier.sol
smartcontract's Tests.
Next required Program is a Git Client. I would recommend or with a nice GUI.
For Moonbeam and Moonriver Networks, its recommended to use rather than Official Public RPC nodes.
npx hardhat compile
compiles Solidity files. For more info about compiling at .
For more info about deploying contracts at .
For more info about testings using Hardhat visit .