The following node and npm versions are required
$ node -v
v14.17.1
$ npm -v
6.14.13
Configuration file description
PRIVATE_KEY User-deployed private key
INFURA_KEY User-deployed infura key
LIGHTNODE_SALT User-deployed lightnode salt
DEPLOY_FACTORY Factory-contract address
LightNode : A contract used to verify klaytn transactions in the map relay chain
LightNodeProxy is the contract for LightNode upgrade
git clone https://github.com/mapprotocol/map-contracts.git
cd map-contracts/lightlients/klaytn/
npm install
Note if you use the eth main network, you can configure ETH_INFURA_KEY, if you don't use it, you can not configure it Edit the .env-example.txt file and save it as .env
npx hardhat test
See results similar to the following, proving that the execution was successful
LightNode start test
✓ deploy LightNode Proxy
✓ lightNodeContract params check
✓ lightNode verify Header
✓ lightNode updateBlockHeader
✓ lightNode updateBlockHeaders
✓ lightNode admin Test
7 passing (15s)
When you want to deploy LightNode, first run the following command
npx hardhat deploy --tags LightNode --network <network>
Later we deploy the upgrade contract and initialize the contract,run the following command
npx hardhat lightFactoryDeploy --height <init height> --mpt <MPT contract address> --network <network>
If you want to use the upgrade contract, please execute the following command, pay attention to use the correct network
npx hardhat deploy --tags LightNodeUp --network <network>