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): Prepare MySQL Database (once):
``` ```
...@@ -11,38 +14,41 @@ make build ...@@ -11,38 +14,41 @@ make build
make iypthon 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): Then we need to set `DATABASE_URL` environment variable, for example:
see `schema.setup()` and `schema.teardown()` ```
set DATABASE_URL 'mysql://root:root_password@mysql:3306/testdb'
*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.
It is primarily concerned with indexing specific `custom_json` namespaces but also watches for posts, votes, and account creations. Lastly we invoke the `ensure-schema` command to create MySQL tables.
[Community Spec Draft](https://github.com/steemit/condenser/wiki/Community-Spec-%5BDRAFT%5D)
```
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 ## Starting API Server
- `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 server dev-server --port 1234
- `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)
### Community ## Spec
[Community Spec Draft](https://github.com/steemit/condenser/wiki/Community-Spec-%5BDRAFT%5D)
- `hive_communities`: registered community data ## License
- `hive_members`: roles of accounts within each community, and metadata MIT
- `hive_flags`: track all community flag operations for mods to review \ No newline at end of file
- `hive_modlog`: tracks all `hivemind` related operations for auditability
\ 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