shardmaster
Version, currently master branch1 version
- master branchlatestDec 29, 2018
github.com/greenbigfrog/shardmaster
No description declared in shard.yml.
Installation
# Add this to your shard.yml
dependencies:
shardmaster:
github: greenbigfrog/shardmaster
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.27.0- License
- MIT
- Author
- Jonathan B.
- Target
shardmasterfrom src/shardmaster.cr
Dependencies
Runtime Dependencies
- kemal*github: kemalcr/kemal
Development Dependencies
- discordcr*github: meew0/discordcr, branch: masterdev
README
shardmaster
Allows you to simply manage (semi automatic) sharding of your discord bot running in a docker swarm (across multiple hosts)
Installation
For the master, you can simply use the docker image (greenbigfrog/shardmaster). For the peers add the following to your shard.yml:
dependencies:
shardmaster:
github: greenbigfrog/shardmaster
branch: master
Usage
View example/README.md for more info
Run the master in a docker container called shardmaster and has mutual network with the peers:
docker service create --name shardmaster --network net greenbigfrog/shardmaster /shardmaster 10
Get shard:
require "shardmaster/peer"
shard = Shardmaster::Peer.get_shard
shard_id = shard[:id]
num_shards = shard[:shard_count]
Post ping every < 5 minutes to keep the shard from expiring:
require "shardmaster/peer"
Shardmaster::Peer.post_ping(shard_id)
Development
docker build -t greenbigfrog/shardmaster-example -f example/Dockerfile .
docker build -t greenbigfrog/shardmaster .
Contributing
- Fork it (https://github.com/greenbigfrog/shardmaster/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Jonathan B. - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Dec 29, 2018
- Crystal
0.27.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/greenbigfrog/shardmaster
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1