neo icon indicating copy to clipboard operation
neo copied to clipboard

`[New]` CLI & Service Application

Open cschuchardt88 opened this issue 2 years ago • 22 comments

Description

This PR is to focus on the a new CLI & service. Also to fix the problems and bottlenecks at hand with the current CLI. The goal is not to change anything in core at least in this PR. But in the future will be changing Plugins and adding a WebServer in the CLI that Plugins can tie into.

How Basic Design Works

The way this is going to work is with two applications. One that is a Service that can run in linux with systemd and in windows as a WindowsService. The other application is a command-line based app that talks to the ServiceApp by using NamedPipes/IPC systems.

Features

  • [x] All things in current CLI
  • [x] Command-line based (With Prompt)
  • [x] IPC NamedPipes (For Service)
  • [ ] Multi-Node support
  • [x] Full Node
  • [ ] Lite Node
  • [ ] Development Node
  • [x] Consensus Node
  • [ ] Debug Server
  • [ ] Smart Contract Tracer
  • [x] Run as a OS Service
  • [ ] Offline mode
  • [ ] New archive/backup file format
  • [ ] Detailed mass logging - anything & everything
  • [ ] Plugin automation installation (download from nuget)
  • [x] Expanded configuration file - (config.json removed)
  • [ ] New wallet management system

More to come...

Your Feedback is Requested!

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] This change requires a documentation update

How Has This Been Tested?

  • Unit Tests

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules

cschuchardt88 avatar Jan 21 '24 14:01 cschuchardt88

Does it solve #3014?

roman-khimov avatar Jan 21 '24 15:01 roman-khimov

@roman-khimov Sure does

cschuchardt88 avatar Jan 21 '24 15:01 cschuchardt88

@shargon @roman-khimov @Jim8y @vncoelho

Any feature requests?

cschuchardt88 avatar Jan 27 '24 01:01 cschuchardt88

Very excellent work, i will test it later.

Jim8y avatar Jan 29 '24 15:01 Jim8y

@shargon @roman-khimov @Jim8y @vncoelho

Any feature requests?

@superboyiii

Jim8y avatar Jan 29 '24 15:01 Jim8y

I don't have any specific feature requests, if it solves #3014 and makes it easier to run node for various operators, it's good for me.

roman-khimov avatar Jan 29 '24 16:01 roman-khimov

@Jim8y still not finished. Just want to know the features up front as I'm building

@roman-khimov Yes it will be very easy and configurable.

cschuchardt88 avatar Jan 29 '24 19:01 cschuchardt88

why it shows "Error: Key" when I call help in the CLI command line

Jim8y avatar Jan 31 '24 13:01 Jim8y

@Jim8y This is a service, i haven't created CLI application yet to talk to the service. Just wanted to know what additional features you want beside the ones in the currently CLI as im building the application.

cschuchardt88 avatar Feb 01 '24 07:02 cschuchardt88

I think command like ./NeoService --openwallet /data/wallet.json to execute will be cool. People will never have to go into neo-cli to run command line. Neo-CLI can be a pure server in backend then. We can have much more like: --config config.json, --rpcport 10332, --wsport 10334, --enable-consensus, etc.

superboyiii avatar Feb 01 '24 08:02 superboyiii

I think command like ./NeoService --openwallet /data/wallet.json to execute will be cool. People will never have to go into neo-cli to run command line. Neo-CLI can be a pure server in backend then. We can have much more like: --config config.json, --rpcport 10332, --wsport 10334, --enable-consensus, etc.

It should work with the current commands

shargon avatar Feb 01 '24 09:02 shargon

@superboyiii @shargon it will be same commands with additions. But backend will be a service. There will be two applications one called neo-cli that we know and love; the other one called neo-host.

neo-host is the node service application that neo-cli communicates with through named pipes or on linux with unix sockets. Also neo-host can run as standalone service in the console. But you would still need to run neo-cli to talk to it.

Running neo-host as a standalone console application will show all the logs in the console instead of syslog or windows event log depending on your operating system.

Also this can run in azure services or any cloud provider.

cschuchardt88 avatar Feb 01 '24 09:02 cschuchardt88

Just to give you all an update. I'm currently developing a TraceApplicationEngine for the vm. A long with a new blockchain backup system like the chain.*.acc.zip. Old format is still supported.

cschuchardt88 avatar Feb 09 '24 20:02 cschuchardt88

@shargon @roman-khimov @Jim8y @vncoelho Inputs please...

The new neo-cli prompt will have different color schemes for different modes based off the mode you are in.

Modes

  • Developer : Compiled with debug vs release binary.
  • Failsafe : When you can't access or connect to the node or needs maintenance.
  • Debug : Developement mode (like how neo-express works)
  • Consensus: Running as a consensus node.
  • ColorBlind: For visually impaired.

Here is an Example (ANSI Terminal)

image

cschuchardt88 avatar Feb 17 '24 03:02 cschuchardt88

Here is an Example

Now we know N4 is blue.

As I've said, I'm OK with just about anything that fixes #3014, my only worry now probably is that we have a +3.6K PR again.

roman-khimov avatar Feb 17 '24 08:02 roman-khimov

@shargon @vncoelho @Jim8y The code in this PR is getting really big... are you all ok with that? It not even close to being finished or even having half the features the CLI is going to have.

cschuchardt88 avatar Mar 26 '24 22:03 cschuchardt88

I am ok @cschuchardt88 , if there is any core change maybe we migrate to another PR later. If changes are neo-node only I am fine.

But maybe we should think about merging it on 3.9.0.

This is a new project application all together. I hope it will be done by than... I'm solo rebuilding the whole CLI system along with new features...

cschuchardt88 avatar Mar 26 '24 23:03 cschuchardt88

Update - IPC Snapshot Command Prompt

image

cschuchardt88 avatar Apr 22 '24 09:04 cschuchardt88

@Jim8y @shargon

Should I just setup this PR up for review? It's Incomplete but this will become really big PR. I got the basic layout scaffold setup.

cschuchardt88 avatar Jun 16 '24 00:06 cschuchardt88

@Jim8y @shargon

Should I just setup this PR up for review? It's Incomplete but this will become really big PR. I got the basic layout scaffold setup.

create a branch and break this pr into smaller ones. That is currently the only way to make it work.

Jim8y avatar Jun 24 '24 00:06 Jim8y

@Jim8y @shargon Should I just setup this PR up for review? It's Incomplete but this will become really big PR. I got the basic layout scaffold setup.

create a branch and break this pr into smaller ones. That is currently the only way to make it work.

I'm ok with other branch. But how am I to break down PR for something that is built already. I'm not understanding that part.

cschuchardt88 avatar Jun 24 '24 00:06 cschuchardt88

an issue that list your plan, add few classes that has no dependency issues on every pr. i am not trying to make it hard for you, just current coredev protocol wont work well on long pr.

Jim8y avatar Jun 24 '24 00:06 Jim8y

See PR #3372 PAIRT-1 to PART-7

cschuchardt88 avatar Jul 18 '24 11:07 cschuchardt88