GithubHelp home page GithubHelp logo

o-az / enstate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from v3xlabs/enstate

0.0 1.0 0.0 497 KB

ENS JSON API & Cloudflare Worker written in Rust. Try it out ๐Ÿ‘‡

Home Page: https://enstate.rs/n/luc.eth

Rust 87.85% TypeScript 12.15%

enstate's Introduction

enstate.rs

๐Ÿ“Œ API Specification (OpenAPI)

The API specification is available on enstate.rs or locally at {your_site_here}/docs.

๐ŸŒ Hosted version

For demonstration purposes (and one-off usage), a hosted instance is made available at https://enstate.rs and a cloudflare worker at https://worker.enstate.rs. This instance is provided as-is and as a gift to the community. Please do not abuse it.

๐Ÿ“Œ Example

name/luc.eth ย ย ย ย ย ย ย ย  name/rescueorg.eth ย ย ย  name/antony.sh
image/vitalik.ethย ย ย  name/khori.eth ย ย ย ย ย ย ย ย ย ย ย  name/helgesson.eth

๐Ÿš€ Getting Started

We believe software should be simple and containerized. Enstate provides you with a lightweight docker container that you can run anywhere.

๐Ÿณ Docker

docker run \
  -p 3000:3000 \
  -e REDIS_URL=redis://0.0.0.0:6379 \
  -e RPC_URL=https://rpc.ankr.com/eth \
  ghcr.io/v3xlabs/enstate:1.0.5

๐Ÿณ Docker Compose

version: "3.8"
services:
    enstate:
        image: ghcr.io/v3xlabs/enstate:1.0.5
        ports:
            - 3000:3000
        environment:
            - REDIS_URL=redis://redis:6379
            - RPC_URL=https://rpc.ankr.com/eth
        depends_on:
            - redis
    redis:
        image: redis:6.2.5-alpine
        ports:
            - 6379:6379

๐Ÿฆ€ Cloudflare Workers

cd worker

Run the worker locally

cp .dev.vars.example .dev.vars

Edit your .dev.vars file at this time to include environment variables for UNIVERSAL_RESOLVER, RPC_URL (optional) and OPENSEA_API_KEY (optional).

To run the worker locally you can now run:

pnpm dev

Deploying to Cloudflare Workers

Create a KV namespace via wrangler or the Cloudflare dashboard.

pnpm wrangler kv:namespace create <YOUR_NAMESPACE>

Copy the id of your newly created KV namespace to your wrangler.toml. The binding value should remain as enstate-1 regardless of what you named yours when you created it.

Deploy the worker:

pnpm wrangler deploy

Upload your secrets:

echo "https://rpc.ankr.com/eth/XXXXXX" | pnpm wrangler secret put RPC_URL
echo "XXXXX" | pnpm wrangler secret put OPENSEA_API_KEY

Additionally, there is a hosted instance available at worker.enstate.rs.

Contributing

Standalone Server

cd server && cargo run -p enstate

Cloudflare Worker

cd worker && pnpm dev

For more information on running the worker locally, please see running Cloudflare Workers locally.

enstate's People

Contributors

lucemans avatar antony1060 avatar m1guelpf avatar robiot avatar dependabot[bot] avatar o-az avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.