{"id":23353855,"url":"https://github.com/epicchainlabs/epicchain-sdk-go","last_synced_at":"2025-04-07T19:21:14.313Z","repository":{"id":266652298,"uuid":"805197715","full_name":"epicchainlabs/epicchain-sdk-go","owner":"epicchainlabs","description":"EpicChain SDK Go is a powerful and efficient software development kit designed for developers to integrate and interact with the EpicChain blockchain network using the Go programming language.","archived":false,"fork":false,"pushed_at":"2024-12-09T05:10:36.000Z","size":2385,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-13T20:49:48.367Z","etag":null,"topics":["blockchain-integration","blockchain-sdk","blockchain-tools","epicchain","epicchain-sdk","go-blockchain","go-developers","go-ecosystem","go-programming","smart-contract-development"],"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/epicchainlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit/collect.go","citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-24T04:47:05.000Z","updated_at":"2024-12-09T05:10:39.000Z","dependencies_parsed_at":"2024-12-05T11:38:09.295Z","dependency_job_id":null,"html_url":"https://github.com/epicchainlabs/epicchain-sdk-go","commit_stats":null,"previous_names":["epicchainlabs/epicchain-sdk-go"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epicchainlabs%2Fepicchain-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epicchainlabs%2Fepicchain-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epicchainlabs%2Fepicchain-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epicchainlabs%2Fepicchain-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epicchainlabs","download_url":"https://codeload.github.com/epicchainlabs/epicchain-sdk-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713264,"owners_count":20983683,"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-integration","blockchain-sdk","blockchain-tools","epicchain","epicchain-sdk","go-blockchain","go-developers","go-ecosystem","go-programming","smart-contract-development"],"created_at":"2024-12-21T09:16:44.085Z","updated_at":"2025-04-07T19:21:14.284Z","avatar_url":"https://github.com/epicchainlabs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# epicchain-sdk-go\nGo implementation of epicchain SDK. It contains high-level version-independent wrappers\nfor structures from [epicchain-api-go](https://github.com/nspcc-dev/epicchain-api-go) as well as\nhelper functions for simplifying node/dApp implementations.\n\n## Repository structure\n\n### accounting\nContains fixed-point `Decimal` type for performing balance calculations.\n\n### eacl\nContains Extended ACL types for fine-grained access control.\nThere is also a reference implementation of checking algorithm which is used in EpicChian node.\n\n### checksum\nContains `Checksum` type encapsulating checksum as well as it's kind.\nCurrently Sha256 and [Tillich-Zemor hashsum](https://github.com/nspcc-dev/tzhash) are in use.\n\n### owner\n`owner.ID` type represents single account interacting with EpicChian. In v2 version of protocol\nit is just raw bytes behing [base58-encoded address](https://docs.neo.org/docs/en-us/basic/concept/wallets.html#address)\nin Neo blockchain. Note that for historical reasons it contains\nversion prefix and checksum in addition to script-hash.\n\n### token\nContains Bearer token type with several EpicChian-specific methods.\n\n### ns\nIn EpicChian there are 2 types of name resolution: DNS and NNS. NNS stands for Neo Name Service\nis just a [contract](https://github.com/nspcc-dev/epicchain-contract/) deployed on a Neo blockchain.\nBasically, NNS is just a DNS-on-chain which can be used for resolving container nice-names as well\nas any other name in dApps. See our [CoreDNS plugin](https://github.com/nspcc-dev/coredns/tree/master/plugin/nns)\nfor the example of how NNS can be integrated in DNS.\n\n### session\nTo help lightweight clients interact with EpicChian without sacrificing trust, EpicChian has a concept\nof session token. It is signed by client and allows any node with which a session is established\nto perform certain actions on behalf of the user.\n\n### client\nContains client for working with EpicChian.\n```go\nvar prmInit client.PrmInit\nprmInit.SetDefaultPrivateKey(key) // private key for request signing\n\nc, err := client.New(prmInit)\nif err != nil {\n    return\n}\n\nvar prmDial client.PrmDial\nprmDial.SetServerURI(\"grpcs://localhost:40005\") // endpoint address\n\nerr := c.Dial(prmDial)\nif err != nil {\n    return\n}\n    \nctx, cancel := context.WithTimeout(context.Background(), 5 * time.Second)\ndefer cancel()\n\nvar prm client.PrmBalanceGet\nprm.SetAccount(acc)\n\nres, err := c.BalanceGet(ctx, prm)\nif err != nil {\n    return\n}\n\nfmt.Printf(\"Balance for %s: %v\\n\", acc, res.Amount())\n```\n\n#### Response status\nIn EpicChian every operation can fail on multiple levels, so a single `error` doesn't suffice,\ne.g. consider a case when object was put on 4 out of 5 replicas. Thus, all request execution\ndetails are contained in `Status` returned from every RPC call. dApp can inspect them\nif needed and perform any desired action. In the case above we may want to report\nthese details to the user as well as retry an operation, possibly with different parameters.\nStatus wire-format is extendable and each node can report any set of details it wants.\nThe set of reserved status codes can be found in\n[EpicChian API](https://github.com/nspcc-dev/epicchain-api/blob/master/status/types.proto).\n\n### policy\nContains helpers allowing conversion of placing policy from/to JSON representation\nand SQL-like human-readable language.\n```go\np, _ := policy.Parse(`\n    REP 2\n    SELECT 6 FROM F\n    FILTER StorageType EQ SSD AS F`)\n\n// Convert parsed policy back to human-readable text and print.\nprintln(strings.Join(policy.Encode(p), \"\\n\"))\n```\n\n### netmap\nContains CRUSH-like implementation of container node selection algorithm. Relevant details\nare described in this paper http://ceur-ws.org/Vol-2344/short10.pdf . Note that it can be\noutdated in some details.\n\n`netmap/json_tests` subfolder contains language-agnostic tests for selection algorithm. \n\n```go\nimport (\n    \"github.com/nspcc-dev/epicchain-sdk-go/netmap\"\n    \"github.com/nspcc-dev/epicchain-sdk-go/object\"\n)\n\nfunc placementNodes(addr *object.Address, p *netmap.PlacementPolicy, epicchainNodes []netmap.NodeInfo) {\n    // Convert list of nodes in EpicChian API format to the intermediate representation.\n    nodes := netmap.NodesFromInfo(nodes)\n\n    // Create new netmap (errors are skipped for the sake of clarity). \n    nm, _ := NewNetmap(nodes)\n\n    // Calculate nodes of container.\n    cn, _ := nm.GetContainerNodes(p, addr.ContainerID().ToV2().GetValue())\n\n    // Return list of nodes for each replica to place object on in the order of priority.\n    return nm.GetPlacementVectors(cn, addr.ObjectID().ToV2().GetValue())\n}\n```\n\n### pool\nSimple pool for managing connections to EpicChian nodes.\n\n### acl, checksum, version, signature\nContain simple API wrappers.\n\n### logger\nWrapper over `zap.Logger` which is used across EpicChian codebase.\n\n### util\nUtilities for working with signature-related code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepicchainlabs%2Fepicchain-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepicchainlabs%2Fepicchain-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepicchainlabs%2Fepicchain-sdk-go/lists"}