Algorand.sdk.net
1.0.0
dotnet add package Algorand.sdk.net --version 1.0.0
NuGet\Install-Package Algorand.sdk.net -Version 1.0.0
<PackageReference Include="Algorand.sdk.net" Version="1.0.0" />
<PackageVersion Include="Algorand.sdk.net" Version="1.0.0" />
<PackageReference Include="Algorand.sdk.net" />
paket add Algorand.sdk.net --version 1.0.0
#r "nuget: Algorand.sdk.net, 1.0.0"
#:package Algorand.sdk.net@1.0.0
#addin nuget:?package=Algorand.sdk.net&version=1.0.0
#tool nuget:?package=Algorand.sdk.net&version=1.0.0
Algorand.sdk.net
摘要
本项目基于Purestake.io,用户可以通过调用C#类库,得到、操作Algorand节点信息。
术语
区块链,一种高级数据库机制,允许在企业网络中透明地共享信息。 区块链数据库将数据存储在区块中,而数据库则一起链接到一个链条中。 数据在时间上是一致的,因为在没有网络共识的情况下,您不能删除或修改链条。 因此,您可以使用区块链技术创建不可改变的分类账,以便跟踪订单、付款、账户和其他交易。
Algorand,一个基于区块链的加密货币平台,以安全、高可扩展性与去中心化为宗旨。[1]阿尔戈兰德平台支持智能合约功能[2],其共识机制基于权益证明原则和拜占庭共识协议。[1][3][4]该平台的原生加密货币称为阿尔戈(Algo)。[2]
Algorand平台的研发由位于波士顿的阿尔戈兰公司(Algorand, Inc.)负责。2017年,麻省理工学院计算机科学教授、图灵奖得主希尔维奥·米卡利创办了这家公司。[5][6]
Algorand的测试网络于2019年4月向公众开放[7],主网络则于2019年6月开通。[8]
Purestake,专注于为有限的网络构建广泛的产品,这让我们开发了深入的主题专业知识,并将其交付给您以易于使用的服务。
Algorand.sdk.net,基于NetStandard和Net 6开发的跨平台类库,用户可以使用C#语言直接通过简单步骤获取algorand链上信息。根据用户反馈,后期可能增加Post操作。
使用步骤
1 安装依赖项
1.1 按照readme.md 提示,安装对应Nuget包
1.2 下载整个项目,添加对于Algorand.sdk.net的引用
2 设置基础信息
见Algorand.sdk.Net.UniTests, 其基础信息格式如下:
{
"Configuration": {
"HostAddress": "https://mainnet-algorand.api.purestake.io/ps2",
"ApiKey": "",
"TestAlgoAddress": "",
"LFOAssetId": "",
"ReserveAddress": ""
}
}
右击项目 Algorand.sdk.Net.UniTests → Manage UserSecret.json, 在其中配置真正的信息。
注意:UserSecret.json不会被上传到Git
3 运行TestCases
UserSecret.json配置完毕后,单元测试才能正常运行。
打开View → TestExplorer。运行所有单元测试
<img src="https://lh3.googleusercontent.com/GFSCIyCR6P5s7NfrGb-omgl2yyTNVIzfhPM-bRbhyeGRb2Snx_OXMIqZuIlHnDGsdUEMV9QrXEN5jX4Dn0nhkzbBQ5UAw6td1a-YiyB35gPRgDkZlnZG7weML2NGxLodGENmhC9UM6aJvChtbdrQ1N6hS2FilLgWoYX171f3JBLQO5IUCxlmx8Sb6w" title="" alt="" data-align="center">
4 常用案例
4.1 获取账户信息
var accountInfoResponse = await _clientV2.GetAccountInformationAsync(_testAlgoAddress);
var account = accountInfoResponse.Response == null ? null : (AlgoAccount)accountInfoResponse.Response;
Assert.IsTrue(accountInfoResponse.Succeed);
Assert.IsTrue(account.ActualBalance > 1);
#Response Json
{
"address": "",
"amount":,
"amount-without-pending-rewards":,
"apps-local-state": [],
"apps-total-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"assets": [
{
"amount":,
"asset-id":,
"is-frozen": false
}
],
"created-apps": [],
"created-assets": [],
"min-balance": 200000,
"pending-rewards": 0,
"reward-base": 218288,
"rewards": 0,
"round": 23961492,
"status": "Offline",
"total-apps-opted-in": 0,
"total-assets-opted-in": 1,
"total-created-apps": 0,
"total-created-assets": 0
}
4.2 获取Asset信息
var assetResponse = await _clientV2.GetAssetInformationAsync(_lfoAssetId);
Assert.IsTrue(assetResponse.Succeed);
Assert.IsTrue(assetResponse.Response != null);
#Response Json
{
"asset-holding": {
"amount":,
"asset-id":,
"is-frozen": false
},
"round":
}
更多案例,详见Algorand.sdk.Net.UnitTests测试Cases。
小结
本项目基于purestake.io开发了.NET Core 类库,C#使用者可以方便调用Algorand相关信息。
关于作者
热爱C#、区块链等技术。
Email: rex.fan18@gmail.com
拥有沃顿商学院: Economics of Blockchain and Digital Assets - Certificate
<img src="https://lh3.googleusercontent.com/9hJTqzfQFkwAkb88ah2WNwd7iTTshO0Ogyj3oVP7f3f6XMHf5lgOHe7IZyBi2_5RUwpV8blE4IgkXm8FgdwQDpAK3nx9tR_GHmcsGU5DJl723uLIzo0VkeVRER73zYdpgvClyoSKTeUpjVUi5Ghewe_qRp9qlMfj7-K51B4ELTsP2PSEQxmlmM-qLQ" title="" alt="" data-align="center">
Badge验证链接: Economics of Blockchain and Digital Assets - Credly
参考资料
原创不易,您的反馈是持续创新的动力。如果我的工作对您有帮助,还请收藏本项目、转发、请作者喝咖啡。
Algo address: EFIRPOWUEZIOGEBSR47R5WOEFIKSDBPA5UJERXX75GIIP3JTPBAI5PC7I4
Introduction
An algorand sdk in .net core based on purestake.io.
Terms
Blockchain, an advanced database mechanism that allows transparent sharing of information across corporate networks. Blockchain databases store data in blocks, and databases are linked together in a chain. The data is consistent in time because you cannot delete or modify the chain without network consensus. Therefore, you can use blockchain technology to create an immutable ledger in order to track orders, payments, accounts and other transactions.
Algorand, a blockchain-based cryptocurrency platform for security, scalability and decentralization. [1] The Algorand platform supports smart contract functions [2], and its consensus mechanism is based on the principle of proof of stake and Byzantine consensus protocol. [1][3][4] The platform’s native cryptocurrency is called Algo. [2] The Algorand platform is developed by Algorand, Inc., located in Boston. The company was founded in 2017 by MIT computer science professor and Turing Award winner Silvio Mikkali. [5][6] Algorand's testnet opened to the public in April 2019 [7], and the mainnet opened in June 2019. [8]
Purestake's focus on building a broad range of products for limited networks has allowed us to develop deep subject matter expertise and deliver it to you as an easy-to-use service.
Algorand.sdk.net, a cross-platform class library developed based on NetStandard and Net 6, users can use the C# language to directly obtain information on the algorand chain through simple steps. According to user feedback, Post operations may be added later.
Steps to Use
1 Install dependencies
1.1 Follow the instructions in readme.md to install the corresponding Nuget package
1.2 Download the entire project and add a reference to Algorand.sdk.net
2 Set basic information
See Algorand.sdk.Net.UniTests, the basic information format is as follows:
{
"Configuration": {
"HostAddress": "https://mainnet-algorand.api.purestake.io/ps2",
"ApiKey": "",
"TestAlgoAddress": "",
"LFOAssetId": "",
"ReserveAddress": ""
}
}
Right click on the project Algorand.sdk.Net.UniTests → Manage UserSecret.json, and configure the real information in it.
Note: UserSecret.json will not be uploaded to Git
3 Run TestCases
Unit tests can only run properly after UserSecret.json is configured.
Open View → TestExplorer. run all unit tests
<img src="https://lh3.googleusercontent.com/GFSCIyCR6P5s7NfrGb-omgl2yyTNVIzfhPM-bRbhyeGRb2Snx_OXMIqZuIlHnDGsdUEMV9QrXEN5jX4Dn0nhkzbBQ5UAw6td1a-YiyB35gPRgDkZlnZG7weML2NGxLodGENmhC9UM6aJvChtbdrQ1N6hS2FilLgWoYX171f3JBLQO5IUCxlmx8Sb6w" title="" alt="" data-align="center">
4 Common cases
4.1 Get account information
var accountInfoResponse = await _clientV2.GetAccountInformationAsync(_testAlgoAddress);
var account = accountInfoResponse.Response == null ? null : (AlgoAccount)accountInfoResponse.Response;
Assert.IsTrue(accountInfoResponse.Succeed);
Assert.IsTrue(account.ActualBalance > 1);
#Response Json
{
"address": "",
"amount":,
"amount-without-pending-rewards":,
"apps-local-state": [],
"apps-total-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"assets": [
{
"amount":,
"asset-id":,
"is-frozen": false
} }
],
"created-apps": [],
"created-assets": [],
"min-balance": 200000,
"pending-rewards": 0,
"reward-base": 218288,
"rewards": 0,
"round": 23961492,
"status": "Offline",
"total-apps-opted-in": 0,
"total-assets-opted-in": 1,
"total-created-apps": 0,
"total-created-assets": 0
}
4.2 Get Asset Information
var assetResponse = await _clientV2.GetAssetInformationAsync(_lfoAssetId);
Assert.IsTrue(assetResponse.Succeed);
Assert.IsTrue(assetResponse.Response != null);
#Response Json
{
"asset-holding": {
"amount":,
"asset-id":,
"is-frozen": false
},
"round":
}
For more cases, see Algorand.sdk.Net.UnitTests Test Cases.
Summary
This project has developed a .NET Core class library based on purestake.io, and C# users can easily call Algorand related information.
The Author
#Rex Fan
Love C#, blockchain and other technologies.
Email: rex.fan18@gmail.com
Linkedin: https://www.linkedin.com/in/rongfan1031/
With Wharton: Economics of Blockchain and Digital Assets - Certificate
<img title="" src="https://lh3.googleusercontent.com/9hJTqzfQFkwAkb88ah2WNwd7iTTshO0Ogyj3oVP7f3f6XMHf5lgOHe7IZyBi2_5RUwpV8blE4IgkXm8FgdwQDpAK3nx9tR_GHmcsGU5DJl723uLIzo0VkeVRER73zYdpgvClyoSKTeUpjVUi5Ghewe_qRp9qlMfj7-K51B4ELTsP2PSEQxmlmM-qLQ" alt="" data-align="center">
Validation Badge URL: Economics of Blockchain and Digital Assets - Credly
Reference
2 How to create your own Algorand token
Originality is not easy, your feedback is the driving force for continuous innovation.
If my work is helpful to you, please bookmark this project, forward it, or buy the author to drink coffee.
Algo address: EFIRPOWUEZIOGEBSR47R5WOEFIKSDBPA5UJERXX75GIIP3JTPBAI5PC7I4
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.1)
- System.Text.Json (>= 6.0.0)
-
net6.0
- Newtonsoft.Json (>= 13.0.1)
- System.Text.Json (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 367 | 10/8/2022 |