{"id":21421672,"url":"https://github.com/uuosio/gscdk","last_synced_at":"2025-07-14T08:30:50.284Z","repository":{"id":41474332,"uuid":"400022138","full_name":"uuosio/gscdk","owner":"uuosio","description":"Go Smart Contracts Development Kit","archived":false,"fork":false,"pushed_at":"2023-05-24T02:19:19.000Z","size":6446,"stargazers_count":14,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-06T17:18:24.036Z","etag":null,"topics":["blockchain","go","smartcontract"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uuosio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-26T02:57:41.000Z","updated_at":"2025-06-09T03:21:09.000Z","dependencies_parsed_at":"2023-01-25T13:16:31.850Z","dependency_job_id":null,"html_url":"https://github.com/uuosio/gscdk","commit_stats":null,"previous_names":["uuosio/uuosio.gscdk"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/uuosio/gscdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuosio%2Fgscdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuosio%2Fgscdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuosio%2Fgscdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuosio%2Fgscdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uuosio","download_url":"https://codeload.github.com/uuosio/gscdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuosio%2Fgscdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262588,"owners_count":23736422,"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":["blockchain","go","smartcontract"],"created_at":"2024-11-22T20:37:02.364Z","updated_at":"2025-07-14T08:30:49.674Z","avatar_url":"https://github.com/uuosio.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Smart Contracts Development Kit (GSCDK)\n\n[![PyPi Version](https://img.shields.io/pypi/v/gscdk.svg)](https://pypi.org/project/gscdk)\n[![PyPi Downloads](https://img.shields.io/pypi/dm/gscdk.svg)](https://pypi.org/project/gscdk)\n\n## Overview\n\nThe Go Smart Contracts Development Kit (GSCDK) provides a comprehensive toolkit for creating, building, and debugging Go-based smart contracts. \n\n## Example of a Go Smart Contract\n\nHere is an example of what a Go Smart Contract looks like using GSCDK:\n\n```go\npackage main\n\nimport (\n\t\"github.com/uuosio/chain\"\n)\n\n//table mytable\ntype MyData struct {\n\tprimary uint64 //primary\n\tname    string\n}\n\n//contract mycontract\ntype MyContract struct {\n\tReceiver      chain.Name\n\tFirstReceiver chain.Name\n\tAction        chain.Name\n}\n\nfunc NewContract(receiver, firstReceiver, action chain.Name) *MyContract {\n\treturn \u0026MyContract{receiver, firstReceiver, action}\n}\n\n//action sayhello\nfunc (c *MyContract) SayHello(name string) {\n\tcode := c.Receiver\n\tpayer := c.Receiver\n\tmydb := NewMyDataDB(code)\n\tprimary := uint64(111)\n\tif it, data := mydb.GetByKey(primary); it.IsOk() {\n\t\tif data.name != name {\n\t\t\tchain.Println(\"Welcome new friend:\", name)\n\t\t} else {\n\t\t\tchain.Println(\"Welcome old friend\", name)\n\t\t}\n\t\tdata.name = name\n\t\tmydb.Update(it, data, payer)\n\t} else {\n\t\tchain.Println(\"Welcome new friend\", name)\n\t\tdata := \u0026MyData{primary, name}\n\t\tmydb.Store(data, payer)\n\t}\n}\n```\n\n\n## Quick Start\n\nJump right into building your first smart contract with our [Quick Start Guide](https://colab.research.google.com/github/uuosio/gscdk/blob/main/quickstart/quickstart.ipynb).\n\n## Installation\n\nTo install GSCDK, run the following command:\n\nFor Unix-based platforms (like Linux or macOS):\n\n```bash\npython3 -m pip install gscdk\n```\n\nFor Windows:\n\n```bash\npython -m pip install gscdk\n```\n\n### Upgrading GSCDK\n\nIf you've previously installed GSCDK and want to upgrade to the latest version, use the following command:\n\nFor Unix-based platforms:\n\n```bash\npython3 -m pip install --upgrade gscdk\n```\n\nFor Windows:\n\n```bash\npython -m pip install --upgrade gscdk\n```\n\n## Building Go Smart Contracts Compiler\n\nTo build the `tinygo` command that supports building Go Smart Contracts, follow the instructions in [Building](./BUILDING.md). Once built, add the `tinygo` command to your PATH:\n\n```bash\nexport PATH=$(pwd)/compiler/build:$PATH\n```\n\n## Using go-contract\n\n`go-contract` is a powerful tool for managing your smart contract projects. Learn more about its features below:\n\n### Initializing a Project\n\nUse the \"init\" command to initialize a project with a specific contract name:\n\n```bash\ngo-contract init mycontract\ncd mycontract\n```\n\n### Generating ABI and Extra Code\n\nUse the \"gencode\" command to generate ABI and extra code for smart contracts:\n\n```bash\ngo-contract gencode\n```\n\nNote: Code generation is also the default option for the \"build\" command.\n\n### Building Your Project\n\nTo compile the source code of your project, use the \"build\" command:\n\n```bash\ngo-contract build\n```\n\nTo disable code generation during the build process, use the `-gen-code=false` flag:\n\n```bash\ngo-contract build -gen-code=false\n```\n\nTo disable code optimization, use the `-d` or `--debug` option:\n\n```bash\ngo-contract build -d\n```\n\n## Debugging\n\nBefore debugging, install `ipyeos`:\n\n```bash\npython3 -m pip install ipyeos\n```\n\nTo update to a new version, use the following command:\n\n```bash\npython3 -m pip install -U ipyeos\n```\n\nThen run the debugging server:\n\n```bash\neosdebugger\n```\n\nOn Windows, use a Docker image to run a debugging server.\n\nFirst, pull ipyeos docker image:\n\n```bash\ndocker pull ghcr.io/uuosio/ipyeos:latest\n```\n\nthen start a debugging server from docker:\n```bash\ndocker run -it --rm -p 9090:9090 -p 9092:9092 -t ghcr.io/uuosio/ipyeos\n```\n\nHere's a sneak peek of the debugger in action:\n\n![Debugging](https://github.com/uuosio/gscdk/blob/main/images/debugging.gif)\n\n## Code Coverage Analysis\n\nTo generate a code coverage report in HTML, follow these steps:\n\n1. Build your project:\n\n```bash\ngo-contract build\n```\n\n2. Generate a coverage report:\n\n```bash\nTEST_COVERAGE=1 go test -coverprofile=coverage.out\n```\n\n3. Create an HTML report from the coverage data:\n\n```bash\ngo tool cover -html=coverage.out\n```\n\nHere's an example of what the code coverage report looks like:\n\n![Code Coverage](https://github.com/uuosio/gscdk/blob/main/images/code-coverage.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuuosio%2Fgscdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuuosio%2Fgscdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuuosio%2Fgscdk/lists"}