{"id":18698971,"url":"https://github.com/icefiredb/icefiredb-ipfs-log","last_synced_at":"2025-04-12T08:08:37.138Z","repository":{"id":61623563,"uuid":"528722860","full_name":"IceFireDB/icefiredb-ipfs-log","owner":"IceFireDB","description":"icefiredb-ipfs-log: distributed data storage and synchronization.","archived":false,"fork":false,"pushed_at":"2024-10-06T10:34:26.000Z","size":174,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T08:04:49.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IceFireDB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-08-25T06:26:13.000Z","updated_at":"2024-10-06T10:33:52.000Z","dependencies_parsed_at":"2024-11-07T11:34:01.861Z","dependency_job_id":"3adf8bf5-c37d-479f-bc79-e01f57ee04b0","html_url":"https://github.com/IceFireDB/icefiredb-ipfs-log","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceFireDB%2Ficefiredb-ipfs-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceFireDB%2Ficefiredb-ipfs-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceFireDB%2Ficefiredb-ipfs-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IceFireDB%2Ficefiredb-ipfs-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IceFireDB","download_url":"https://codeload.github.com/IceFireDB/icefiredb-ipfs-log/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537137,"owners_count":21120709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T11:30:29.515Z","updated_at":"2025-04-12T08:08:37.104Z","avatar_url":"https://github.com/IceFireDB.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# icefiredb-ipfs-log\n\nicefiredb-ipfs-log is a distributed immutable, operation-based conflict-free replication data structure that relies on ipfs to store data and merges each peer node data based on pubsub conflict-free.\nYou can easily implement custom data structures such as kv, event, nosql, etc. based on icefiredb-ipfs-log.\n\n### Conflict-free log replication model\n```shell\n           Log A                Log B\n             |                    |\n     logA.append(\"one\")   logB.append(\"hello\")\n             |                    |\n             v                    v\n          +-----+             +-------+\n          |\"one\"|             |\"hello\"|\n          +-----+             +-------+\n             |                    |\n     logA.append(\"two\")   logB.append(\"world\")\n             |                    |\n             v                    v\n       +-----------+       +---------------+\n       |\"one\",\"two\"|       |\"hello\",\"world\"|\n       +-----------+       +---------------+\n             |                    |\n             |                    |\n       logA.join(logB) \u003c----------+\n             |\n             v\n+---------------------------+\n|\"one\",\"hello\",\"two\",\"world\"|\n+---------------------------+\n```\n\n### Example of building a key-value database using icefiredb-ipfs-log\n- memory key-value：[memory-kv](./stores/kv/db.go)\n- leveldb kv      ：[leveldb-kv](./stores/levelkv/db.go)\n\n### Use of key-value databases\n[Detailed usage example reference](./example)\n```go\nfunc main() {\n    ctx := context.TODO()\n    // disk cache directory\n    rootPath := \"./kvdb\"\n    node, api, err := iflog.CreateNode(ctx, rootPath)\n    if err != nil {\n        panic(err)\n    }\n\t\n    hostAddr, _ := ma.NewMultiaddr(fmt.Sprintf(\"/ipfs/%s\", node.PeerHost.ID().Pretty()))\n    for _, a := range node.PeerHost.Addrs() {\n        fmt.Println(a.Encapsulate(hostAddr).String())\n    }\n    \n    log := zap.NewNop()\n    dbname := \"iflog-event-kv\"\n    ev, err := iflog.NewIpfsLog(ctx, api, dbname, \u0026iflog.EventOptions{\n        Directory: rootPath,\n        Logger:    log,\n    })\n    if err != nil {\n        panic(err)\n    }\n\t\n    if err := ev.AnnounceConnect(ctx, node); err != nil {\n        panic(err)\n    }\n    kvdb, err := kv.NewKeyValueDB(ctx, ev, log)\n    if err != nil {\n        panic(err)\n    }\n    // Load old data from disk\n    if err := ev.LoadDisk(ctx); err != nil {\n        panic(err)\n    }\n    kvdb.Put(ctx, \"one\", \"one\")\n    kvdb.Get(\"one\")\n    kvdb.Delete(ctx, \"one\")\n}\n```\n\n### Some code reference sources\n- [go-ipfs-log](https://github.com/berty/go-ipfs-log)\n\n## License\nicefiredb-ipfs-log is under the Apache 2.0 license. See the LICENSE directory for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficefiredb%2Ficefiredb-ipfs-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficefiredb%2Ficefiredb-ipfs-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficefiredb%2Ficefiredb-ipfs-log/lists"}