Coder Social home page Coder Social logo

xiamogucci / snapshot-hub Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snapshot-labs/snapshot-hub

0.0 0.0 0.0 2.72 MB

GraphQL API for Snapshot

Home Page: https://hub.snapshot.org/graphql

License: MIT License

TypeScript 98.86% Dockerfile 1.14%

snapshot-hub's Introduction

Snapshot Logo

Snapshot hub

This is a hub for Snapshot network that stores the database and forwards new messages to peers. The hub holds a private key to sign valid messages.

Install

  1. Install Node.js, clone the repository, then say:
yarn
  1. Copy .env.example, rename it to .env and set a value for these config vars:
  • HUB_DATABASE_URL: The database connection string. You will need to run your own MySQL database or use a Cloud service like JawsDB.
  • SEQ_DATABASE_URL: We now use messages from a different database, it can be same as HUB_DATABASE_URL in your local
  • RELAYER_PK: This is the private key of the hub. The hub counter-sign every accepted message with this key.
  1. Create the database schema

Run this query on the MySQL database to create the initial schema with the required tables: https://github.com/snapshot-labs/snapshot-hub/blob/master/src/helpers/schema.sql

Run

  • Use this command to run the hub:
yarn start
{
  "name": "snapshot-hub",
  "network": "livenet",
  "version": "0.1.3",
  "tag": "alpha",
  "relayer": "0x8BBE4Ac64246d600BC2889ef5d83809D138F03DF"
}

Usage

Once your hub is running online, the main hub can relay the messages received to your own hub. Please provide the URL of your Snapshot hub to an admin to make sure it's connected to the network.

Load a space setting

To load a space settings in the database you can go on this endpoint http://localhost:3000/api/spaces/yam.eth/poke (change yam.eth with the space you want to activate).

License

Snapshot is open-sourced software licensed under the © MIT license.

snapshot-hub's People

Contributors

bonustrack avatar renovate[bot] avatar chaituvr avatar dependabot[bot] avatar wa0x6e avatar mktcode avatar todmy avatar midgerate avatar stormsson avatar samuveth avatar fforbeck avatar xiaoch05 avatar natalialinov avatar seguido avatar zzuziak avatar rootial avatar aiinkiestism avatar i001962 avatar eswarasai avatar poocart avatar 5kram 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.