Open in the terminal the folder of the Lighthouse Smartcontracts:
Then create .env file with the following key values:
MOONBEAM_REMOTE_HTTP=<RPC endpoint of the Node>
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.
The wallet address, privatekey or remote HTTP nodes could be any wallets or node's url.
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.
[email protected]:/home/node/app# npx hardhat run scripts/deploy-tier.js --network moonbeam
Lighthouse Tier deployed to: 0xaba7a46B9E46CdDa4B1f25e40bF691F45dA09c04
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.
✓ initiates the contracts and set the tier user to game owner. (13970ms)
✓ should fail to claim tier 1, before claiming tier 0(8037ms)
✓ should claim tier 0(4028ms)
✓ should claim tier 1(4028ms)
✓ should fail to claim tier 0 after claiming tier 1
✓ should fail to re-claim tier 1, when tier 1 is usable by tier user (4006ms)
✓ uses the tier (4019ms)
✓ can not claim any tier except used tier, which is tier 1(4017ms)
✓ re-claims tier 1which is used (4023ms)
✓ should fail to claim tier 3, since tier 2 not claimed (4015ms)
✓ claim tier 2(4020ms)
✓ claim tier 3(4025ms)
✓ should fail to claim non existing tier 4
✓ should set fees (8035ms)
✓ should set claim verifier (8025ms)
✓ should add tier editor (8024ms)
✓ should delete editor (8026ms)
17 passing (2m)
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.