本项目基于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 安装对应Nuget包
NuGet\Install-Package Algorand.sdk.net -Version 1.0.0
1.2 下载整个项目,添加对于Algorand.sdk.net的引用
见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
UserSecret.json配置完毕后,单元测试才能正常运行。
打开View -> TestExplorer。运行所有单元测试
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
}
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: [email protected]
拥有沃顿商学院: Economics of Blockchain and Digital Assets - Certificate
Badge验证链接: Economics of Blockchain and Digital Assets - Credly
原创不易,您的反馈是持续创新的动力。如果我的工作对您有帮助,还请收藏本项目、转发、请作者喝咖啡。
Algo address: EFIRPOWUEZIOGEBSR47R5WOEFIKSDBPA5UJERXX75GIIP3JTPBAI5PC7I4
An algorand sdk in .net core based on purestake.io.
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.
1.1 install the corresponding Nuget package
NuGet\Install-Package Algorand.sdk.net -Version 1.0.0
1.2 Download the entire project and add a reference to Algorand.sdk.net
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
Unit tests can only run properly after UserSecret.json is configured.
Open View -> TestExplorer. run all unit tests
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
}
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.
This project has developed a .NET Core class library based on purestake.io, and C# users can easily call Algorand related information.
#Rex Fan
Love C#, blockchain and other technologies.
Email: [email protected]
Linkedin: https://www.linkedin.com/in/rongfan1031/
With Wharton: Economics of Blockchain and Digital Assets - Certificate
Validation Badge URL: Economics of Blockchain and Digital Assets - Credly
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