This documentation provides instructions on how to set up, deploy, and run the Linea ENS App locally.
Friendly forked from ENS V3 app: https://github.com/ensdomains/ens-app-v3.
Install Node.js, pnpm, Yarn and docker-compose.
See Requirements.
In the linea-ens root folder, run:
pnpm iIn a first terminal, run:
cd packages/linea-ens-app
cp .env.example .env
pnpm i
pnpm denvOnce successfully started, you should see TheGraph logs:
graph-node_1 | Jul 11 10:39:41.725 INFO Done processing trigger, gas_used: 197859281, data_source: ENSRegistry, handler: handleNewResolver, total_ms: 2, transaction: 0x807b…2c88, address: 0x5fbd…0aa3, signature: NewResolver(indexed bytes32,address), sgd: 1, subgraph_id: QmUqJV5Z..., component: SubgraphInstanceManager
graph-node_1 | Jul 11 10:39:41.729 INFO Applying 7 entity operation(s), block_hash: 0xb51c59cdbc..., block_number: 79, sgd: 1, subgraph_id: QmUqJV5Z..., component: SubgraphInstanceManagerIn a second terminal, run:
cd packages/linea-ens-subgraph
yarn setupOnce successfully started, you should see:
Build completed: QmRmG8bPjg3oy62b...
Deployed to http://127.0.0.1:8000/subgraphs/name/graphprotocol/ens/graphqlIn a third terminal, run:
cd services/web3signer/
cp ./key-files/examples/signer.yaml ./key-files/signer.yaml
make dev-dockerOnce successfully started, you should see:
Web3Signer has started with TLS disabled, and ready to handle signing requests on 0.0.0.0:9000In a fourth terminal, run:
cd packages/poh-signer-api
cp .env.example .env
pnpm i
make devMake sure VERIFIER_CONTRACT_ADDRESS matches the PohVerifier contract address in
./packages/linea-ens-app/.env.local.
Once successfully started, you should see:
Poh Signer Api v1.0.0 development started on port: 4000In a fifth terminal, run:
cd packages/linea-ens-app
pnpm dev:glocalYou'll need an account with POH to fully use the local env, if you don't, you can get it via [Linea Hub] (https://linea.build/hub/).
-
Then browse http://localhost:3000/.
-
Import one of the hardhat test accounts in your MetaMask to have funds (eg, private key:
ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80, for address:0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266) -
Add the local test network to your MetaMask with these info:
- Click on
Add a network manually - Add this config:
| Setting | Value | | --------------- | --------------------- | | Network name | Localhost 8545 | | New RPC URL | http://127.0.0.1:8545 | | Chain ID | 1337 | | Currency symbol | ETH |
- Save and Switch to
Localhost 8455.
- Click on
-
Transfer 1 ETH from the test account above (eg:
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266), to your POH account- If you don't have an address with PoH, see Common Errors.
-
You can start testing the app and register a domain.
# For mainnet
pnpm dev
# Or with the test environment running
pnpm dev:glocalpnpm lintCurrently the tests written by ENS are not working in this repo because they still need to be adapted for this app.
You shouldn't deploy the subgraph on top of the existing dataset, instead you should create a clean dataset (explained below).
- Start the test environment
pnpm denv --save- Deploy the subgraph
After the deploy scripts have run, you can deploy the subgraph. Assuming you are in the linea-ens-subgraph repo, you can use:
yarn setup- Wait for the subgraph to sync
Similar to the update process, a good indicator of sync status is if you see this message:
no chain head update for 30 seconds, polling for update, component: BlockStream
Dissimilar to the update process however is that you will never need to mine blocks manually.
- Exit the test environment
You can exit out of the test environment using Ctrl+C.
Once exited, you can commit the data to your branch. You do not need to run a separate save command.
pnpm build
pnpm start
# Or with the test environment running
pnpm build:glocal
pnpm buildandstart:glocalThe structure of the pages folder is mimicked inside components. Components specific to a page can be found in the
components folder, in the folder corresponding to that page.
Components that are used in multiple places will be found in the top level of the components folder.
Most installation errors are due to Node.js, pnpm, yarn or docker-compose versions. Verify
the requirements if you encounter an error. To verify, you can execute:
node --version
v22.22.0Node Version Manager (nvm) can be used to manage multiple versions of Node.js if you find you are not in the correct
version of Node. The repository includes a .nvmrc file that specifies the required version.
pnpm --version
10.28.0yarn --version
1.22.22docker-compose --version
docker-compose version 1.29.2, build 5becea4cIt is possible the Canvas libraries are not installed correctly or missing. To install/reinstall: First install pkg-config:
brew install pkg-configThen install dependencies for canvas
brew install cairo pango libpng jpeg giflib librsvgAfter installing the dependencies, set the PKG_CONFIG_PATH environment variable:
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:/opt/homebrew/share/pkgconfig:$PKG_CONFIG_PATH"Finally clear npm cache and node_modules:
npm cache clean --force
rm -rf node_modulesIf you encounter a Package Manager error this stems from a Yarn compatibility issue. To resolve this we need to disable Yarn that has been bundled in with the latest versions of Node.js and install Yarn separately.
To do so follow these steps in the root folder:
corepack disablenpm install -g pnpmnpm install -g yarn
If you encounter this error:
[Error: EACCES: permission denied, unlink '/home/rapha/studio/linea/ens/linea-ens/packages/linea-ens-app/data/ipfs/api'] {
errno: -13,
code: 'EACCES',
syscall: 'unlink',
path: '/home/rapha/studio/linea/ens/linea-ens/packages/linea-ens-app/data/ipfs/api'
}To fix it, you can safely remove data in ./packages/linea-ens-app/data.
If your address doesn't have a PoH, for testing purpose you can temporarily deactivate the PoH verification:
-
Edit
linea-ens/packages/poh-signer-api/src/modules/poh/poh.service.ts. -
Comment
ifstatement on L.30, like:
// if (!pohResponse.poh) {
// throw new Error('address not POH');
// }
But you cannot use an address twice, you have to change address for each new registration.