{"id":37121727,"url":"https://github.com/activeledger/sdk-golang","last_synced_at":"2026-01-14T14:00:49.339Z","repository":{"id":57564838,"uuid":"158840244","full_name":"activeledger/SDK-Golang","owner":"activeledger","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-04T12:06:03.000Z","size":1008,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T13:31:50.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/activeledger.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-23T14:03:51.000Z","updated_at":"2021-04-06T17:39:14.000Z","dependencies_parsed_at":"2024-06-20T01:39:24.260Z","dependency_job_id":null,"html_url":"https://github.com/activeledger/SDK-Golang","commit_stats":{"total_commits":23,"total_committers":4,"mean_commits":5.75,"dds":0.5217391304347826,"last_synced_commit":"a1540fa014520bee554078a3c655f4259c7f39c2"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/activeledger/SDK-Golang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeledger%2FSDK-Golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeledger%2FSDK-Golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeledger%2FSDK-Golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeledger%2FSDK-Golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/activeledger","download_url":"https://codeload.github.com/activeledger/SDK-Golang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeledger%2FSDK-Golang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28422401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-14T14:00:48.028Z","updated_at":"2026-01-14T14:00:49.333Z","avatar_url":"https://github.com/activeledger.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://www.activeledger.io/wp-content/uploads/2018/09/Asset-23.png\" alt=\"Activeledger\" width=\"500\"/\u003e\n\n# Activeledger - Golang SDK\n\nThe Activeledger Golang SDK has been built to provide an easy way to connect your Go application to an Activeledger Network\n\n### Activeledger\n\n[Visit Activeledger.io](https://activeledger.io/)\n\n[Read Activeledgers documentation](https://github.com/activeledger/activeledger)\n\n## Installation\n\n```sh\ngo get github.com/activeledger/SDK-Golang\n```\n\n## Usage\n\nThe SDK currently supports the following functionality\n\n- Connection handling\n- Key generation\n- Key onboarding\n- Transaction building\n\n### Import\n\n```go\nimport (\n  sdk \"github.com/activeledger/SDK-Golang\"\n)\n```\n\n### Connection\n\nWhen sending a transaction, you must pass a connection that provides the information needed to establish a link to the network and specified node.\n\nTo do this a connection object must be created. This object must be passed the protocol, address, and port.\n\n```go\nconnection := sdk.Connection {\n  Scheme:\"protocol\",\n  Url:\"url\",\n  Port:\"port\"\n}\n\nsdk.SetUrl(connection)\n```\n\n#### Example - Connecting to the Activeledger public testnet\n\n```go\nconnection := sdk.Connection {\n  Scheme:\"http\",\n  Url:\"testnet-uk.activeledger.io\",\n  Port:\"5260\"\n}\n\nsdk.SetUrl(connection)\n```\n\n---\n\n### Key\n\nThere are two key types that can be generated currently, more are planned and will be implemented into Activeledger first. These types are RSA and Elliptic Curve.\n\n#### Generating a key\n\n##### Example\n\n```go\n// RSA\n// Generate the private key\nprivatekey := sdk.RsaKeyGen()\n// Get the public key from the private key\npublicKey := privatekey.PublicKey\n\n// ECDSA\nprivateKey, _ := sdk.EcdsaKeyGen()\n\n// See key exporting to get ECDSA Public key\n```\n\n#### Exporting Key\n\n##### Example\n\n```go\n// RSA Public key string PEM\n publicKeyString := sdk.RsaToPem(publicKey)\n\n// ECDSA private and public key PEMs\n privatekeyStr, publicKeyString := sdk.EcdsaToPem(privateKey)\n```\n\n#### Onboarding a key and creating a transaction\n\nOnce you have a key generated, to use it to sign transactions it must be onboarded to the ledger network\n\n##### Example\n\n```go\n txObject := sdk.TxObject {\n   Namespace: \"default\",\n   Contract: \"onboard\",\n   Input: input,\n   Output: output,\n   ReadOnly: readOnly,\n  }\n\n  tx, _ := json.Marshal(txObject)\n\n  // RSA\n  signedMessage,_ := sdk.RsaSign(*privatekey, []byte(tx))\n\n  // ECDSA (Elliptic curve)\n  pemPrivate := sdk.EcdsaFromPem(privatekeyStr)\n  signedMessage := sdk.EcdsaSign(pemPrivate,string(tx))\n\n  signature[\"identity\"] = signedMessage\n  selfsign := true\n  transaction := sdk.Transaction {\n    TxObject: txObject,\n    SelfSign: selfsign,\n    Signature:signature,\n  }\n\n  sdk.SetUrl(sdk.Connection {\n    Scheme:\"protocol\",\n    Url:\"url\",\n    Port:\"port\"\n  })\n\n  // Response contains Code (int) and Desc (string)\n  response := sdk.SendTransaction(transaction, sdk.GetUrl())\n```\n\n---\n\n#### Signing \u0026 sending a transaction\n\nWhen signing a transaction you must send the finished version of it. No changes can be made after signing as this will cause the ledger to reject it.\n\nThe key must be one that has been successfully onboarded to the ledger which the transaction is being sent to.\n\n## Events Subscription\n\nSDK contains different helper functions for the purpose of subscribing to different events.\n\n- Subscribe(host) // host=protocol://ip:port\n- SubscribeStream(host,stream)\n- EventSubscribeContract(host,contract,event)\n- EventSubscribe(host,contract)\n- AllEventSubscribe(host)\n\nThey all return events which can then be used by developers.\n\n## ActivityStreams\n\nSDK also contains helper functions to get and search streams from Activeledger.\n\n- GetActivityStreams(host, ids) // host=protocol://ip:port\n- GetActivityStream(host, id)\n- GetActivityStreamVolatile(host, id)\n- SetActivityStreamVolatile(host, id, bdy) // Anything in the bdy will be written to that location for that stream id.\n- GetActivityStreamChanges(host)\n- SearchActivityStreamPost(host, query) //post request\n- SearchActivityStreamGet(host, query) //get Request\n- FindTransaction(host, umid )\n\nThey all return map[string]interface{}.\n\n## License\n\n---\n\nThis project is licensed under the [MIT](https://github.com/activeledger/SDK-Golang/blob/master/LICENSE) License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factiveledger%2Fsdk-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factiveledger%2Fsdk-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factiveledger%2Fsdk-golang/lists"}