All Projects → cryptocopycats → Copycats

cryptocopycats / Copycats

Licence: cc0-1.0
copycats command line tool (and core library) - crypto cats / kitties collectibles unchained - buy! sell! hodl! sire! - play for free - runs off the blockchain w/ ledger lite - no ether / gas required; run your own peer-to-peer (P2P) network node over HTTP

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Copycats

Awesome Blockchain Kor
<블록체인의 정석>, <하이퍼레저 블록체인 개발> 소스코드 및 참고자료 저장소
Stars: ✭ 243 (+834.62%)
Mutual labels:  blockchain, hyperledger
Fabric Ca
Stars: ✭ 331 (+1173.08%)
Mutual labels:  blockchain, hyperledger
Heroes Service
Short tutorial to build a blockchain application in Go with Hyperledger Fabric
Stars: ✭ 248 (+853.85%)
Mutual labels:  blockchain, hyperledger
Fabric Starter
Starter Application and Deployment Scripts for Hyperledger Fabric
Stars: ✭ 202 (+676.92%)
Mutual labels:  blockchain, hyperledger
Fabric Sdk Node
Hyperledger Fabric SDK for Node https://wiki.hyperledger.org/display/fabric
Stars: ✭ 676 (+2500%)
Mutual labels:  blockchain, hyperledger
Iroha
Iroha - A simple, enterprise-grade decentralized ledger
Stars: ✭ 210 (+707.69%)
Mutual labels:  blockchain, hyperledger
Blockchain
黑马程序员 120天全栈区块链开发 开源教程
Stars: ✭ 3,480 (+13284.62%)
Mutual labels:  blockchain, hyperledger
Fabric
Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing solutions and applications. Its modular and versatile design satisfies a broad range of industry use cases. It offers a unique approach to consensus that enables performance at scale while preserving privacy.
Stars: ✭ 12,911 (+49557.69%)
Mutual labels:  blockchain, hyperledger
Blockchain guide
Introduce blockchain related technologies, from theory to practice with bitcoin, ethereum and hyperledger.
Stars: ✭ 5,897 (+22580.77%)
Mutual labels:  blockchain, hyperledger
Unchained
My personal study of blockchain related technology.
Stars: ✭ 379 (+1357.69%)
Mutual labels:  blockchain, hyperledger
Learning Blockchain
Tidy up Blockchain ecosystem and tutorial
Stars: ✭ 188 (+623.08%)
Mutual labels:  blockchain, hyperledger
Cello
Operating System for Enterprise Blockchain
Stars: ✭ 715 (+2650%)
Mutual labels:  blockchain, hyperledger
Cicero
Accord Project Smart Templates Implementation
Stars: ✭ 166 (+538.46%)
Mutual labels:  blockchain, hyperledger
Composer Sample Networks
⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
Stars: ✭ 226 (+769.23%)
Mutual labels:  blockchain, hyperledger
Pivt
Helm charts for running and operating Hyperledger Fabric in Kubernetes. Previously hosted at https://github.com/APGGroeiFabriek/PIVT.
Stars: ✭ 159 (+511.54%)
Mutual labels:  blockchain, hyperledger
Fabric Sdk Py
Hyperledger Fabric Python SDK
Stars: ✭ 303 (+1065.38%)
Mutual labels:  blockchain, hyperledger
Blockchainbooks.github.io
Blockchain Books
Stars: ✭ 139 (+434.62%)
Mutual labels:  blockchain, hyperledger
Hyperledger Fabric Gm
支持国密加密算法的Hyperledger Fabric版本
Stars: ✭ 152 (+484.62%)
Mutual labels:  blockchain, hyperledger
Hyperledger
Hyperledger is a Collaborative Project at The Linux Foundation.
Stars: ✭ 3,653 (+13950%)
Mutual labels:  blockchain, hyperledger
Fabric Sdk Go
Stars: ✭ 712 (+2638.46%)
Mutual labels:  blockchain, hyperledger

Crypto Copycats Collectibles - Buy! Sell! Hodl! Sire!

Copycats Database Tools

  • copycats - incl. kitty command line tool to (auto-)read kitty data records (in comma-separated values (CSV)) into an in-memory SQLite database and print reports
  • bitcat - bit catalog kitty browser; browse your (digital) bit(s) collections

Database Tables

Table Diagram

SQL Tables (in SQLite Dialect)

CREATE TABLE kitties (
    id           INTEGER  PRIMARY KEY AUTOINCREMENT
                          NOT NULL,
    name         VARCHAR,
    genes_kai    VARCHAR  NOT NULL,
    gen          INTEGER  NOT NULL,
    birthdate    DATETIME NOT NULL,
    day_count    INTEGER  NOT NULL,
    matron_id    INTEGER,
    sire_id      INTEGER,
    body_id      INTEGER  NOT NULL,
    pattern_id   INTEGER  NOT NULL,
    coloreyes_id INTEGER  NOT NULL,
    eyes_id      INTEGER  NOT NULL,
    color1_id    INTEGER  NOT NULL,
    color2_id    INTEGER  NOT NULL,
    color3_id    INTEGER  NOT NULL,
    wild_id      INTEGER  NOT NULL,
    mouth_id     INTEGER  NOT NULL
);


CREATE TABLE genes (
    id       INTEGER PRIMARY KEY AUTOINCREMENT
                     NOT NULL,
    kitty_id INTEGER NOT NULL,
    n        INTEGER NOT NULL,
    gene     VARCHAR NOT NULL,
    gene_n   INTEGER NOT NULL,
    trait_id INTEGER NOT NULL
);


CREATE TABLE traits (
    id            INTEGER PRIMARY KEY AUTOINCREMENT
                          NOT NULL,
    trait_type_id INTEGER NOT NULL,
    name          VARCHAR NOT NULL,
    n             INTEGER NOT NULL,
    kai           VARCHAR NOT NULL,
    tier          INTEGER
);

CREATE TABLE trait_types (
    id    INTEGER PRIMARY KEY AUTOINCREMENT
                  NOT NULL,
    name  VARCHAR NOT NULL,
    [key] VARCHAR NOT NULL
);

Database Setup

Use the kitty setup command to setup an SQLite database and (auto-)read all datafiles. Example:

$ kitty setup

This will create:

  • a single-file SQLite database kitties.db
  • setup all tables
  • add all known traits and trait types (body, pattern, eyes, ...) and
  • (auto-)read all datafiles (**/*.csv) in the . and all subdirectories

Note: Use the -i/--include option to change the default data directory (that is, .) and use the -n/--dbname option to change the default SQLite database name (that is, kitties.db) and use the -d/--dbpath option to change the default SQLite database path (that is, .).

Showtime! Use the sqlite3 command line tool and try some queries. Example:

$ sqlite3 kitties.db

sqlite> SELECT * FROM kitties WHERE id = 1;

1||ccac 7787 fa7f afaa 1646 7755 f9ee 4444 6766 7366 cccc eede|0|2017-11-23 06:19:59|...

sqlite> SELECT * FROM genes WHERE trait_id = 14;    -- sphynx (14)

1|1|0|d|0|14
3|1|2|r2|2|14
4|1|3|r3|3|14
38|2|1|r1|1|14
146|5|1|r1|1|14
181|6|0|d|0|14
183|6|2|r2|2|14
...

Database Queries

SQL

Find all kitties with a trait

Let's use the trait savannah (fur) with the id 0:

SELECT id FROM kitties WHERE body_id = 0

Find all kitties with two traits

Let's use the trait savannah (fur) with the id 0 and the trait tiger (pattern) with the id 33:

SELECT id FROM  kitties
          WHERE body_id = 0 AND pattern_id = 33

Find all kitties with a trait (in any gene d/r1/r2/r3)

Note: All traits (12 x 32 = 384) are numbered with ids from 0 to 383 in the traits database table. Let's use the trait savannah (fur) with the id 0:

SELECT kitty_id FROM genes WHERE trait_id = 0

Find all kitties with a dominant (visible) trait

Note: Use gene column (d/r1/r2/r3) or the numeric gene_n column (0/1/2/3): Let's use the trait savannah (fur) with the id 0 and a dominant (d) gene:

SELECT kitty_id FROM  genes
                WHERE trait_id = 0 AND gene='d'

Find all kitties with two traits (in any gene d/r1/r2/r3)

Use two query with "intersect" the result. Let's use the trait savannah (fur) with the id 0 and the trait tiger (pattern) with the id 33:

SELECT kitty_id FROM genes WHERE trait_id = 0
INTERSECT
SELECT kitty_id FROM genes WHERE trait_id = 33

Using Models w/ ActiveRecord in Ruby

Find all kitties with a trait

Let's use the trait savannah (fur) with the id 0:

Kitty.find_by( body: Trait.find_by( name: 'savannah' ))
# -or -
Kitty.find_by( body_id: 0)

Find all kitties with two traits

Let's use the trait savannah (fur) with the id 0 and the trait tiger (pattern) with the id 33:

Kitty.find_by( body:    Trait.find_by( name: 'savannah' ),
               pattern: Trait.find_by( name: 'tiger' ))
# -or -
Kitty.find_by( body_id: 0, pattern_id: 33 )

Find all kitties with a trait (in any gene d/r1/r2/r3)

Let's use the trait savannah (fur) with the id 0:

genes = Gene.find_by( trait: Trait.find_by( name: 'savannah' ))  # query
#-or-
genes = Gene.find_by( trait_id: 0 )
genes.map { |gene| gene.kitty }                                  # get kitties (from gene)

Find all kitties with a dominant (visible) trait

Let's use the trait savannah (fur) with the id 0 and a dominant (d) gene:

genes = Gene.find_by( trait: Trait.find_by( name: 'savannah' ),
                      d:     'd' )                               #query
#-or-
genes = Gene.find_by( trait_id: 0, d: 'd' )
genes.map { |gene| gene.kitty }                                  # get kitties (from gene)

Find all kitties with two traits

Use two query with "intersect" the result. Let's use the trait savannah (fur) and the trait tiger (pattern):

genes = Gene.select('kitty_id').where( trait: Trait.find_by( name: 'savannah' )).intersect(
        Gene.select('kitty_id').where( trait: Trait.find_by( name: 'pattern' )))
genes.map { |gene| gene.kitty }     # get kitties (from gene)

Datasets

(Crypto) Kitties on the Blockchain - public dataset in comma-separated values (CSV) format in blocks of a thousand kitties each (e.g. 000.csv incl. 1-999, 001.csv incl. 1000-1999, 002.csv incl. 2000-2999, and so on). The data records for kitties incl. id, gen(eration), matron+sire ids, birthdate, 48 (12x4) genes in kai (base32) notation, and more.

Add your dataset here!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].