Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 62 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NEO Platform - C# Blockchain SDK
# NEO Platform

[![License](https://img.shields.io/github/license/Rapid-Loop/neo-platform)](https://github.com/Rapid-Loop/neo-platform/blob/master/LICENSE)
[![Stars](https://img.shields.io/github/stars/Rapid-Loop/neo-platform)](https://github.com/Rapid-Loop/neo-platform/stargazers)
Expand All @@ -7,105 +7,115 @@
[![Last Commit](https://img.shields.io/github/last-commit/Rapid-Loop/neo-platform)](https://github.com/Rapid-Loop/neo-platform/commits/master)
[![Verify Pull Request](https://github.com/Rapid-Loop/neo-platform/actions/workflows/verify.yml/badge.svg)](https://github.com/Rapid-Loop/neo-platform/actions/workflows/verify.yml)

**Official Rapid Loop fork and enterprise-enhanced rebuild of the NEO Blockchain Smart Economy Platform.**
**Modular Neo blockchain platform for C# / .NET** — maintained by [Rapid Loop](https://github.com/Rapid-Loop).

A modern, high-performance C# library for building on the **Neo blockchain** — designed for developers and enterprises who need reliability, scalability, and seamless integration.
A high-performance library set for building on **Neo**: core types, virtual machine, wallets, storage, and hosting integration. Aimed at developers and enterprises that need reliable packaging and a modern .NET experience.

This repository is **compatible with Neo protocol semantics**. It is Rapid Loop’s platform packaging and engineering work — **not** an “official Neo Foundation” product unless separately stated by Neo.

**Neo docs:** [developers.neo.org](https://developers.neo.org/) · **Neo site:** [neo.org](https://neo.org)

---

## 🌟 About This Project
## About

**neo-platform** is Rapid Loop's actively maintained fork of the Neo blockchain C# ecosystem. We are rebuilding and enhancing the Neo platform with enterprise-grade improvements for:
**neo-platform** is Rapid Loop’s actively developed Neo C# stack: modular packages, enterprise-friendly configuration and logging hooks, and a cleaner project layout for real systems.

- Better performance and scalability
- Modern developer experience
- Seamless integration with existing business systems
- Enhanced security and tooling
Use it when you need:

Whether you're building decentralized applications (dApps), smart contracts, wallets, or enterprise blockchain solutions, this SDK provides the core building blocks.
- Core blockchain types and serialization
- Neo VM execution
- Wallet formats (e.g. NEP-6) and account management
- RocksDB-backed blockchain storage
- .NET Generic Host / CLI integration

**Official Neo Website**: [neo.org](https://neo.org)
Led by a [neo-project](https://github.com/neo-project) contributor with core Neo development experience. Rapid Loop commercial work (integration, review, support) is separate from open-source contribution — see [Rapid-Loop](https://github.com/Rapid-Loop).

---

## ✨ Key Features
## Packages

- **Full Neo Compatibility** — Core blockchain, VM, cryptography, and wallet functionality
- **Enterprise Ready** — Robust configuration, logging, and integration tools
- **Modular Architecture** — Clean separation across packages:
- `Neo.Core` — Core blockchain logic
- `Neo.VM` — Virtual Machine
- `Neo.Cryptography` — Secure cryptographic primitives
- `Neo.Wallet` — Wallet management
- And more...
- **High Performance** — Optimized for real-world usage
- **Comprehensive Testing** — Full test suite included
- **NuGet Ready** — Easy package distribution
| Project | Role |
|---------|------|
| `Neo.Core` | Protocol types, crypto, P2P messages, serialization, VM opcodes / limits |
| `Neo.VM` | Execution engine, stack types, middleware pipeline |
| `Neo.Wallet` | Wallet abstractions, NEP-6 / dev wallets |
| `Neo.IO` | I/O helpers (hashing, bloom filter) |
| `Neo.Configuration` | Options and JSON converters for protocol / store settings |
| `Neo.Platform.Storage` | Blockchain store, snapshots, backups (RocksDB) |
| `Neo.Platform.Hosting` | Hosting, configuration, logging, command-line wiring |
| `Neo.Platform.CLI` | Sample / entry CLI host |
| `Neo.Localization` | Localized VM messages |

---

## 📁 Repository Structure
## Repository layout

```bash
```text
neo-platform/
├── src/ # Source code (multiple projects)
│ ├── Neo.Core/
│ ├── Neo.VM/
│ ├── Neo.Cryptography/
│ ├── Neo.Wallet/
│ └── ...
├── tests/ # Unit and integration tests
├── pkgs/ # Package distribution
├── .github/workflows/ # CI/CD pipelines
├── .images/ # Logos and assets
└── All.slnx # Solution file
├── src/ # Library and host projects
├── tests/ # Unit and integration tests
├── pkgs/ # NuGet package output
├── .github/workflows/ # CI
├── .images/ # Package / branding assets
└── All.slnx # Solution
```

---

## 🚀 Quick Start
## Quick start

### Clone

### 1. Clone the repository
```bash
git clone https://github.com/Rapid-Loop/neo-platform.git
cd neo-platform
```

### 2. Build the solution
### Build

```bash
dotnet build All.slnx
```

### 3. Run tests
### Test

```bash
dotnet test
dotnet test All.slnx
```

---

## 🛠️ Tech Stack
## Tech stack

- **Language**: `C# (.NET)`
- **Build System**: `dotnet`
- **CI/CD**: `GitHub Actions`
- **Language:** C# (.NET)
- **Build:** `dotnet` / `All.slnx`
- **CI:** GitHub Actions

---

## 📖 Documentation
## Documentation

- [Neo Official Documentation](https://developers.neo.org/)
- Check individual project folders for more details.
- [Neo developer documentation](https://developers.neo.org/)
- Public APIs use XML documentation comments (`///`) in source under `src/`
- Contribution guide: [CONTRIBUTING.md](CONTRIBUTING.md)

---

## 🤝 Contributing
## Contributing

We welcome contributions! See our [Contributing Guidelines](CONTRIBUTING.md) (create this file if needed).
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md).

---

## 📜 License
## License

This project is licensed under the **BSD-2-Clause License** — see the [LICENSE](LICENSE) file for details.
**BSD-2-Clause** — see [LICENSE](LICENSE).

---

## Contact

- **Org:** [github.com/Rapid-Loop](https://github.com/Rapid-Loop)
- **Website:** [rapidloop.net](https://rapidloop.net)
- **Email:** [github@rapidloop.net](mailto:github@rapidloop.net)
10 changes: 10 additions & 0 deletions src/Neo.Configuration/BlockchainBackupOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,20 @@

namespace Neo.Configuration
{
/// <summary>
/// Configuration options for blockchain store backups.
/// </summary>
public class BlockchainBackupOptions : JsonModel
{
/// <summary>
/// The directory path where backup files are stored.
/// Defaults to <c>data/backups</c> under the application base directory.
/// </summary>
public string BackupPath { get; init; } = Path.Combine(AppContext.BaseDirectory, "data", "backups");

/// <summary>
/// The maximum number of backup files to retain. Defaults to 3.
/// </summary>
public int MaxBackups { get; init; } = 3;
}
}
10 changes: 10 additions & 0 deletions src/Neo.Configuration/BlockchainStoreOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,20 @@

namespace Neo.Configuration
{
/// <summary>
/// Configuration options for the blockchain store database.
/// </summary>
public class BlockchainStoreOptions : JsonModel
{
/// <summary>
/// The directory path of the blockchain database.
/// Defaults to <c>data/chain</c> under the application base directory.
/// </summary>
public string DatabasePath { get; init; } = Path.Combine(AppContext.BaseDirectory, "data", "chain");

/// <summary>
/// Whether to create the database if it does not already exist. Defaults to <see langword="true"/>.
/// </summary>
public bool CreateIfMissing { get; init; } = true;
}
}
20 changes: 20 additions & 0 deletions src/Neo.Configuration/Json/Converters/JsonIPEndPointConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,22 @@

namespace Neo.Configuration.Json.Converters
{
/// <summary>
/// Converts <see cref="IPEndPoint"/> values to and from JSON strings.
/// Supports IP address and hostname forms (for example, <c>127.0.0.1:20333</c>).
/// </summary>
public class JsonIPEndPointConverter : JsonConverter<IPEndPoint?>
{
/// <summary>
/// Reads an <see cref="IPEndPoint"/> from a JSON string token.
/// </summary>
/// <param name="reader">The reader positioned at the JSON value.</param>
/// <param name="typeToConvert">The type to convert.</param>
/// <param name="options">The serializer options.</param>
/// <returns>
/// The parsed endpoint; when the string is empty or cannot be resolved, <see langword="null"/>.
/// </returns>
/// <exception cref="FormatException">Thrown when the token is not a JSON string.</exception>
public override IPEndPoint? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.String)
Expand Down Expand Up @@ -71,6 +85,12 @@ public class JsonIPEndPointConverter : JsonConverter<IPEndPoint?>
return default;
}

/// <summary>
/// Writes an <see cref="IPEndPoint"/> as a JSON string, or JSON null when the value is <see langword="null"/>.
/// </summary>
/// <param name="writer">The writer to which the value is written.</param>
/// <param name="value">The endpoint to write.</param>
/// <param name="options">The serializer options.</param>
public override void Write(Utf8JsonWriter writer, IPEndPoint? value, JsonSerializerOptions options)
{
if (value is null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,20 @@

namespace Neo.Configuration.Json.Converters
{
/// <summary>
/// Converts <see cref="UInt160"/> script hashes to and from NEO address JSON strings
/// using <see cref="ProtocolSettings.Default"/> address version.
/// </summary>
public class JsonStringAddressConverter : JsonConverter<UInt160?>
{
/// <summary>
/// Reads a <see cref="UInt160"/> from a NEO address string.
/// </summary>
/// <param name="reader">The reader positioned at the JSON value.</param>
/// <param name="typeToConvert">The type to convert.</param>
/// <param name="options">The serializer options.</param>
/// <returns>The script hash, or <see langword="null"/> when the string is empty.</returns>
/// <exception cref="FormatException">Thrown when the token is not a JSON string.</exception>
public override UInt160? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.String)
Expand All @@ -44,6 +56,12 @@ public class JsonStringAddressConverter : JsonConverter<UInt160?>
return valueString.ToScriptHash(ProtocolSettings.Default.AddressVersion);
}

/// <summary>
/// Writes a <see cref="UInt160"/> as a NEO address string, or JSON null when the value is <see langword="null"/>.
/// </summary>
/// <param name="writer">The writer to which the value is written.</param>
/// <param name="value">The script hash to write.</param>
/// <param name="options">The serializer options.</param>
public override void Write(Utf8JsonWriter writer, UInt160? value, JsonSerializerOptions options)
{
// TODO: Remove `ProtocolSettings.Default` and get from active ProtocolSettings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,19 @@

namespace Neo.Configuration.Json.Converters
{
/// <summary>
/// Converts <see cref="T:byte[]"/> values to and from UTF-8 encoded JSON strings.
/// </summary>
public class JsonStringByteArrayConverter : JsonConverter<byte[]?>
{
/// <summary>
/// Reads a byte array from a UTF-8 JSON string.
/// </summary>
/// <param name="reader">The reader positioned at the JSON value.</param>
/// <param name="typeToConvert">The type to convert.</param>
/// <param name="options">The serializer options.</param>
/// <returns>The UTF-8 bytes of the string, or <see langword="null"/> when the string is empty.</returns>
/// <exception cref="FormatException">Thrown when the token is not a JSON string.</exception>
public override byte[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.String)
Expand All @@ -42,6 +53,12 @@ public class JsonStringByteArrayConverter : JsonConverter<byte[]?>
return Encoding.UTF8.GetBytes(valueString);
}

/// <summary>
/// Writes a byte array as a UTF-8 JSON string, or JSON null when the value is <see langword="null"/>.
/// </summary>
/// <param name="writer">The writer to which the value is written.</param>
/// <param name="value">The bytes to write.</param>
/// <param name="options">The serializer options.</param>
public override void Write(Utf8JsonWriter writer, byte[]? value, JsonSerializerOptions options)
{
if (value is null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,21 @@

namespace Neo.Configuration.Json.Converters
{
/// <summary>
/// Converts <see cref="ECPoint"/> values to and from hex-encoded JSON strings on the secp256r1 curve.
/// </summary>
public class JsonStringECPointConverter : JsonConverter<ECPoint?>
{
/// <summary>
/// Reads an <see cref="ECPoint"/> from a hex-encoded JSON string.
/// </summary>
/// <param name="reader">The reader positioned at the JSON value.</param>
/// <param name="typeToConvert">The type to convert.</param>
/// <param name="options">The serializer options.</param>
/// <returns>The parsed point, or <see langword="null"/> when the string is empty.</returns>
/// <exception cref="FormatException">
/// Thrown when the token is not a JSON string, or the string is not a valid secp256r1 point.
/// </exception>
public override ECPoint? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.String)
Expand All @@ -45,6 +58,12 @@ public class JsonStringECPointConverter : JsonConverter<ECPoint?>
return value;
}

/// <summary>
/// Writes an <see cref="ECPoint"/> as a hex-encoded JSON string, or JSON null when the value is <see langword="null"/>.
/// </summary>
/// <param name="writer">The writer to which the value is written.</param>
/// <param name="value">The point to write.</param>
/// <param name="options">The serializer options.</param>
public override void Write(Utf8JsonWriter writer, ECPoint? value, JsonSerializerOptions options)
{
if (value is null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@

namespace Neo.Configuration.Json.Converters
{
/// <summary>
/// Converts <see cref="T:byte[]"/> values to and from lowercase hexadecimal JSON strings.
/// </summary>
public class JsonStringHexFormatConverter : JsonConverter<byte[]?>
{
/// <summary>
/// Reads a byte array from a hexadecimal JSON string.
/// </summary>
/// <param name="reader">The reader positioned at the JSON value.</param>
/// <param name="typeToConvert">The type to convert.</param>
/// <param name="options">The serializer options.</param>
/// <returns>The decoded bytes, or <see langword="null"/> when the string is empty.</returns>
/// <exception cref="FormatException">Thrown when the token is not a JSON string.</exception>
public override byte[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType != JsonTokenType.String)
Expand All @@ -41,6 +52,12 @@ public class JsonStringHexFormatConverter : JsonConverter<byte[]?>
return Convert.FromHexString(valueString);
}

/// <summary>
/// Writes a byte array as a lowercase hexadecimal JSON string, or JSON null when the value is <see langword="null"/>.
/// </summary>
/// <param name="writer">The writer to which the value is written.</param>
/// <param name="value">The bytes to write.</param>
/// <param name="options">The serializer options.</param>
public override void Write(Utf8JsonWriter writer, byte[]? value, JsonSerializerOptions options)
{
if (value is null)
Expand Down
Loading