stellar / quickstart

Home of the stellar/quickstart docker image for development and testing
Apache License 2.0
186 stars 206 forks source link

Make all services optional #573

Closed leighmcculloch closed 6 months ago

leighmcculloch commented 6 months ago

What

Make all services optional.

By default all services run.

Or use the --enable flag to provide a comma-separated list of services to run.

To run quickstart with just rpc in testnet/pubnet:

docker run -i -p 8000:8000 stellar/quickstart --pubnet --enable rpc

Except in --local mode, where all services always run, because when running our own network we need a stellar-core to be the network, and a horizon for friendbot to use. In the future if friendbot was horizon-free, we might be able to change that.

Why

To make it possible to run lighter weight versions of quickstart with just what you need, such as just with soroban-rpc. Most of the time soroban developers only need the rpc when connected to live networks.

Close https://github.com/stellar/quickstart/issues/572

leighmcculloch commented 6 months ago

Tests failing appear to be related to Horizon starting up, for pubnet specifically, so I'm guessing this is a scale issue. Investigating...

leighmcculloch commented 6 months ago

TODO:

2opremio commented 6 months ago

Does this also make core optional? I am not sure we should be since captive core (in both horizon and rpc need it)

leighmcculloch commented 6 months ago

Does this also make core optional? I am not sure we should be since captive core (in both horizon and rpc need it)

It makes the core running on its own optional.

If horizon is running, it still runs its own core.

If rpc is running, it also still runs its own core.

So a core is always running, but instead multiple cores always running, we run the minimal amount needed for the software we plan to use.

Some examples of what is running:

--enable core,horizon,rpc: image

--enable core,horizon: image

--enable horizon: image

--enable rpc: image

2opremio commented 6 months ago

But, in local mode a core mode is needed. I hope it’s not optional then.

kalepail commented 6 months ago

Only request would be to remember to update the README. Might be good to do a full pass over it to ensure it's all still accurate and covers all the flags and meaningful cases

leighmcculloch commented 6 months ago

remember to update the README

Thanks, great call. I just pushed some updates to the readme for adding the new command and removing comments that no longer made sense.

leighmcculloch commented 6 months ago

@stellar/ops-team @mollykarcher The one functional difference for existing users that I think you might like to know about, is that as part of this change the RPC becomes on by default. It can be turned off by specifying that only core and horizon run with --enable core,horizon, but folks using it won't discover that in any meaningful or obvious way, unless they're looking at the logs and see that the RPC starts up. Having the RPC run will increase the memory usage, which might be unwelcome for someone using it today only using horizon. I don't think we have a great way to address this problem though. The image is primarily intended for dev and testing, and for dev and testing having RPC on by default makes sense, and the RPC is the future for non-historical data use too. Please let me know if you have any concerns.

jacekn commented 6 months ago

@leighmcculloch ack. The only downside to having soroban-rpc started by default I can think of isextra resource usage. But I think it shouldn't be a big problem.

mollykarcher commented 6 months ago

I think that's fine. We can actively advise those we know of that are using it for production use of this change as well.

cc @aditya1702