Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bonfida/name-resolver

Solana name service resolver in browser
https://github.com/bonfida/name-resolver

cloudflare-workers rust solana webassembly

Last synced: 3 months ago
JSON representation

Solana name service resolver in browser

Awesome Lists containing this project

README

        

Name Resolver



















Introduction



![diagram](/assets/diagram.png)

This repository is an implementation of a Solana Name Service resolver made with Cloudflare workers.

It allows people to browse SNS websites directly from their favorite web browser (e.g [https://bonfida.sol-domain.org](https://bonfida.sol-domain.org)). The resolver supports URLs, [IPFS CIDs](https://www.ipfs.com/) and [Arweave hashes](https://www.arweave.org/).

When resolving a domain the worker will look into the following records and return the first one that exists:

- `url` record
- `IPFS` record
- `ARWV` record
- `SHDW` record
- `A` record
- `CNAME` record

The resolver will resolve both records v1 and records v2, but records v2 are given priority.



Deployment



This resolver is deployed on [https://sol-domain.org](https://sol-domain.org)



Get started



1. Install the wrangler CLI

```
yarn global add wrangler
```

2. Run the worker locally

```
wrangler dev
```

3. Deploy on Cloudflare

```
wrangler publish
```



Edit your records



To make your domain browsable, you must set your records:

- Go to your domain's page (e.g [https://www.sns.id/domain?domain=bonfida](https://www.sns.id/domain?domain=bonfida))
- Connect your wallet
- In order to resolve your domain one of the following record must be set:
- `IPFS`: With the following format `ipfs://` (e.g `ipfs://QmZk9uh2mqmXJFKu2Hq7kFRh93pA8GDpSZ6ReNqubfRKKQ`)
- `ARWV`: With the following format `arwv://` (e.g `arwv://KuB5jmew87_M2flH9f6ZpB9jlDv8hZSHPrmGUY8KqEk`)
- `url`: With the following format `url_to_your_website` (e.g `https://bonfida.org`)

![record](/assets/record.png)