Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snapshot-labs/snapshot-hub
GraphQL API for Snapshot
https://github.com/snapshot-labs/snapshot-hub
Last synced: 3 days ago
JSON representation
GraphQL API for Snapshot
- Host: GitHub
- URL: https://github.com/snapshot-labs/snapshot-hub
- Owner: snapshot-labs
- License: mit
- Created: 2020-07-12T04:31:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T10:38:29.000Z (3 months ago)
- Last Synced: 2024-10-29T12:35:30.303Z (3 months ago)
- Language: TypeScript
- Homepage: https://hub.snapshot.org/graphql
- Size: 3.01 MB
- Stars: 104
- Watchers: 8
- Forks: 197
- Open Issues: 47
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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:
```sh
yarn
```2. Copy [`.env.example`](https://github.com/snapshot-labs/snapshot-hub/blob/master/.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](https://jawsdb.com).
- `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.3. 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:
```sh
yarn start
```- Go on this page: http://localhost:3000/api if everything is fine it should return details of the hub example:
```json
{
"name": "snapshot-hub",
"network": "mainnet",
"version": "0.1.3",
"tag": "alpha",
"relayer": "0x8BBE4Ac64246d600BC2889ef5d83809D138F03DF"
}
```### Load a space setting
To load a space settings in the database you can go on this endpoint (change yam.eth with the space you want to activate).
## License
Snapshot is open-sourced software licensed under the © [MIT license](LICENSE).