eos icon indicating copy to clipboard operation
eos copied to clipboard

Allow EOSC to accept alternate HTTP host/port

Open pmesnier opened this issue 9 years ago • 9 comments

I attached this comment to issue #203 but it seems to have been overlooked. It should be a separate issue anyway, Here's my original request:

'm looking for the most appropriate way to override the default host/port to which eosc sends the messages. I've thought of: eosc --server host:port command ..., eosc @host:port commmand ... eosc command@host:port ....

in each case, an omitted host or port value is defaulted. In the case of streaming mode, I'd like this value to be changeable so that commands can be spread across many nodes. For that reason I'd prefer the second or third options listed above.

pmesnier avatar Aug 30 '17 12:08 pmesnier

my vote is --server host:port to have all command line tools have a typical way of passing in command line args

On Wed, Aug 30, 2017 at 7:43 AM, Phil Mesnier [email protected] wrote:

I attached this comment to issue #203 https://github.com/EOSIO/eos/issues/203 but it seems to have been overlooked. It should be a separate issue anyway, Here's my original request:

'm looking for the most appropriate way to override the default host/port to which eosc sends the messages. I've thought of: eosc --server host:port command ..., eosc @host https://github.com/host:port commmand ... eosc command@host:port ....

in each case, an omitted host or port value is defaulted. In the case of streaming mode, I'd like this value to be changeable so that commands can be spread across many nodes. For that reason I'd prefer the second or third options listed above.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EOSIO/eos/issues/269, or mute the thread https://github.com/notifications/unsubscribe-auth/AJy1W_G_ZZIxpypZlUkJ-hEC6mlSFfcTks5sdVj9gaJpZM4PHU7u .

brianjohnson5972 avatar Aug 30 '17 13:08 brianjohnson5972

Yeah, but eosc command line is already different from all other command lines.

pmesnier avatar Aug 30 '17 13:08 pmesnier

So far eosc has no configuration flags, these are all parameters related to the command being processed ("create", "accounts", ...)

it is a very typical to see:

./ [--some-flag value] [--another-flag value] command [first-param [second-param ...]]

On Wed, Aug 30, 2017 at 8:26 AM, Phil Mesnier [email protected] wrote:

Yeah, but eosc command line is already different from all other command lines.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EOSIO/eos/issues/269#issuecomment-325989306, or mute the thread https://github.com/notifications/unsubscribe-auth/AJy1W7sQ5VC_cYkjq4T7J4SR486m37bVks5sdWMGgaJpZM4PHU7u .

brianjohnson5972 avatar Aug 30 '17 13:08 brianjohnson5972

Right, but in a way you are reinforcing my point. I want the host:port to vary by command so that in a streaming mode, where commands are fed through stdin, successive commands can be sent to different nodes.

pmesnier avatar Aug 30 '17 14:08 pmesnier

I also need to be able to specify the walletd endpoint.

heifner avatar Aug 30 '17 14:08 heifner

How is eosc command line different from other command lines? I designed it to be as typical as possible. Did I make a mistake? :P

The canonically correct way to add a server flag would be --server host:port and I think that's the best way to do it, just as @brianjohnson5972 described.

As to streaming mode... that's a much bigger can of worms, and I'm not convinced it makes sense to have eosc support it at all. The whole point of eosc in the first place was that we weren't going to reimplement the shell in it. This streaming mode is equivalent to writing a new shell, and is thus what eosc is supposed to not be. Eosc was designed to support that use case by using the shell to invoke it multiple times. If that's not fast enough, your use case is niche enough it may require its own utility.

And @heifner, it seems to me that all wallet-related logic should be in a wallet subcommand, no? That subcommand could have a walletd endpoint parameter. Would that work?

nathanielhourt avatar Aug 30 '17 16:08 nathanielhourt

And @heifner, it seems to me that all wallet-related logic should be in a wallet subcommand, no? That subcommand could have a walletd endpoint parameter. Would that work?

yes

heifner avatar Aug 30 '17 17:08 heifner

Ok. If eosc is going to be restricted to issuing a single command then terminating, use of --server is fine and dandy. My motivation for creating the stream to begin with was to allow eosc to hold a connection open for a good long time in order to remove process startup/teardown + TCP socket connection and disconnection from the commanding overhead, but from what Dan found that most of the time is JSON related, my "optimization" is not particularly advantageous. I think we found the HTTP plugin shuts down the connection anyway so even TCP connection is just part of every call's overhead.

So let's add --server host:port.

pmesnier avatar Aug 30 '17 17:08 pmesnier

it looks like @bytemaster added host and port options for eosc in d16254c

it does not match the --server pattern but covers the needed functionality

wanderingbort avatar Sep 12 '17 22:09 wanderingbort