Skip to content
Snippets Groups Projects
Commit a8b60cfe authored by furion's avatar furion
Browse files

update README

parent 845f70b6
No related branches found
No related tags found
No related merge requests found
## Dev Environment
## Hivemind
`hivemind` is an off-chain consensus layer for Steem communities and API server for social features like feeds and follows.
# Dev Environment
Prepare MySQL Database (once):
```
......@@ -11,38 +14,41 @@ make build
make iypthon
```
Apply MySQL Schema (from REPL):
## Setting up MySQL
First, we need to setup a MySQL server. An easy way to do that (in Docker) is to run:
```
%run scripts/schema.py
make mysql
```
MySQL Schema (from code):
see `schema.setup()` and `schema.teardown()`
*Todo: Implement migrations via Alembic.*
## Hivemind
`hivemind` is an off-chain consensus layer for Steem communities and API server for social features like feeds and follows.
Then we need to set `DATABASE_URL` environment variable, for example:
```
set DATABASE_URL 'mysql://root:root_password@mysql:3306/testdb'
```
It is primarily concerned with indexing specific `custom_json` namespaces but also watches for posts, votes, and account creations.
[Community Spec Draft](https://github.com/steemit/condenser/wiki/Community-Spec-%5BDRAFT%5D)
Lastly we invoke the `ensure-schema` command to create MySQL tables.
```
hive db ensure-schema --yes
```
Upon reindexing/following the blockchain, the following tables are populated:
## Indexing the blockchain
We can index the blockchain using cli as well.
```
hive indexer from-steemd
```
### Core
If we have a `.json.lst` file containing first X blocks, we can index from that (its much faster).
```
hive indexer from-file /path/to/blocks.json.lst
```
- `hive_blocks`: basic linked list of blocks to save current head block and ensure sequential processing
- `hive_accounts`: basic account index. may be supplanted with cached data
- `hive_posts`: main post index. contains core immutable metadata as well as community states
- `hive_follows`: all follows and their creation date
- `hive_reblogs`: all reblog actions (account, post, date)
- `hive_posts_cache`: updated with latest state of posts as new blocks come in (removing need to query steemd)
## Starting API Server
```
hive server dev-server --port 1234
```
### Community
## Spec
[Community Spec Draft](https://github.com/steemit/condenser/wiki/Community-Spec-%5BDRAFT%5D)
- `hive_communities`: registered community data
- `hive_members`: roles of accounts within each community, and metadata
- `hive_flags`: track all community flag operations for mods to review
- `hive_modlog`: tracks all `hivemind` related operations for auditability
\ No newline at end of file
## License
MIT
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment