Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New] CLI & Service Application #3103

Closed
Closed
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
241 commits
Select commit Hold shift + click to select a range
1b75522
Init Neo.Node.Service
cschuchardt88 Jan 15, 2024
74abc2d
Added Cli command
cschuchardt88 Jan 15, 2024
976011c
Added node settings
cschuchardt88 Jan 15, 2024
8e00766
Project fixes
cschuchardt88 Jan 16, 2024
497359d
Merge remote-tracking branch 'Neo/master' into rebuild/cli-node
cschuchardt88 Jan 16, 2024
3149714
Added command pipe server to node service
cschuchardt88 Jan 16, 2024
54c2367
changed the namespace from Neo.Node.Service to Neo.Service
cschuchardt88 Jan 16, 2024
a2c11dd
Added block import process
cschuchardt88 Jan 17, 2024
94fd241
Added configuration for verification on importing blocks
cschuchardt88 Jan 17, 2024
9cbc2f8
Updated Configuration Settings for the node
cschuchardt88 Jan 17, 2024
103c1f3
Adding start and stop commands to IPC
cschuchardt88 Jan 17, 2024
1fb9c0d
Add until for PIpeCommand and changes return types
cschuchardt88 Jan 17, 2024
3719e15
Fixed NamedPipe Server and added unit test
cschuchardt88 Jan 21, 2024
1f12194
variable name changes
cschuchardt88 Jan 21, 2024
1038989
dotnet format
cschuchardt88 Jan 21, 2024
2bedf9f
Test Setup for github
cschuchardt88 Jan 21, 2024
2444897
Test typo fix
cschuchardt88 Jan 21, 2024
51b842c
Fixed tests
cschuchardt88 Jan 21, 2024
2c5070a
removed restore
cschuchardt88 Jan 21, 2024
7cd43bf
Fixed test for node
cschuchardt88 Jan 21, 2024
a7186e8
Add more time to timeout
cschuchardt88 Jan 21, 2024
49751e6
Added import for configuration files.
cschuchardt88 Jan 21, 2024
6d29f8a
Updated Service and fixed tests
cschuchardt88 Jan 21, 2024
b14fb1f
Fixed name
cschuchardt88 Jan 21, 2024
80e99f7
Changed to Memory as the default.
cschuchardt88 Jan 21, 2024
575e958
Fixed Pipe Server
cschuchardt88 Jan 26, 2024
3bb2779
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Jan 26, 2024
737cd41
Added named pipe protocol version unit test
cschuchardt88 Jan 26, 2024
222a588
Fixed github unit test for named pipes.
cschuchardt88 Jan 26, 2024
fefa56e
Fixed main.yml
cschuchardt88 Jan 26, 2024
f417e9b
Moved to systemd service to docs examples
cschuchardt88 Jan 27, 2024
2d709d4
Added better logging to PipeServer class
cschuchardt88 Jan 27, 2024
12affe8
Fixed PipeMethodAttribute for equals and hashcode
cschuchardt88 Jan 27, 2024
6869b37
Fixed up unit tests and workflow
cschuchardt88 Jan 31, 2024
30b4353
Added Logging for system
cschuchardt88 Jan 31, 2024
01e9b53
change made by dotnet format
Jim8y Jan 31, 2024
a3af2b7
Added some documentation for `Logging`
cschuchardt88 Feb 1, 2024
bd883e2
Merge branch 'rebuild/cli-node' of https://github.com/cschuchardt88/n…
cschuchardt88 Feb 1, 2024
86c7035
Fixed import task
cschuchardt88 Feb 1, 2024
df3669c
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Feb 1, 2024
062a8bc
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Feb 1, 2024
ae90a10
Fixed BlockchainArchiveFile format and added tests for it.
cschuchardt88 Feb 3, 2024
5d2cab3
Fixed `PipeServer` error handling
cschuchardt88 Feb 3, 2024
5f8704d
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Feb 3, 2024
95533d6
Class name change for `BlockchainArchiveFile` `BlockItems`
cschuchardt88 Feb 4, 2024
e536314
Added old `ACC` blockchain backup.
cschuchardt88 Feb 5, 2024
afa2231
fix git attributes
cschuchardt88 Feb 5, 2024
6450b7e
Updated *.zip file
cschuchardt88 Feb 5, 2024
6177baa
Fix project file
cschuchardt88 Feb 5, 2024
2d32807
More backup blockchain tests
cschuchardt88 Feb 6, 2024
e8a0467
Add Stashes
cschuchardt88 Feb 10, 2024
2be60d0
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Feb 10, 2024
c3380d3
Fix solution file
cschuchardt88 Feb 10, 2024
ce8da67
Add fixed barc file
cschuchardt88 Feb 10, 2024
b7a1812
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Feb 15, 2024
730a6b5
Added `NamedPipeTextReader`, `NamedPipeTextWritter`
cschuchardt88 Feb 16, 2024
0c4c4c9
Merge branch 'master' into rebuild/cli-node
Jim8y Feb 16, 2024
7bdeec1
Added Ansi string classes
cschuchardt88 Feb 17, 2024
4910279
Updated System.IO.Tests refs
cschuchardt88 Feb 17, 2024
7f1a06e
Merge branch 'rebuild/cli-node' of https://github.com/cschuchardt88/n…
cschuchardt88 Feb 17, 2024
33a7812
Added incomplete Ansi Console rendering for prompt
cschuchardt88 Feb 17, 2024
176c301
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Mar 14, 2024
b31446c
checkpoint
cschuchardt88 Mar 14, 2024
54252f0
dotnet format
cschuchardt88 Mar 14, 2024
8fc7afb
Update to Neo.Commandline
cschuchardt88 Mar 15, 2024
c9252ef
Added Neo.Commandline Prompt commands (default)
cschuchardt88 Mar 19, 2024
992d0d3
Add a few broadcast command
cschuchardt88 Mar 19, 2024
3885a0b
Added `neo-cmd` named pipe control, custom exceptions, tool extension…
cschuchardt88 Mar 21, 2024
ff62609
Added CreateBackupAsync named piping and sealed classes
cschuchardt88 Mar 21, 2024
8453f38
Cleaned up R&D and testing code
cschuchardt88 Mar 22, 2024
f1e5350
Imported classes from R&D projects to `Neo.Service.App`
cschuchardt88 Mar 22, 2024
887918e
Added start of the `archive` command and file processing; just backup…
cschuchardt88 Mar 23, 2024
6278e48
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Mar 23, 2024
90fc75a
Add `ExportCommand`, `BlocksCommand` for command-line with functionality
cschuchardt88 Mar 23, 2024
79b9933
Merge branch 'rebuild/cli-node' of https://github.com/cschuchardt88/n…
cschuchardt88 Mar 23, 2024
1d8057c
Added `Mutex`application thread locking
cschuchardt88 Mar 23, 2024
9ae9087
Fixed `RootCommand` to work with sub commands
cschuchardt88 Mar 24, 2024
53fce77
Enforce end-of-lines for `json` files
cschuchardt88 Mar 24, 2024
4f2c0f5
Added Crc32 hashing class to `neo` core library
cschuchardt88 Mar 24, 2024
729c451
Fixed enviroment configuration and setup for application
cschuchardt88 Mar 25, 2024
a40fa94
Added Wallet Funactions
cschuchardt88 Mar 25, 2024
c73f356
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Mar 25, 2024
9ef1cb7
Changed to `net8.0`
cschuchardt88 Mar 25, 2024
e26d0f7
Fix `Neo.Service`
cschuchardt88 Mar 25, 2024
14b3a00
Namespace changes
cschuchardt88 Mar 26, 2024
1cf2179
NamedPipe Classes
cschuchardt88 Mar 26, 2024
6b9890c
Refactoring
cschuchardt88 Mar 26, 2024
bb0f3ce
Namespace change from `Factory` to `Factories`
cschuchardt88 Mar 26, 2024
84f6f08
Removed `Neo.Service.App` test
cschuchardt88 Mar 26, 2024
e17bb2b
Rename from `Neo.Service.App` to `Neo.Hosting.App`
cschuchardt88 Mar 26, 2024
2ed7eb5
Fixed `Neo.IO.Tests` project
cschuchardt88 Mar 26, 2024
7a6dd91
`dotnet format`
cschuchardt88 Mar 26, 2024
ad00f95
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Mar 27, 2024
25e2c1a
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Apr 11, 2024
9083cfb
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Apr 17, 2024
e213a35
Added `SystemOptions.cs` and configuration in hosting system
cschuchardt88 Apr 17, 2024
c05c435
Added defaults to `SystemOptions` hosting configuration.
cschuchardt88 Apr 18, 2024
dc357ad
Updated `ExportCommand`
cschuchardt88 Apr 18, 2024
36cdf9f
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Apr 18, 2024
299ae8d
Added `SecureString` to `WalletOptions`
cschuchardt88 Apr 18, 2024
c2495c4
Fixed `ContractsOptions` class
cschuchardt88 Apr 18, 2024
4fccb18
Fixed output messages and text
cschuchardt88 Apr 18, 2024
9a0ae31
Changed `ILogger` for `BlocksExportCommand`
cschuchardt88 Apr 18, 2024
e5030fd
Changed `NullExceptionFilter` to display output for `DEBUG` build _ONLY_
cschuchardt88 Apr 18, 2024
bc6f9a6
Added `NamedPipes` to service commands
cschuchardt88 Apr 18, 2024
2097952
Added plumbing for `NamedPipes/IPC` hosted services
cschuchardt88 Apr 19, 2024
7f0833b
Added `NamedPipe` server/client tests
cschuchardt88 Apr 20, 2024
2cc3fa8
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Apr 20, 2024
411a945
Fixed hosting services `StartAsync` and `StopAsync`.
cschuchardt88 Apr 21, 2024
1ecd331
Added better configuration services for hosting system
cschuchardt88 Apr 22, 2024
c136dc0
dotnet format
cschuchardt88 Apr 22, 2024
ff2c61c
Setup basic remote `IPC` command prompt
cschuchardt88 Apr 22, 2024
09232b2
Started implementing `NamedPipe` protocol messages
cschuchardt88 Apr 23, 2024
caf98d0
Added/Updated `IPCProtocol` and added fixes
cschuchardt88 Apr 23, 2024
7c65211
Updated `github` workflow `main.yml` to test the new test for the new…
cschuchardt88 Apr 23, 2024
c3cf10b
fixed test coverage
cschuchardt88 Apr 23, 2024
0d8a5ac
Removed `Neo.IO.Tests` got copied somehow
cschuchardt88 Apr 24, 2024
e901c54
Restore `neo.dll` changes
cschuchardt88 Apr 24, 2024
f57fd2f
Fixes to the Environment in cli
cschuchardt88 Apr 24, 2024
6b69726
Refactored `BinaryUtilities` class and added tests for class
cschuchardt88 Apr 27, 2024
83b4aae
Fixed tests
cschuchardt88 Apr 30, 2024
94ee532
Added and Fixed tests for big strings with `BinaryUtilities` class
cschuchardt88 Apr 30, 2024
4a88a18
Optimized `BinaryUntilities` class methods
cschuchardt88 Apr 30, 2024
2b7539d
Removed `BinaryUtilities` class and added `StreamExtensions` for fast…
cschuchardt88 May 1, 2024
860f8ec
Merge branch 'master' into rebuild/cli-node
cschuchardt88 May 3, 2024
e3cdba5
Added `PipeMessage`, `IPipeException` and `PipeException` with tests
cschuchardt88 May 4, 2024
9fb4353
Merge branch 'rebuild/cli-node' of https://github.com/cschuchardt88/n…
cschuchardt88 May 4, 2024
651c957
Added `Span<byte>` extensions for writing unmanaged type to byte arrays
cschuchardt88 May 6, 2024
75be098
Merge branch 'master' into rebuild/cli-node
cschuchardt88 May 6, 2024
d86e505
Fixed `PipeException` for new `Span<byte>` extensions
cschuchardt88 May 6, 2024
411ebe9
Fixed tests and update pipe message classes
cschuchardt88 May 6, 2024
d95bd2e
Optimized memory management for main buffer in `PipeMessage` class
cschuchardt88 May 7, 2024
0da9f50
Marked classes `Console` command classes as `sealed`
cschuchardt88 May 7, 2024
fc1be52
Changed default timeout for `TaskExtensions` method `DefaultTimeout`
cschuchardt88 May 7, 2024
a3f2caf
Display and coding styles changes.
cschuchardt88 May 7, 2024
a47cf46
Removed stopping token from `IPC` host service.
cschuchardt88 May 7, 2024
6029926
Added display output for loaded plugins in the `NeoSystem` system.
cschuchardt88 May 7, 2024
6602a7b
Added `CopyTo` and `CopyFrom` methods for `byte[]` buffers
cschuchardt88 May 7, 2024
269bd7a
Removed span extensions and added byte array buffer class
cschuchardt88 May 8, 2024
277bc9e
Merge branch 'master' into rebuild/cli-node
cschuchardt88 May 8, 2024
413c2ae
Fixed up Prompt Console
cschuchardt88 May 8, 2024
a207022
Fixed `IsRunningAsService`; was getting checking if not a service
cschuchardt88 May 8, 2024
adc3b67
Removed `IO` Folder
cschuchardt88 May 8, 2024
e887492
Changed back to `neo-cmd` for application name
cschuchardt88 May 8, 2024
d40f4f3
Removed `neo-cmd` from internal access
cschuchardt88 May 8, 2024
772d280
Add more logging output to `NamedPipeConnectionListener` class
cschuchardt88 May 8, 2024
0382425
Change exception for `ReturnStream` method in `NamedPipeConnectionLis…
cschuchardt88 May 8, 2024
e575dc9
Added missing `ResturnStream` on `DisposeAsync` for `NamedPipConnection`
cschuchardt88 May 8, 2024
801bd40
Fixed `ConnectCommand` class
cschuchardt88 May 8, 2024
b37b6f6
dotnet format `ExitCode.cs`
cschuchardt88 May 8, 2024
553f6ae
Added `ILogger` output to `XUnit` test output
cschuchardt88 May 9, 2024
4447bfa
Updated tests to reflect `ILogger` for `XUnit`
cschuchardt88 May 9, 2024
a1398e9
dotnet format
cschuchardt88 May 10, 2024
8638528
refactoring namings
cschuchardt88 May 10, 2024
e61d22e
Merge branch 'master' into rebuild/cli-node
cschuchardt88 May 11, 2024
d71457e
Merge branch 'rebuild/cli-node' of https://github.com/cschuchardt88/n…
cschuchardt88 May 11, 2024
a26f758
Created NamedPipeServer
cschuchardt88 May 13, 2024
a3c6641
Merge branch 'master' into rebuild/cli-node
cschuchardt88 May 13, 2024
c34272c
Fixed Tests for NamedPipes
cschuchardt88 May 13, 2024
99b271f
Fixed PipeMessage
cschuchardt88 May 13, 2024
44681a8
Change name of Method
cschuchardt88 May 13, 2024
36fc1b3
Fixed reading ProcessMessageAsync
cschuchardt88 May 13, 2024
3bdf576
dotnet format
cschuchardt88 May 13, 2024
02cbd6d
Changed the name of class `ByteArrayBuffer` to `Struffer`
cschuchardt88 May 13, 2024
1739406
Update workflow
cschuchardt88 May 13, 2024
e4af462
Changed `ExportCommand.Block`
cschuchardt88 May 15, 2024
4689a43
Getting `ConnectCommand` ready for `IPCl`
cschuchardt88 May 15, 2024
5e6a57d
Changed `NeoOptions` `Remote` class `MAxPipes` from `string` to `int`
cschuchardt88 May 15, 2024
b161a9c
Added more helper methods to `IConsole` extensions
cschuchardt88 May 15, 2024
bff05c6
Added `Remote` section from `json` to the provider
cschuchardt88 May 15, 2024
594c55e
Removed `NamedPipe` builder and middleware unneeded
cschuchardt88 May 15, 2024
8ecb6b1
Service changes, Bug fixes, refactor namespaces and class names.
cschuchardt88 May 16, 2024
bbcdbd3
dotnet format
cschuchardt88 May 16, 2024
19e84ed
Changed `NeoHostingEnvironments` for linux non-case sensitive file paths
cschuchardt88 May 16, 2024
a56e864
Added basic `NamedPipeClient`
cschuchardt88 May 16, 2024
da1e5b5
format change of file
cschuchardt88 May 17, 2024
9e0a31a
Merge branch 'master' into rebuild/cli-node
cschuchardt88 May 17, 2024
dee77b6
Merge branch 'rebuild/cli-node' of https://github.com/cschuchardt88/n…
cschuchardt88 May 17, 2024
1d6a417
Added Return stream
cschuchardt88 May 17, 2024
91b3bff
Finished named pipe client
cschuchardt88 May 18, 2024
9aca27a
Finished named pipe client
cschuchardt88 May 18, 2024
dd76d74
Added `NeoFileLogger` and providers
cschuchardt88 May 18, 2024
42c95fe
Fixed `Logging` `NeoFile`
cschuchardt88 May 18, 2024
12ca2d8
Fixed `ExportCommand` to get `NeoOptions`
cschuchardt88 May 18, 2024
47b0536
Change `NeoFile` to `NeoError`
cschuchardt88 May 19, 2024
4b85ae7
Fixed `OutputDirectory`
cschuchardt88 May 19, 2024
83e722e
Added `IConsole` logger
cschuchardt88 May 20, 2024
56a28ff
Added `NamedPipeClient` tests
cschuchardt88 May 20, 2024
48b57c0
Renamed `NamedPipesSystemHostedService`
cschuchardt88 May 20, 2024
259d011
Fix tests
cschuchardt88 May 20, 2024
e551513
Added `NamedPipeClient` test names
cschuchardt88 May 20, 2024
e56ddd7
dotnet format
cschuchardt88 May 20, 2024
dbc6651
Clean up
cschuchardt88 May 20, 2024
52b5e47
Renamed `NamedPipeServerFactory` to `NamedPipeFactory`
cschuchardt88 May 20, 2024
618b0f5
Added `show version` command to prompt
cschuchardt88 May 20, 2024
78c5eba
Added back `CreateClientStream` to `NamedPipeFactory`
cschuchardt88 May 20, 2024
7de71f2
Merge branch 'master' into rebuild/cli-node
cschuchardt88 May 20, 2024
1a44e0e
Added `PipeSerializable` message
cschuchardt88 May 21, 2024
60ae0c7
Merge branch 'master' into rebuild/cli-node
cschuchardt88 May 23, 2024
4249e39
fixed `neo-sln`
cschuchardt88 May 23, 2024
a1e536e
dotnet format
cschuchardt88 May 23, 2024
b395a3b
Added option for `RemoteOptions` class
cschuchardt88 May 25, 2024
72fd4f5
Fixed nullable
cschuchardt88 May 25, 2024
af7aee7
Save Point
cschuchardt88 May 26, 2024
339bcb9
Changed `DownloadURL` to point to `neo` repo.
cschuchardt88 May 26, 2024
a07b3d7
Rename and added `GetCurrentHeight` method
cschuchardt88 May 28, 2024
fcb46b9
Fixed tests
cschuchardt88 May 29, 2024
ae27bba
Merge branch 'master' into rebuild/cli-node
cschuchardt88 May 29, 2024
b89414b
Rename files and Add `PipeUnmanagedPayload` with tests
cschuchardt88 May 29, 2024
2eb2830
Added `GetBlock` tests
cschuchardt88 May 29, 2024
0b2c834
Fixed file headers
cschuchardt88 May 29, 2024
1e30f53
Default configurations names changed.
cschuchardt88 May 30, 2024
d83f843
Added more commands
cschuchardt88 Jun 1, 2024
ccc2d8c
Add more commands
cschuchardt88 Jun 1, 2024
a11a198
Changed configuration of setting up tests and application
cschuchardt88 Jun 1, 2024
2f8d6ed
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Jun 1, 2024
eba2c95
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Jun 1, 2024
7bf2546
Add more command for `ContractCommand`
cschuchardt88 Jun 1, 2024
c71e875
Merge branch 'rebuild/cli-node' of https://github.com/cschuchardt88/n…
cschuchardt88 Jun 1, 2024
542c059
Added `DestroyCommand`
cschuchardt88 Jun 5, 2024
f189861
Add `PromptConfirm`
cschuchardt88 Jun 5, 2024
8b4c730
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Jun 5, 2024
106b049
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Jun 6, 2024
0d0233b
Added `NEP-17` Commands
cschuchardt88 Jun 6, 2024
e33cbe2
Add more `ShowCommands`
cschuchardt88 Jun 6, 2024
d2a3e77
Added `PluginCommands`
cschuchardt88 Jun 7, 2024
0a8f39c
Added `CandidateCommands`
cschuchardt88 Jun 8, 2024
236f23e
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Jun 8, 2024
6e80835
Added more `WalletCommands`
cschuchardt88 Jun 9, 2024
9011049
Fixed Delay for `NeoSystem` tests
cschuchardt88 Jun 9, 2024
7da9db5
Fixed `Tests` with `NeoSystem`
cschuchardt88 Jun 9, 2024
89b949f
Fixed Tests for `PipeSerializablePayload`
cschuchardt88 Jun 9, 2024
06d83d0
Fixed format of test logs
cschuchardt88 Jun 9, 2024
74184c5
Added `GetTransaction` for `PipeServer`
cschuchardt88 Jun 10, 2024
9e79833
Added `Block` and `Transaction` Tests
cschuchardt88 Jun 10, 2024
9afa31f
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Jun 11, 2024
7bce6c2
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Jun 16, 2024
526bf05
Added `OutputPath` to `Neo.Hosting.App`
cschuchardt88 Jun 20, 2024
1e45160
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Jun 20, 2024
df1a3ab
Merge branch 'master' into rebuild/cli-node
cschuchardt88 Jun 23, 2024
9393449
Removed dupe in `.gtattributes`
cschuchardt88 Jun 25, 2024
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
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Set default behavior to automatically normalize line endings.
###############################################################################
* text eol=lf
*.json text eol=lf

###############################################################################
# Set default behavior for command prompt diff.
Expand Down Expand Up @@ -45,6 +46,10 @@
*.gif binary
*.ico binary

# Zip files
*.zip binary
*.barc binary

###############################################################################
# diff behavior for common document formats
#
Expand Down
2 changes: 2 additions & 0 deletions SpellingExclusions.dic
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
barc
scripthash
8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Table of contents

1. [neo-host](cli/neo-host/README.md)
1. [Logs](cli/LOGS.md)
1. [Configuration](cli/neo-host/logs.md#Configuration)
1. [Filtering](cli/neo-host/logs.md#Example_Filtering)

---
1 change: 1 addition & 0 deletions docs/cli/neo-host/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This section is for `neo-host`.
125 changes: 125 additions & 0 deletions docs/cli/neo-host/logs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Logs

## Running as Service

### Windows
Uses `Windows Event Log` otherwise uses console.

### Linux
Uses `syslog` otherwise uses console.

## Configuration
Reference [Log Levels](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-8.0#log-level)
Reference [Log Scopes](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line#configure-logging-without-code)

## Scopes
- `Blockchain.Blocks.{hash}`
- `Blockchain.Transactions.{hash}`
- `Blockchain.Contracts.{hash}.Logs`
- `Blockchain.Contracts.{hash}.Events.{name}`

_Notes:_
1. _Replace `{hash}` with `ScriptHash`, `transaction hash` or `block hash` basic off it's category._
1. _Replace `{name}` with the event name of the contract._

## Example Filtering

### All Blockchain Log Data

```json
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information",
"Blockchain": "Trace"
}
},
```

**Above Includes**
- All `Runtime.Log`.
- All `Runtime.Notify` and contract events.
- All block data in `json` format.
- All transaction data in `json` format.

**Log Level**
- `Debug` - includes Notify events.
- `Trace` - includes Log events.

---

### All Contract Log Data

```json
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information",
"Blockchain.Contracts": "Trace"
}
},
```

**Above Includes**
- All `Runtime.Log`.
- All `Runtime.Notify` and contract events.

**Log Level**
- `Debug` - includes Notify events.
- `Trace` - includes Log events.

---

### All contracts transfer events.

```json
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information",
"Blockchain.Contracts.*.Events.Transfer": "Debug"
}
},
```

### Filter by Contract
This example we use the `GasToken` native contract; filtering by the `Transfer` event.

1. Add a new `json` section within `LogLevel` section with value `Blockchain.Contracts.{hash}.Events.{name}`.
1. We replaced `{hash}` with the `scripthash` of the contract; and `{name}` with the event name of the contract.
1. Set `json` string value to log level `Debug`.

### All events and logs.
```json
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information",
"Blockchain.Contracts.0xd2a4cff31913016155e38e474a2c06d08be276cf": "Debug"
}
},
```

### All events.
```json
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information",
"Blockchain.Contracts.0xd2a4cff31913016155e38e474a2c06d08be276cf.Events": "Debug"
}
},
```

### All transfers.
```json
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information",
"Blockchain.Contracts.0xd2a4cff31913016155e38e474a2c06d08be276cf.Events.Transfer": "Debug"
}
},
```

---
11 changes: 11 additions & 0 deletions docs/cli/systemd/examples/neo-host.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=NEO N3 blockchain node service

[Service]
Type=notify
Restart=always
TimeoutSec=5
RestartSec=10

[Install]
WantedBy=multi-user.target
32 changes: 30 additions & 2 deletions neo.sln
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.Cryptography.BLS12_381"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.Cryptography.BLS12_381.Tests", "tests\Neo.Cryptography.BLS12_381.Tests\Neo.Cryptography.BLS12_381.Tests.csproj", "{387CCF6C-9A26-43F6-A639-0A82E91E10D8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neo.IO", "src\Neo.IO\Neo.IO.csproj", "{4CDAC1AA-45C6-4157-8D8E-199050433048}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.Service", "src\Neo.Service\Neo.Service.csproj", "{A680BEF0-6895-4DA6-A355-304EEC9B4861}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neo.Extensions", "src\Neo.Extensions\Neo.Extensions.csproj", "{9C5213D6-3833-4570-8AE2-47E9F9017A8F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.Service.Tests", "tests\Neo.Service.Test\Neo.Service.Tests.csproj", "{6400F5B3-CFD6-4F95-A733-94A326B14B2C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.IO", "src\Neo.IO\Neo.IO.csproj", "{4CDAC1AA-45C6-4157-8D8E-199050433048}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.Extensions", "src\Neo.Extensions\Neo.Extensions.csproj", "{9C5213D6-3833-4570-8AE2-47E9F9017A8F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.IO.Tests", "tests\Neo.IO.Tests\Neo.IO.Tests.csproj", "{25D79A08-52D9-4808-A53F-E0C9626DDCBB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.Service.App", "src\Neo.Service.App\Neo.Service.App.csproj", "{2038D34A-C024-4207-8E22-600E98C33146}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -102,6 +110,14 @@ Global
{387CCF6C-9A26-43F6-A639-0A82E91E10D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{387CCF6C-9A26-43F6-A639-0A82E91E10D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{387CCF6C-9A26-43F6-A639-0A82E91E10D8}.Release|Any CPU.Build.0 = Release|Any CPU
{A680BEF0-6895-4DA6-A355-304EEC9B4861}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A680BEF0-6895-4DA6-A355-304EEC9B4861}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A680BEF0-6895-4DA6-A355-304EEC9B4861}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A680BEF0-6895-4DA6-A355-304EEC9B4861}.Release|Any CPU.Build.0 = Release|Any CPU
{6400F5B3-CFD6-4F95-A733-94A326B14B2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6400F5B3-CFD6-4F95-A733-94A326B14B2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6400F5B3-CFD6-4F95-A733-94A326B14B2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6400F5B3-CFD6-4F95-A733-94A326B14B2C}.Release|Any CPU.Build.0 = Release|Any CPU
{4CDAC1AA-45C6-4157-8D8E-199050433048}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CDAC1AA-45C6-4157-8D8E-199050433048}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CDAC1AA-45C6-4157-8D8E-199050433048}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -110,6 +126,14 @@ Global
{9C5213D6-3833-4570-8AE2-47E9F9017A8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C5213D6-3833-4570-8AE2-47E9F9017A8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C5213D6-3833-4570-8AE2-47E9F9017A8F}.Release|Any CPU.Build.0 = Release|Any CPU
{25D79A08-52D9-4808-A53F-E0C9626DDCBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25D79A08-52D9-4808-A53F-E0C9626DDCBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25D79A08-52D9-4808-A53F-E0C9626DDCBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25D79A08-52D9-4808-A53F-E0C9626DDCBB}.Release|Any CPU.Build.0 = Release|Any CPU
{2038D34A-C024-4207-8E22-600E98C33146}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2038D34A-C024-4207-8E22-600E98C33146}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2038D34A-C024-4207-8E22-600E98C33146}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2038D34A-C024-4207-8E22-600E98C33146}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -129,8 +153,12 @@ Global
{B40F8584-5AFB-452C-AEFA-009C80CC23A9} = {EDE05FA8-8E73-4924-BC63-DD117127EEE1}
{D48C1FAB-3471-4CA0-8688-25E6F43F2C25} = {B5339DF7-5D1D-43BA-B332-74B825E1770E}
{387CCF6C-9A26-43F6-A639-0A82E91E10D8} = {EDE05FA8-8E73-4924-BC63-DD117127EEE1}
{A680BEF0-6895-4DA6-A355-304EEC9B4861} = {B5339DF7-5D1D-43BA-B332-74B825E1770E}
{6400F5B3-CFD6-4F95-A733-94A326B14B2C} = {EDE05FA8-8E73-4924-BC63-DD117127EEE1}
{4CDAC1AA-45C6-4157-8D8E-199050433048} = {B5339DF7-5D1D-43BA-B332-74B825E1770E}
{9C5213D6-3833-4570-8AE2-47E9F9017A8F} = {B5339DF7-5D1D-43BA-B332-74B825E1770E}
{25D79A08-52D9-4808-A53F-E0C9626DDCBB} = {EDE05FA8-8E73-4924-BC63-DD117127EEE1}
{2038D34A-C024-4207-8E22-600E98C33146} = {B5339DF7-5D1D-43BA-B332-74B825E1770E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BCBA19D9-F868-4C6D-8061-A2B91E06E3EC}
Expand Down
25 changes: 25 additions & 0 deletions src/Neo.Extensions/AssemblyUtilities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// AssemblyUtilities.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using System.Reflection;

namespace Neo.Extensions
{
public static class AssemblyUtilities
{
public static int GetVersionNumber()
{
var version = Assembly.GetCallingAssembly().GetName().Version;
if (version is null) return 0;
return version.Major * 1000 + version.Minor * 100 + version.Build * 10 + version.Revision;
}
}
}
7 changes: 6 additions & 1 deletion src/Neo.Extensions/LogLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public enum LogLevel : byte
/// <summary>
/// The fatal log level.
/// </summary>
Fatal = Error + 1
Fatal = Error + 1,

/// <summary>
/// The trace log level.
/// </summary>
Trace = Fatal + 1,
}
}
1 change: 1 addition & 0 deletions src/Neo.IO/Neo.IO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<ItemGroup>
<InternalsVisibleTo Include="Neo" />
<InternalsVisibleTo Include="Neo.UnitTests" />
<InternalsVisibleTo Include="neo-cmd" />
<InternalsVisibleTo Include="$(AssemblyName).Tests" />
</ItemGroup>

Expand Down
44 changes: 44 additions & 0 deletions src/Neo.Service.App/Buffers/MemoryPoolBlock.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// MemoryPoolBlock.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using System;
using System.Buffers;
using System.Runtime.InteropServices;

namespace Neo.Service.App.Buffers
{
internal sealed class MemoryPoolBlock : IMemoryOwner<byte>
{
public PinnedBlockMemoryPool Pool { get; }

internal MemoryPoolBlock(
PinnedBlockMemoryPool pool,
int length)
{
Pool = pool;

var pinnedArray = GC.AllocateUninitializedArray<byte>(length, pinned: true);

Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
}

#region IMemoryOwner

public Memory<byte> Memory { get; }

void IDisposable.Dispose()
{
Pool.Return(this);
}

#endregion
}
}
68 changes: 68 additions & 0 deletions src/Neo.Service.App/Buffers/PinnedBlockMemoryPool.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (C) 2015-2024 The Neo Project.
//
// PinnedBlockMemoryPool.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using System;
using System.Buffers;
using System.Collections.Concurrent;

namespace Neo.Service.App.Buffers
{
internal sealed class PinnedBlockMemoryPool : MemoryPool<byte>
{
private const int AnySize = -1;

private static readonly int s_blockSize = 4096;

public static int BlockSize => s_blockSize;

public override int MaxBufferSize { get; } = s_blockSize;

private readonly ConcurrentQueue<MemoryPoolBlock> _blocks = new();
private readonly object _disposedSync = new();

private bool _isDisposed;

public override IMemoryOwner<byte> Rent(int size = AnySize)
{
ArgumentOutOfRangeException.ThrowIfGreaterThan(size, s_blockSize);
ObjectDisposedException.ThrowIf(_isDisposed, this);

if (_blocks.TryDequeue(out var block))
return block;

return new MemoryPoolBlock(this, BlockSize);
}

internal void Return(MemoryPoolBlock block)
{
if (_isDisposed == false)
_blocks.Enqueue(block);
}

protected override void Dispose(bool disposing)
{
if (_isDisposed)
return;

lock (_disposedSync)
{
_isDisposed = true;

if (disposing)
{
while (_blocks.TryDequeue(out _))
{
}
}
}
}
}
}
Loading
Loading