Skip to content

fenine-network/fns-subgraph

Repository files navigation

Fenine Name Service Subgraph

This subgraph indexes Fenine Name Service contracts on the fenine network. It tracks the Fenine registry, base registrar, FEN registrar controller, name wrapper, and resolver events so ens-metadata-service can resolve domain metadata, registrations, wrapped names, and resolver text records.

Docker Stack

The repo now includes a complete local stack for subgraph indexing:

  • postgres
  • ipfs
  • graph-node

Environment variables are defined in .env.example. Create .env from it and adjust values as needed.

Main variables:

  • POSTGRES_DB
  • POSTGRES_USER
  • POSTGRES_PASSWORD
  • POSTGRES_PORT=5433 (host port; container tetap listen di 5432)
  • GRAPH_NODE_ETHEREUM=fenine:https://rpc.fene.app
  • GRAPH_NODE_QUERY_PORT=8000
  • GRAPH_NODE_ADMIN_PORT=8020
  • IPFS_API_PORT=5001

Boot the stack:

docker compose up -d

Create and deploy the Fenine subgraph locally:

yarn create-local
yarn deploy-local

The deployed local endpoint used by ens-metadata-service is:

http://127.0.0.1:8000/subgraphs/name/fenine/fns

Example Queries

Here we have example queries, so that you don't have to type them in yourself eachtime in the graphiql playground:

{
  domains {
    id
    labelName
    labelhash
    parent {
      id
    }
    subdomains {
      id
    }
    owner {
      id
    }
    resolver {
      id
    }
    ttl
  }
  resolvers {
    id
    address
    domain {
      id
    }
    events {
      id
      node
      ... on AddrChanged {
        a
      }
      ... on NameChanged {
        name
      }
      ... on AbiChanged {
        contentType
      }
      ... on PubkeyChanged {
        x
        y
      }
      ... on TextChanged {
        indexedKey
        key
      }
      ... on ContenthashChanged {
        hash
      }
      ... on InterfaceChanged {
        interfaceID
        implementer
      }
      ... on AuthorisationChanged {
        owner
        target
        isAuthorized
      }
    }
  }
  registrations(where: { labelName_not: null }, orderBy: expiryDate, orderDirection: asc, first: 10, skip: 0) {
    expiryDate
    labelName
    domain{
      name
      labelName
    }
  }
}

About

Subgraph indexes FNS contracts on the Fenine network. It tracks the registry, base registrar, FEN registrar controller, name wrapper, and resolver events

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors