Git Product home page Git Product logo

operator-sign's Introduction

Crossbell Operator Sign Backend Service

Operator Sign (Op Sign) designed to enhance the user experience on the Crossbell network. Its primary goal is to streamline the interaction process by minimizing the number of manual approvals required for each transaction.

Features

  • Efficient Interactions: No need to manually approve every transaction, ensuring a smoother user experience.
  • Secure Authentication: Leverage the SIWE protocol to authenticate users based on their encrypted signature.
  • Delegated Operations: The Operator contract methods can carry out operations on the user's behalf, ensuring both convenience and security.

Getting Started

Install deps:

npm install

Prepare environment variables:

copy .env.example .env

Setup wallet:

You will need to create a wallet and obtain the private key and address, then fill in the environment variables: OP_SIGN_OPERATOR_WALLET_ADDRESS and OP_SIGN_OPERATOR_WALLET_PRIVATE_KEY.

Start Database instance:

npm run docker:db

Migrate database and generate types in development environment:

npm run prisma:migrate:dev

Start server:

npm run start:dev

Access the Swagger API docs:

Once the server starts, the Swagger API docs will be available at the /docs path. For example, if you are running the server locally at port 3988, you can access the docs at http://localhost:3988/docs.

Deployment

Docker:

# building new NestJS docker image
docker-compose build
# or
npm run docker:build

# start docker-compose
docker-compose up -d
# or
npm run docker

In Node.js Environment:

npm install
npm run build
NODE_ENV=production node dist/main

Migrate database

In development:

npm run prisma:migrate:dev

In production:

npm run prisma:migrate:deploy

Customizing Endpoints in Crossbell React Kits

Check out the customizing guide here.

Modules

The Siwe module is designed to facilitate the implementation of the Sign-In with Ethereum (SIWE) protocol. It encompasses a suite of functions essential for integrating SIWE's authentication mechanisms.

The SiweTransaction module is responsible for managing a range of transactions, including posting, commenting, liking, and tipping activities.

The EventListeners module is crafted to monitor and process events generated by the Operator contract. It ensures the system responds appropriately to permissions updates and other significant contract interactions.

The CsbManager module provides utility functions that are instrumental for managing interactions with the $CSB.

The Contract module used to initialize the contract instance.

Feedback & Contributions

We welcome feedback and contributions from the community. Feel free to raise issues, submit pull requests, or share your insights to enhance the Operator Sign feature.

๐Ÿซก This project was initially developed by @SongKeys. Original commit logs were deleted to protect sensitive information before open-sourcing.

operator-sign's People

Contributors

runjuu avatar

Watchers

Birdgg avatar  avatar Usagi Ryu avatar Atlas avatar  avatar pseudoyu 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.