Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
a8b60cfe
Commit
a8b60cfe
authored
7 years ago
by
furion
Browse files
Options
Downloads
Patches
Plain Diff
update README
parent
845f70b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+32
-26
32 additions, 26 deletions
README.md
with
32 additions
and
26 deletions
README.md
+
32
−
26
View file @
a8b60cfe
## 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment