{"id":18284570,"url":"https://github.com/libsv/go-spvchannels","last_synced_at":"2025-04-05T07:31:48.777Z","repository":{"id":38360826,"uuid":"386606960","full_name":"libsv/go-spvchannels","owner":"libsv","description":"The go-to SPV Channels client Go library. ","archived":false,"fork":false,"pushed_at":"2024-12-16T10:55:16.000Z","size":251,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T17:24:36.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libsv.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":"2021-07-16T11:03:50.000Z","updated_at":"2022-01-26T11:15:05.000Z","dependencies_parsed_at":"2024-06-19T17:38:50.108Z","dependency_job_id":"769f23f3-d2bb-4fb5-9475-fcbe99af653b","html_url":"https://github.com/libsv/go-spvchannels","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libsv%2Fgo-spvchannels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libsv%2Fgo-spvchannels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libsv%2Fgo-spvchannels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libsv%2Fgo-spvchannels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libsv","download_url":"https://codeload.github.com/libsv/go-spvchannels/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305875,"owners_count":20917198,"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-05T13:13:56.854Z","updated_at":"2025-04-05T07:31:43.768Z","avatar_url":"https://github.com/libsv.png","language":"Go","funding_links":["https://github.com/sponsors/libsv"],"categories":[],"sub_categories":[],"readme":"# go-spvchannels\n\n[![Release](https://img.shields.io/github/release-pre/libsv/go-spvchannels.svg?logo=github\u0026style=flat\u0026v=1)](https://github.com/libsv/go-spvchannels/releases)\n[![Go](https://github.com/libsv/go-bt/actions/workflows/run-tests.yml/badge.svg?branch=master)](https://github.com/libsv/go-bt/actions/workflows/run-tests.yml)\n[![Go](https://github.com/libsv/go-bt/actions/workflows/run-tests.yml/badge.svg?event=pull_request)](https://github.com/libsv/go-bt/actions/workflows/run-tests.yml)\n\n[![Report](https://goreportcard.com/badge/github.com/libsv/go-spvchannels?style=flat\u0026v=1)](https://goreportcard.com/report/github.com/libsv/go-spvchannels)\n[![codecov](https://codecov.io/gh/libsv/go-spvchannels/branch/master/graph/badge.svg?v=1)](https://codecov.io/gh/libsv/go-spvchannels)\n[![Go](https://img.shields.io/github/go-mod/go-version/libsv/go-spvchannels?v=1)](https://golang.org/)\n[![Sponsor](https://img.shields.io/badge/sponsor-libsv-181717.svg?logo=github\u0026style=flat\u0026v=3)](https://github.com/sponsors/libsv)\n[![Donate](https://img.shields.io/badge/donate-bitcoin-ff9900.svg?logo=bitcoin\u0026style=flat\u0026v=3)](https://gobitcoinsv.com/#sponsor)\n[![Mergify Status][mergify-status]][mergify]\n\n[mergify]: https://mergify.io\n[mergify-status]: https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/libsv/go-spvchannels\u0026style=flat\n\u003cbr/\u003e\n\nGo SPV Channels is a [golang](https://golang.org/) implementation of the [SPV Channels Server](https://github.com/bitcoin-sv/spvchannels-reference).\n\nThe library implement all rest api endpoints served in [SPV Channels Server](https://github.com/bitcoin-sv/spvchannels-reference) and the websocket client to listen new message notifications in real time.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Run tests](#run-tests)\n- [Setup Local SPV Channels server](#setup-local-spv-channels-server)\n- [License](#license)\n\n## Installation\n```\ngo get github.com/libsv/go-spvchannels\n```\n\n## Run tests\n\nRun unit test\n```\ngo clean -testcache \u0026\u0026 go test -v ./...\n```\n\nTo run integration tests, make sure you have `docker-compose up -d` on your local machine, then run\n```\ngo clean -testcache \u0026\u0026 go test  -race -v -tags=integration ./...\n```\n\n## Setup Local SPV Channels server\n\n#### Creating SSL key for secure connection\nFollowing the tutorial in the [SPV Channels Server](https://github.com/bitcoin-sv/spvchannels-reference), we first create the certificate using `openssl`:\n```\nterminal $\u003e openssl req -x509 -out localhost.crt -keyout localhost.key -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' -extensions EXT -config \u003c( printf \"[dn]\\nCN=localhost\\n[req]\\ndistinguished_name = dn\\n[EXT]\\nsubjectAltName=DNS:localhost\\nkeyUsage=digitalSignature\\nextendedKeyUsage=serverAuth\")\nterminal $\u003e openssl pkcs12 -export -out devkey.pfx -inkey localhost.key -in localhost.crt # use devkey as password\n```\n\nThat will create the `devkey.pfx` with password `devkey`. We then write a `docker-compose.yml` file following the tutorial.\n\n#### Launch local [SPV Channels Server](https://github.com/bitcoin-sv/spvchannels-reference) :\n```\ndocker-compose up -d\n```\n\n#### Create an account\nWe then need to create a SPV Channels account on the server\n```\ndocker exec spvchannels ./SPVChannels.API.Rest -createaccount spvchannels_dev dev dev\n```\n\n#### Usage with swagger\n\nThe [SPV Channels Server](https://github.com/bitcoin-sv/spvchannels-reference) run by `docker-compose.yml` listen on `localhost:5010`. We can start playing with the endpoints using swagger, i.e in browser, open `https://localhost:5010/swagger/index.html`\n\nFrom this page, there are a link `/swagger/v1/swagger.json` to export swagger file\n\n#### Usage with Postman\n\nInteracting with browser might have some difficulty related to adding certificate to the system. It might be easier to use Postman to interact as Postman has a easy possibility to disable SSL certificate check to ease development propose.\n\nFrom Postman, import the file `devconfig/postman.json` and set the environment config as follow\n\n| VARIABLE    | INITIAL VALUE  |\n| ----------- | -------------- |\n| URL_PORT    | localhost:5010 |\n| ACCOUNT     | 1              |\n| USERNAME    | dev            |\n| PASSWORD    | dev            |\n\nThese environment variable are used as _template_ to populate values in the `postman.json` file. There are a few more environment variable to define (look into the json file) that will depend to the endpoint and value created during the experience:\n\n| VARIABLE     | INITIAL VALUE   |\n| ------------ | --------------- |\n| CHANNEL_ID   | .. to define .. |\n| TOKEN_ID     | .. to define .. |\n| TOKEN_VALUE  | .. to define .. |\n| MSG_SEQUENCE | .. to define .. |\n| NOTIFY_TOKEN | .. to define .. |\n\n## License\n\n![License](https://img.shields.io/github/license/libsv/go-spvchannels.svg?style=flat\u0026v=1)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibsv%2Fgo-spvchannels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibsv%2Fgo-spvchannels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibsv%2Fgo-spvchannels/lists"}