{"id":22809253,"url":"https://github.com/michielpost/siaskynet","last_synced_at":"2025-04-22T13:37:17.706Z","repository":{"id":43061119,"uuid":"266714690","full_name":"michielpost/SiaSkynet","owner":"michielpost","description":"Sia Skynet client","archived":false,"fork":false,"pushed_at":"2023-11-15T15:43:48.000Z","size":339,"stargazers_count":11,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T05:17:43.784Z","etag":null,"topics":["api-client","csharp","sia","sia-skynet","siacoin","skydb","skynet","web3"],"latest_commit_sha":null,"homepage":"","language":"C#","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/michielpost.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-05-25T07:37:29.000Z","updated_at":"2024-10-03T05:14:42.000Z","dependencies_parsed_at":"2023-01-21T18:00:13.429Z","dependency_job_id":null,"html_url":"https://github.com/michielpost/SiaSkynet","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michielpost%2FSiaSkynet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michielpost%2FSiaSkynet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michielpost%2FSiaSkynet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michielpost%2FSiaSkynet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michielpost","download_url":"https://codeload.github.com/michielpost/SiaSkynet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250249710,"owners_count":21399504,"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":["api-client","csharp","sia","sia-skynet","siacoin","skydb","skynet","web3"],"created_at":"2024-12-12T11:14:49.065Z","updated_at":"2025-04-22T13:37:17.640Z","avatar_url":"https://github.com/michielpost.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SiaSkynet C# SDK\n\nThis library enables all C# developers in the world to use SkyDB. \n\nOne of the most exciting features of this SDK is the full compatibility with [Blazor WebAssembly](https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor). Blazor allows you to create C# apps and run them entirely in the browser using WebAssembly. The app can then be uploaded to Skynet for hosting.\n\nCombining the large **C#** ecosystem with the power of **SkyDB** and the speed of **WebAssembly** makes this solution ready for a decentralized future!\n\nTry out the [Sample App](https://2g01e51a0vlfbhlq8oedvq2lvi482lld730jeglhtviifrjdh0aq08g.siasky.net/)\nor watch the [Video demo](https://siasky.net/AADKNi9ltyZ9yjxk3xpfrJeXBfjhpdSlUeFBCEMXa7hyaw)\n\nAlso see [SkyDocs](https://github.com/michielpost/SkyDocs)\n\n---\n\nSia Skynet client\n\n- Upload and download files from Sia Skynet.\n- Interact with the registry\n- Use SkyDB\n\n## How to use\nSee included test project and Blazor sample app.\n\nInstall: [SiaSkynet on NuGet](https://www.nuget.org/packages/SiaSkynet/)\n\nInitialize the client\n```cs\nvar _client = new SiaSkynetClient();\n```\n\nUpload a file\n```cs\nstring fileName = \"test.txt\";\nusing (var fileStream = File.OpenRead(fileName))\n{\n    var response = await _client.UploadFileAsync(fileName, fileStream);\n    var skylink = response.Skylink;\n}\n```\n\nDownload a file\n```cs\nstring skylink = \"AAAAQZg5XQJimI9FGR73pOiC2PnflFRh03Z4azabKz6bVw\";\nusing (var response = await _client.DownloadFileAsStreamAsync(skylink))\n{\n    using (StreamReader sr = new StreamReader(response))\n    {\n        string text = await sr.ReadToEndAsync();\n    }\n}\n```\n\nUse these methods if you also want the original filename and content type.\n```cs\n_client.DownloadFileAsStringAsync(skylink);\n_client.DownloadFileAsByteArrayAsync(skylink);\n```\n\n### SkyDB\nSupport for SkyDB\nhttps://siasky.net/docs/#skydb\n\nSet and get values on SkyDB:\n```cs\nvar key = await SiaSkynetClient.GenerateKeys(\"my private key seed\");\n\nvar success = await _client.SkyDbSetAsString(key.privateKey, key.publicKey, \"datakey\", \"data\");\n\nstring result = await _client.SkyDbGetAsString(key.publicKey, \"datakey\");\n\nAssert.AreEqual(\"data\", result);\n```\n\n### Registry\nSkyDB uses the Skynet Registry, it's also possible to interact with the registry using API's:\n- `siaSkynetClient.GetRegistry` \n- `siaSkynetClient.SetRegistry` \n- `siaSkynetClient.UpdateRegistry` which performs a get and a set with a new revision number\n\n## Reference\n- https://siasky.net\n- https://sia.tech/docs/#skynet\n\n## Apps that use this library:\nAre you using SiaSkynet? Get your app listed here! Edit this page and send a pull request.\n\n- [SkyDocs](https://github.com/michielpost/SkyDocs)\n- [Stresstest and Speedtest by autisticvegan](https://github.com/autisticvegan/siahackathonsubmission)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichielpost%2Fsiaskynet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichielpost%2Fsiaskynet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichielpost%2Fsiaskynet/lists"}