{"id":20728979,"url":"https://github.com/gers2017/zenode","last_synced_at":"2025-09-05T08:05:13.256Z","repository":{"id":59854924,"uuid":"539667896","full_name":"Gers2017/zenode","owner":"Gers2017","description":"Abstraction layer on top of p2panda to interact with p2panda nodes","archived":false,"fork":false,"pushed_at":"2023-04-06T22:42:58.000Z","size":108,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T15:06:20.511Z","etag":null,"topics":["abstraction","aquadoggo","cryptography","graphql","p2p","p2panda","peer-to-peer","rust","schema","utility-library"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/zenode","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gers2017.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-21T20:11:21.000Z","updated_at":"2023-03-25T18:01:20.000Z","dependencies_parsed_at":"2022-09-23T11:11:05.540Z","dependency_job_id":null,"html_url":"https://github.com/Gers2017/zenode","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gers2017%2Fzenode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gers2017%2Fzenode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gers2017%2Fzenode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gers2017%2Fzenode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gers2017","download_url":"https://codeload.github.com/Gers2017/zenode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250504081,"owners_count":21441524,"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":["abstraction","aquadoggo","cryptography","graphql","p2p","p2panda","peer-to-peer","rust","schema","utility-library"],"created_at":"2024-11-17T04:40:48.742Z","updated_at":"2025-04-23T19:48:13.266Z","avatar_url":"https://github.com/Gers2017.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Zenode\n\n## What is this project\n\nThis project is an abstraction layer between the client and the p2panda node by\nproviding tools to easily perform operations on a p2panda node.\n\n### Before you start\n\nIn order to run this you first need to install [aquadoggo](https://github.com/p2panda/aquadoggo)\n\n```sh\ngit clone https://github.com/p2panda/aquadoggo.git\n\nRUST_LOG=aquadoggo=info cargo run\n```\n\nThe `Operator` struct is the main wrapper around the p2panda library and the graphql layer.\n\nTo create a new `Operator` use `Operator::default()` or `Operator::new()`.\n\n`Operator::default()` reads the `ENDPOINT` environment variable, if is not present it uses `http://localhost:2020/graphql` as default endpoint.\n\nRun the following to test `Zenode` (aquadoggo must be running in the background):\n\n```sh\ncargo test\n```\n\n## Quick start\n\n```rs\nuse zenode::{field, Operator};\nuse zenode::FieldType::*;\n\n// create an Operator\nlet op = Operator::default();\n\n// create a schema\nlet id = op.create_schema(\n    \"POKEMON\",\n    \"Pokemon schema\",\n    \u0026mut [\n        field_def(\"pokemon_id\", Int), // same as field(\"pokemon_id\", \"int\")\n        field_def(\"pokemon_name\", Str),\n    ]\n).await?;\n\n// generate schema_id\nlet schema_id = format!(\"POKEMON_{}\", id);\n\n// create an instance\nlet instance_id = op.create_instance(\u0026schema_id, \u0026mut [\n    field(\"pokemon_id\", \"1\"), field(\"pokemon_name\", \"Bulbasaur\")\n]).await?;\n\n// update the instance\nlet update_id = op.update_instance(\u0026schema_id, \u0026instance_id, \u0026mut [\n    field(\"pokemon_name\", \"Charmander\")\n]).await?;\n\n// finally delete the instance\nlet _delete_id = op.delete_instance(\u0026schema_id, \u0026update_id).await?;\n```\n\n## Experimental Schema Builder\n\n```rs\nlet op = Operator::default();\n\nlet mut puppy_builder = SchemaBuilder::new(\"puppy\", \"Puppy schema\", \u0026op)\n    .field(\"name\", Str)\n    .field(\"cuteness\", Int);\n\npuppy_builder.build().await?;\n\nlet tiramisu_id = puppy_builder\n    .instantiate(\u0026mut [field(\"name\", \"Tiramisu\"), field(\"cuteness\", \"200\")])\n    .await?;\n```\n\n## Features\n\n-   [x] Create schemas\n-   [x] Crate fields\n-   [x] Crate instance\n-   [x] Update instance\n-   [x] Delete instance\n-   [x] Read endpoint from env\n-   [x] Better field to json\n-   [ ] Save schema_id\n-   [ ] Link schema name with schema_id\n-   [ ] Serializable query string\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgers2017%2Fzenode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgers2017%2Fzenode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgers2017%2Fzenode/lists"}