{"id":36702954,"url":"https://github.com/blocknetdx/go-xrouter","last_synced_at":"2026-01-12T11:39:59.050Z","repository":{"id":45366636,"uuid":"273130906","full_name":"blocknetdx/go-xrouter","owner":"blocknetdx","description":"XRouter golang library","archived":false,"fork":false,"pushed_at":"2022-02-07T12:17:10.000Z","size":1213,"stargazers_count":6,"open_issues_count":25,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-19T04:13:12.609Z","etag":null,"topics":["blocknet","golang","interoperability","xrouter"],"latest_commit_sha":null,"homepage":"https://blocknet.co","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/blocknetdx.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":"2020-06-18T03:15:48.000Z","updated_at":"2021-07-01T19:04:20.000Z","dependencies_parsed_at":"2022-08-27T18:50:29.185Z","dependency_job_id":null,"html_url":"https://github.com/blocknetdx/go-xrouter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/blocknetdx/go-xrouter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknetdx%2Fgo-xrouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknetdx%2Fgo-xrouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknetdx%2Fgo-xrouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknetdx%2Fgo-xrouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blocknetdx","download_url":"https://codeload.github.com/blocknetdx/go-xrouter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknetdx%2Fgo-xrouter/sbom","scorecard":{"id":243782,"data":{"date":"2025-08-11","repo":{"name":"github.com/blocknetdx/go-xrouter","commit":"0a3fdd435a34341fd4f6892ff24666de8b62d5b4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T07:08:19.758Z","repository_id":45366636,"created_at":"2025-08-17T07:08:19.758Z","updated_at":"2025-08-17T07:08:19.758Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"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":["blocknet","golang","interoperability","xrouter"],"created_at":"2026-01-12T11:39:58.988Z","updated_at":"2026-01-12T11:39:59.043Z","avatar_url":"https://github.com/blocknetdx.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"go-xrouter Library\n=====================================\n\nThe go-xrouter library allows go developers and ethereum developers to query blockchain data and oracles via Blocknet's XRouter interoperability protocol. Get started with XRouter without virtual machines or smart contracts in a few lines of code. The library queries the Blocknet network, obtains a list of service nodes (service providers), and submits requests to those service providers' oracles and microservices.\n\nhttps://blocknet.co\n\n[Website](https://blocknet.co) | [API](https://api.blocknet.co) | [Documentation](https://docs.blocknet.co) | [Discord](https://discord.gg/2e6s7H8)\n-------------|-------------|-------------|-------------\n\nGETTING STARTED\n---------------\n\nGo 1.14+ is required.\n\n### Step 1. Pull the library into your go workspace\n\n```\ngo get -d github.com/blocknetdx/go-xrouter\n```\n\n### Step 2. Create go application \"main.go\"\n\nmain.go\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"github.com/blocknetdx/go-xrouter/blockcfg\"\n\t\"github.com/blocknetdx/go-xrouter/xrouter\"\n\t\"log\"\n\t\"os\"\n\t\"time\"\n)\n\nfunc main() {\n\tlog.SetOutput(os.Stdout)\n\n\tconfig := blockcfg.MainnetParams\n\t// Manually set seed node (via ip or dns)\n\t//config.DNSSeeds = []chaincfg.DNSSeed{\n\t//\t{\"seed1.blocknet.co\", false}, // optional direct connect to trusted node\n\t//}\n\t// Instantiate the xrouter client\n\tclient, err := xrouter.NewClient(config)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\treturn\n\t}\n\t// Start xrouter (this will begin querying the network)\n\tclient.Start()\n\n\tctx, cancel := context.WithTimeout(context.Background(), 30 * time.Second)\n\tdefer cancel()\n\tdefer shutdown(client)\n\n\t// Wait for xrouter to be ready\n\tif ready, err := client.WaitForXRouter(ctx); err != nil || !ready {\n\t\terrStr := \"\"\n\t\tif err != nil {\n\t\t\terrStr = err.Error()\n\t\t}\n\t\tlog.Println(\"XRouter failed to connect and obtain service nodes\", errStr)\n\t\treturn\n\t}\n\tlog.Printf(\"XRouter is ready\")\n\n\t// List all network services\n\t//for _, service := range client.ListNetworkServices() {\n\t//\tlog.Printf(service)\n\t//}\n\n\tctx2, cancel2 := context.WithTimeout(ctx, 5 * time.Second)\n\tdefer cancel2()\n\tqueryCount := 1\n\tif err := client.WaitForServices(ctx2, []string{\"xrs::CCSinglePrice\",\"xr::BTC\"}, queryCount); err != nil {\n\t\tlog.Printf(\"error: %v\", err)\n\t\treturn\n\t}\n\n\t{\n\t\t// Query the price oracle to obtain Bitcoin's price in USD\n\t\tvar params []interface{}\n\t\tparams = append(params, \"BTC\", \"USD\")\n\t\tif reply, err := client.CallService(\"xrs::CCSinglePrice\", params, queryCount); err != nil {\n\t\t\tlog.Printf(\"error: %v\", err)\n\t\t\treturn\n\t\t} else {\n\t\t\tlog.Printf(\"result from %v: %v\", hex.EncodeToString(reply.Pubkey), string(reply.Reply))\n\t\t}\n\t}\n\n\t{\n\t\t// Query the BTC oracle to obtain the chain height\n\t\tif reply, err := client.GetBlockCount(\"xr::BTC\", queryCount); err != nil {\n\t\t\tlog.Printf(\"error: %v\", err)\n\t\t\treturn\n\t\t} else {\n\t\t\tlog.Printf(\"result from %v: %v\", hex.EncodeToString(reply.Pubkey), string(reply.Reply))\n\t\t}\n\t}\n}\n\nfunc shutdown(client *xrouter.Client) {\n\tif err := client.Stop(); err != nil {\n\t\tfmt.Printf(\"error shutdown: %v\", err)\n\t}\n}\n```\n\n### Step 3. Build and Run\n\n```go\ngo run main.go\n```\n\nLicense\n-------\n\nISC License\n\nCopyright (c) 2020 The Blocknet developers\n\nPermission to use, copy, modify, and distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocknetdx%2Fgo-xrouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblocknetdx%2Fgo-xrouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocknetdx%2Fgo-xrouter/lists"}