{"id":18301790,"url":"https://github.com/kfsoftware/hlf-cc-go-template","last_synced_at":"2025-07-31T17:36:19.668Z","repository":{"id":111517042,"uuid":"446813344","full_name":"kfsoftware/hlf-cc-go-template","owner":"kfsoftware","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-29T21:04:22.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T04:18:45.438Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kfsoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-01-11T12:31:36.000Z","updated_at":"2023-11-21T18:07:18.000Z","dependencies_parsed_at":"2023-06-01T20:15:44.733Z","dependency_job_id":null,"html_url":"https://github.com/kfsoftware/hlf-cc-go-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfsoftware%2Fhlf-cc-go-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfsoftware%2Fhlf-cc-go-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfsoftware%2Fhlf-cc-go-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfsoftware%2Fhlf-cc-go-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kfsoftware","download_url":"https://codeload.github.com/kfsoftware/hlf-cc-go-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248017976,"owners_count":21034042,"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-05T15:17:00.551Z","updated_at":"2025-04-09T09:46:38.625Z","avatar_url":"https://github.com/kfsoftware.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## HLF go chaincode template\n\n### Start tunnel\n```bash\nngrok tcp 9999\n```\n\n### Install, approve and commit chaincode\n```bash\nCHAINCODE_NAME=template_go\nAPI_URL=\"http://localhost:8080/graphql\"\nSIGNATURE_POLICY=\"OR('Org1MSP.member', 'Org2MSP.member')\"\nCHAINCODE_ADDRESS_TUNNEL=\"4.tcp.eu.ngrok.io:13438\" # the forwarding URL you get from opening an ngrok tunnel\nhlf-cc-dev start --localChaincode=\"localhost:9999\" \\\n  --chaincodeAddress=\"${CHAINCODE_ADDRESS_TUNNEL}\" \\\n  --chaincode=\"${CHAINCODE_NAME}\" \\\n  --signaturePolicy=\"${SIGNATURE_POLICY}\" \\\n  --env-file=\"${PWD}/.env\" \\\n  --apiUrl=\"${API_URL}\"\n```\n\n### Start chaincode\n\n```bash\nsource .env \u0026\u0026 go run ./main.go\n```\n\n### Test chaincode\n\nYou can go to the playground(instead of /graphql, use /playground) and use the following mutation and query to test the chaincode:\n\n```graphql\nmutation invoke {\n  invokeChaincode(input:{\n    chaincodeName:\"template_go\"\n    function: \"InitLedger\"\n    args: []\n    transientMap: []\n  }){\n    response\n    transactionID\n    chaincodeStatus\n  }\n}\n\nmutation query {\n  queryChaincode(input:{\n    chaincodeName:\"template_go\"\n    function: \"GetAllAssets\"\n    args: []\n    transientMap: []\n  }){\n    response\n    chaincodeStatus\n  }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfsoftware%2Fhlf-cc-go-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkfsoftware%2Fhlf-cc-go-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfsoftware%2Fhlf-cc-go-template/lists"}