Skip to content

Commit

Permalink
🥐 (#93)
Browse files Browse the repository at this point in the history
* Create .gitignore

* Clean up build process

* Add content

* Update

* Fix

* Update copy
  • Loading branch information
gskril authored Dec 17, 2024
1 parent c52efc6 commit e64fd36
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.DS_Store
42 changes: 22 additions & 20 deletions blog/buildAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@ type Cover = {
data: Buffer;
};

const getCoverImages = async () => {
const posts = await readdir(CONTENT_FOLDER);
async function getPostDirectories() {
// Load all posts from the content directory
const files = await readdir(CONTENT_FOLDER);

console.log('Posts', posts);
return files.filter((file) => file !== '.DS_Store');
}

const getCoverImages = async () => {
const posts = await getPostDirectories();
const covers: Cover[] = [];

for (const post of posts) {
Expand All @@ -104,8 +108,6 @@ const getCoverImages = async () => {
for (const format of ImageFormats) {
const cover = `${CONTENT_FOLDER}/${post}/cover.${format}`;

console.log('Checking', cover);

try {
await access(cover, constants.F_OK | constants.R_OK);
const data = await readFile(cover);
Expand All @@ -127,7 +129,7 @@ const getCoverImages = async () => {

// Read meta.json and check for cover
const meta = await import(`../content/${post}/meta.json`).catch(
() => { }
() => {}
);

if (meta?.cover) {
Expand Down Expand Up @@ -180,17 +182,19 @@ const handleCoverImages = async () => {

// eslint-disable-next-line sonarjs/no-nested-template-literals
const key = `${prefix || ''}cover${suffix ? `-${suffix}` : ''}`;
const output = `${ASSETS_FOLDER}/${cover.post}/${key}.${format || 'webp'
}`;
const output = `${ASSETS_FOLDER}/${cover.post}/${key}.${
format || 'webp'
}`;

console.log(`Converting image to ${output}`);

await makeDirecectoryIfNotExists(`${ASSETS_FOLDER}/${cover.post}`);

await sharp(cover.data).resize(width, height).toFile(output);

result += ` '${key}': import('./${cover.post}/${key}.${format || 'webp'
}') as Promise<{default: StaticImageData}>,\n`;
result += ` '${key}': import('./${cover.post}/${key}.${
format || 'webp'
}') as Promise<{default: StaticImageData}>,\n`;
}

result += ' },\n';
Expand All @@ -216,17 +220,14 @@ const AVATAR_IMG_SETTINGS: ImageSettings[] = [
];

const getAvatarImages = async () => {
const posts = await readdir(CONTENT_FOLDER);

console.log('Posts', posts);

const posts = await getPostDirectories();
const avatars: Record<string, Buffer> = {};

for (const post of posts) {
// Read meta.json and check for cover
const meta: BlogPostMetadata = await import(
`../content/${post}/meta.json`
).catch(() => { });
).catch(() => {});

if (!meta) continue;

Expand Down Expand Up @@ -305,8 +306,9 @@ const handleAvatarImages = async () => {

// eslint-disable-next-line sonarjs/no-nested-template-literals
const key = `${prefix || ''}avatar${suffix ? `-${suffix}` : ''}`;
const output = `${ASSETS_FOLDER}/${author}/${key}.${format || 'webp'
}`;
const output = `${ASSETS_FOLDER}/${author}/${key}.${
format || 'webp'
}`;

console.log(`Converting image to ${output}`);

Expand All @@ -324,9 +326,9 @@ const handleAvatarImages = async () => {
continue;
}


result += ` '${key}': import('./${author}/${key}.${format || 'webp'
}') as Promise<{default: StaticImageData}>,\n`;
result += ` '${key}': import('./${author}/${key}.${
format || 'webp'
}') as Promise<{default: StaticImageData}>,\n`;
}

result += ' },\n';
Expand Down
11 changes: 9 additions & 2 deletions blog/src/lib/get_posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type BlogPostMetadataPlus = BlogPostMetadata & {
};

export const getPostsMetadata = async () => {
const folderNames = await readdir('../content');
const folderNames = await getPostDirectories();

return unstable_cache(_getPostsMetadata, [folderNames.join(',')], {})();
};
Expand All @@ -22,7 +22,7 @@ export const _getPostsMetadata = async (): Promise<BlogPostMetadataPlus[]> => {
const posts: BlogPostMetadataPlus[] = [];

// Load all posts from the content directory
const files = await readdir('../content');
const files = await getPostDirectories();

// For each file, get the slug and file name
for (const file of files) {
Expand All @@ -46,3 +46,10 @@ export const _getPostsMetadata = async (): Promise<BlogPostMetadataPlus[]> => {
return aDate.getTime() > bDate.getTime() ? -1 : 1;
});
};

async function getPostDirectories() {
// Load all posts from the content directory
const files = await readdir('../content');

return files.filter((file) => file !== '.DS_Store');
}
Binary file added content/030_linea_namechain/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions content/030_linea_namechain/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"slug": "ens-picks-linea",
"title": "ENS Picks Linea for Layer 2 Rollout",
"description": "ENS Labs has entered into a joint engineering partnership with the incredible team at Linea to build Namechain!",
"date": "2024-12-17",
"tags": [],
"authors": ["enslabs.eth"]
}
30 changes: 30 additions & 0 deletions content/030_linea_namechain/readme.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
The Ethereum Name Service (ENS) was designed to not only improve the UX of blockchains - but make a new, more intuitive internet. In the spirit of that mission, we are thrilled to announce that we have entered into a joint engineering partnership with the incredible team at Linea to build Namechain!

## Why Linea?

The selection of Linea as the foundation for Namechain emerged from a comprehensive technical and strategic evaluation conducted by the ENS Labs team, which you can read about [here](https://blog.ens.domains/post/ensv2-update). Two key architectural decisions immediately stood out about Linea:

- Being a [Type 2 zkEVM](https://vitalik.eth.limo/general/2022/08/04/zkevm.html#type-2-fully-evm-equivalent), Linea achieves bytecode compatibility with Ethereum, ensuring that existing smart contract code and tooling can be used without modification.
- Linea's high-performance prover, alongside the configurability of its rollup parameters, enables fast state confirmation essential for reliable name resolution.

The benefits of Linea's properties also extends to broader ecosystem compatibility. Many Ethereum execution clients - including Besu, Geth, Erigon, and Nethermind - can sync directly to chains built on the Linea stack, providing the same client diversity that secures Ethereum mainnet. This multi-client approach, combined with rapid finality guarantees, creates a robust and resilient infrastructure that is perfectly suited for the needs of ENS.

### Proven Integration History

In addition to Linea's standalone strong technical foundation, we at ENS Labs also share an excellent history of collaboration with their team. They were the first L2 team to build a trust-minimized implementation of [CCIP-Read (ERC-3668)](https://eips.ethereum.org/EIPS/eip-3668), enabling decentralized cross-chain name resolution for over 530,000 [linea.eth subnames](https://names.linea.build/). This integration validated ENS technology on L2 and further demonstrated Linea's capability to support ENS's specific technical requirements.

## Why Namechain Matters

As ENS has evolved, its role has expanded beyond simple address resolution. The protocol now serves as foundational infrastructure for decentralized identity and naming across the web3 ecosystem, supporting diverse use cases including permissionless user profiles, decentralized website hosting, and interoperability with traditional DNS systems. This expansion, while validating the core value proposition of ENS, has also highlighted the need for enhanced scalability and improved performance characteristics.

Namechain represents a strategic response to these emerging requirements. By implementing ENS functionality on an L2 network, we can address several challenges:

1. **Transaction Throughput**: L2 scaling enables significantly higher registration and renewal volumes, in addition to significantly increased performance for ecosystem applications.
2. **Cost Efficiency**: Transactions on L2 networks have dramatically reduced transaction fees, making ENS services more accessible to a broader user base.
3. **Extensibility**: L2s make exploring advanced naming features and complex resolution logic more practical.

## Building the Future Together

This partnership will combine Linea's advanced zkEVM architecture with ENS's upcoming ENSv2 protocol to create robust, scalable infrastructure for the decentralized identity system. Our joint development roadmap will focus on protocol enhancements for ENS and Linea, in addition to the broader mission of serving L2s and their users. This technical foundation will enable innovative applications in cross-chain name resolution, decentralized hosting, and identity verification.

As we progress through our development milestones, we invite the broader technical community to participate in shaping this evolution through open-source contributions and protocol feedback.

0 comments on commit e64fd36

Please sign in to comment.