AElf Common is a foundational library for the AElf blockchain project. It contains essential types and helper classes that are used throughout the AElf system.
- Common Types: Basic data structures and types used across the AElf project, like
AElf.Types
andAElf.Kernel.Types
. - Helper Classes: Utility classes that provide common functionalities, like
AElf.Cryptography
. - Extensions: Extension methods to enhance the functionality of existing types.
- Infrastructure: Database implementation of AElf,
AElf.Database
.
To install AElf Common, add the following package to your project:
dotnet add package AElf.Common
Here are some examples of how to use the types and helper classes provided by AElf Common:
using AElf.Common;
public class Example
{
public void UseCommonType()
{
var hash = HashHelper.ComputeFrom("example");
Console.WriteLine(hash.ToHex());
var address = Address.FromPublicKey(GenerateKeyPair().PublicKey);
Console.WriteLine(address.ToBase58());
}
}
using AElf.Common.Helpers;
public class Example
{
public ECKeyPair GenerateKeyPair()
{
var ecKeyPair = CryptoHelper.GenerateKeyPair();
Console.WriteLine(ecKeyPair.PublicKey.ToHex());
return ecKeyPair;
}
}
Contributions are welcome! Please read the contributing guidelines before submitting a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.