官方的 ENS 管理应用。在这里注册和管理您的 ENS 名称。
Install pnpm, then:
pnpm install
pnpm devNavigate to localhost:3000
The purpose of the manager app is to expose the functionality of the ENS protocol in a user friendly manor.
ENS is a decentralized naming system that runs on the ethereum blockchain. The main purpose of ENS is to convert unfriendly blockchain addresses into human readable names (e.g. 0xb8c2c29ee19d8307cb7255e1cd9cbde883a267d5 -> nick.eth), but ENS has grown into so much more than that. For more info please visit our docs site.
Web3 is the term used to describe the blockchain enabled web, web2 is the 'legacy' more centralized web. Much of this app is built in tech that will be familiar to many web2 devs.
Web2 tech
Web3 tech
TBC
You must have Docker installed to run the test environment. For more information on the environment, see ens-test-env.
Once installed, you can run:
pnpm denv
pnpm dev:glocalYou can now navigate to http://localhost:3000 to see the app running off of a
local blockchain.
You will need a browser wallet to develop and test blockchain interactions. Download the Metamask browser extension here.
During the setup flow choose "Import existing wallet".
When it asks for your "Secret recovery phrase", use
test test test test test test test test test test test junk
You can then follow the instructions here to connect metamask to our local dev blockchain.
You should now have 10,000 ETH (local network eth) in your wallet. You're a legend on your local machine.
Github action scripts can be found in .github/workflows
The App is hosted on cloudflare and IPFS
Much of the logic around interacting with the ENS contracts has been extracted into this library. This is mostly so that we can help to make the experience of interacting with ENS as simple as possible for other developers.
As we have many different applications, and also would like to support the community, we have developed a design system in order to ensure consistent styling across the board.
Pages folder has basic route layout and basic react needed for rendering pages. These files should be kept relatively simple
Components that pages consume are kept in the components folder. This folder has a structure that mimics the structure of the pages folder. If a component is only used on a specific page then it goes into the corresponding folder in the components folder.
If a component is used across multiple pages and other components,
then it goes into the atoms and molecules folder (link to atoms and molecules thingy).
TBC
TransactionStore.tsTransaction store is responsible for keeping track of the state of transactions.
TransactionFlowProvider.tsWe noticed transactions always follow a similar pattern and so created an internal API to streamline this. A transaction flow is a series of steps that occur in a modal, culminating in a successful or failed transaction. Transactions can have either an intro or an input step before the transaction step.
migrated-resolver-to-be-updated.ethTransactionDialogManager, which is rendered
by TransactionFlowProvider. The logic for rendering the different steps is contained here.RolesSection.tsx, which gets its actions from useRoleActions.tsx.
The onClick property here calls showSendNameInput from usePreparedDataInput.
This is a helper function provided by the useTransactionFlow hook.
We have various input components prepared already,
they are defined in src/transaction-flow/input. This one is using input/SendName. Once the
form data has been submitted we dispatch two actions to the TransactionFlowProvider reducer.
One to set the transactions required, and the next one to advance to the next step of the
transaction flow.TransactionStageModal.This is for when the graph is behind and we are waiting for it to catchup.
TBC
ENS names are NFTs. NFTs can have metadata associated with them, that is data associated with them that is not stored directly on-chain. One of the main use cases of this is to display a nice image that represents the ENS name. You can see an example of this here.
app-v3-maintenance: url
etherscan-api worker: url
The graph hosted service: url, src
pnpm test
pnpm test:watch
pnpm test:coverageYou shouldn't deploy the subgraph on top of the existing dataset, instead you should create a clean dataset (explained below).
pnpm denv --saveAfter the deploy scripts have run, you can deploy the subgraph. Assuming you are in the ens-subgraph repo, you can use:
yarn setupSimilar 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: BlockStreamDissimilar to the update process however is that you will never need to mine blocks manually.
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.
Our e2e tests are split into two categories, stateless and stateful. Stateless test use the development environment, are faster, and is the general recommended way to write integration tests. Occasionally, you may need to test a feature that requires an external API or service. In this case, you can use the stateful tests. These tests are slower,
Running the entire stateless test suite:
pnpm denv
pnpm dev:glocal
pnpm e2eRunning a single test within a browser:
pnpm denv
pnpm dev:glocal
pnpm e2e : --headedRunning the entire stateful test suite:
pnpm dev
pnpm e2e:statefulRunning a single stateful test within a browser:
pnpm dev
pnpm e2e:stateful : --headedThe most important function in the e2e stateless tests is makeName. This function is used to create a unique name for each test. This is important because we want to avoid any conflicts between tests.
…A single or an array of names to create. Each name can have the following properties:
label: string
The label of the name.
type: legacy | legacy-register | wrapped*
The type of the name. legacy names adopt the original data structure of ENS and are not ERC1155 complaint. wrapped names are names that have been wrapped with the NameWrapper contract and are ERC1155 compliant. legacy-register names simulate how mass registration services register names, usually without a resolver of other options that may increase gas.
owner: user | user2 | user3
defaults to owner
The address of the owner of the name.
manager: user | user2 | user3
defaults to value of owner
The address of the manager of the name. Only applicable to legacy and legacy-registr names.
duration: number
defaults to 365 days in seconds
The number of seconds the name will be registered for. Negative values are allowed to simulate names that have expired or are in the grace period.
secret: hex
defaults to a zero hex
The secret used during the register process. You will most likely not need to set this value.
resolver: address
defaults to the legacy resolver for legacy names and the latest resolver for wrapped names
The address of the resolver for the name. Used to test cases where the resolver is misconfgured or not set.
addr: address
defaults to the address of the owner
The address record for the name. Is used to test cases where the eth address is not set.
records: RecordOptions
The records for the name. Below is a type definition for the records object.
type RecordOptions = {
texts: {
key: string,
value: string
}[]
coins: {
coin: string | number,
value: string
}[]
contentHash: string
abi: AbiObject
}fuses: FusesType
applicable to wrapped names only
The fuses to burn for a wrapped name. Below is a type definition for the fuses object. Note that PARENT_CANNOT_CONTROL is not fuse option as it is burned by default when a 2LD name is wrapped.
type FusesType = {
named: Array
}subnames: SubnameType[]
The subnames for the name. Below is a type definition for the subname object.
type SubnameType = {
label: string
type: 'legacy' | 'wrap暂无开放 Issues,或尚未同步最近议题。