Skip to content
 
 

Repository files navigation

ens-metadata-service (Electroneum fork)

Fork of ensdomains/ens-metadata-service ported to Electroneum ENS (.etn, chain id 52014). Serves NFT metadata JSON and SVG name cards for wrapped and unwrapped .etn names at https://ens-metadata.electroneum.com.

API

Request

  • network: Name of the chain to query for. (electroneum)
  • contactAddress: accepts contractAddress of the NFT which represented by the tokenId
  • NFT v1 - tokenId: accepts ENS name or labelhash of ENS name in both hex and int format
  • NFT v2 - tokenId: accepts ENS name or namehash of ENS name in both hex and int format
/{network}/{contractAddress}/{tokenId}

Request (example)

https://ens-metadata.electroneum.com/electroneum/0x5207496C1248BbD2AeeDd57Bde44dd9d4E9F1b59/31950110277601215368805713989249712288917981772875175870764690804266991115067/

Response (example)

{
  "is_normalized": true,
  "name": "wallet.etn",
  "description": "wallet.etn, an ENS name.",
  "attributes": [
    {
      "trait_type": "Created Date",
      "display_type": "date",
      "value": 1571924851000
    },
    {
      "trait_type": "Length",
      "display_type": "number",
      "value": 4
    },
    {
      "trait_type": "Segment Length",
      "display_type": "number",
      "value": 4
    },
    {
      "trait_type": "Character Set",
      "display_type": "string",
      "value": "letter"
    },
    {
      "trait_type": "Registration Date",
      "display_type": "date",
      "value": 1580803395000
    },
    {
      "trait_type": "Expiration Date",
      "display_type": "date",
      "value": 1699709554000
    }
  ],
  "name_length": 6,
  "segment_length": 6,
  "url": "https://ens.electroneum.com/wallet.etn",
  "version": 0,
  "background_image": "https://ens-metadata.electroneum.com/electroneum/avatar/wallet.etn",
  "image": "https://ens-metadata.electroneum.com/electroneum/0x5207496C1248BbD2AeeDd57Bde44dd9d4E9F1b59/0x46a31f1f917570aa8a60b2339f1a0469cbce2feb53c705746446981548845b3b/image",
  "image_url": "https://ens-metadata.electroneum.com/electroneum/0x5207496C1248BbD2AeeDd57Bde44dd9d4E9F1b59/0x46a31f1f917570aa8a60b2339f1a0469cbce2feb53c705746446981548845b3b/image"
}

More info and list of all endpoints: https://ens-metadata.electroneum.com/docs

How to setup

git clone https://github.com/ensdomains/ens-metadata-service.git
cd ens-metadata-service
cp .env.org .env // Fill in Vars
yarn
yarn dev

How to deploy (Docker / Coolify)

A Dockerfile is provided (multi-stage build, Node 22, node-canvas system libraries included). Coolify builds and runs it directly from the repo:

docker build -t etn-metadata-service .
docker run -p 8080:8080 -e ENV=prod -e HOST=ens-metadata.electroneum.com etn-metadata-service

All Electroneum values ship as code defaults (see Environment Variables below), so no env vars are strictly required; set HOST so self-referential URLs are generated correctly. The upstream Google App Engine flow (yarn deploy, app_template.yaml) is retained but unused.

How to test

Regular unit test;

yarn test

Unit test + coverage;

yarn test:cov

Environment Variables

Name Description Default value Options
HOST Host (ip/domain) address of the running service localhost ens-metadata.electroneum.com
ENV Project scope local local/prod
REDIS_URL (Optional) Redis connection if you want to enable rate limiter - -
INAMEWRAPPER InterfaceId of NameWrapper Contract 0xd82c42d8 -
ADDRESS_ETH_REGISTRY Electroneum address of the ENS Registry 0x6F311F2212593165988Dff84977e24C1005dBb85 -
ADDRESS_ETH_REGISTRAR Electroneum address of BaseRegistrarImplementation 0x5207496C1248BbD2AeeDd57Bde44dd9d4E9F1b59 -
ADDRESS_NAME_WRAPPER Electroneum address of NameWrapper 0xd8F4B1A91469B05d9E0b15Cac4917Ee47b2A6f64 -
NODE_PROVIDER Node provider type geth geth/Cloudflare/Google/Infura
NODE_PROVIDER_URL JSON-RPC endpoint https://rpc.electroneum.com -
SUBGRAPH_URL_ELECTRONEUM ENS subgraph GraphQL endpoint https://subgraph.electroneum.com/subgraphs/name/etn-subgraph -
ENS_APP_URL Public URL of the ENS manager dapp (metadata url field) https://ens.electroneum.com -

Releases

Packages

Contributors

Languages