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

UX: pop up parachain #129

Closed
brunopgalvao opened this issue May 1, 2024 · 6 comments
Closed

UX: pop up parachain #129

brunopgalvao opened this issue May 1, 2024 · 6 comments
Assignees
Labels
DevEx Change to improve the Developer Experience

Comments

@brunopgalvao
Copy link
Contributor

There has been discussion around the pop up parachain command.

What if the user simply wants to spin up a Relay chain?
e.g. pop up parachain -f network.toml - where the network.toml file only has the Relay chain

Perhaps the command should be: pop up polkadot

Anyways, I have never seen a parachain run without a Relay chain so better UX would be to rename the pop up parachain command to pop up polkadot. This would equate to spinning up a Polkadot network. Whether it is a Polkadot network with 10 parachains or simply just the Relay chain, this command suffices.

Ser, what about Substrate solo chains? We can accommodate for this by having an additional command:

pop up chain

What we really want is to be in the directory of the project and for the command to be:

pop up

which would result in automatically either a) detect the network.toml file and spin up the network, or b) recognize that it is a Substrate solo chain and run it

Deliverables

Rename pop up parachain to pop up polkadot

Make it so pop up polkadot by itself, with no network.toml file, will spin up a Relay chain in dev mode

  • If the network.toml file exists in same directory, it overrrides, use that

Add an additional command to support Substrate solo chains: pop up chain

Make it so the user only has to run pop up and pop-cli will look in the directory for the network.toml file as well as detect whether it is a Substrate solo chain and deploy the network accordingly.

Nice-to-haves

Configuration files within Pop CLI for networks e.g. Acala, Moonbeam, etc.
User can then say: pop up acala or pop up acala, asset_hub, moonbeam

@brunopgalvao brunopgalvao added discussion DevEx Change to improve the Developer Experience labels May 1, 2024
@brunopgalvao brunopgalvao self-assigned this May 1, 2024
@AlexD10S
Copy link
Collaborator

AlexD10S commented May 1, 2024

I wouldn’t recommend changingpop up parachain to pop up polkadot
To me pop up parachain makes sense,In my mind the typical flow for a new user is as follows

pop new parachain
pop build parachain
pop up parachain -f network.toml

However I like the idea of pop up polkadot that spin up a Relay chain in dev mode or other chains.
So I'd vote in favour of having both: pop up parachain, pop up polkadot

@brunopgalvao
Copy link
Contributor Author

brunopgalvao commented May 3, 2024

We will not be touching

pop ___ parachain

So:

pop new parachain
pop build parachain

will remain intact.

However, if one wants to spin up a network they should be able to:

pop up

within the directory of their network.toml file.

Therefore no need for the command:

pop up parachain

If they are outside the project directory then:

pop up -p ./User/bruno/src/my_parachain -f ./User/bruno/src/my_parachain/network.toml

Preconfigured Relay chain + Parachains

If one wants to simply spin up a Polkadot network then:

pop up polkadot

spins up a Polkadot network in dev mode (Rococo/Paseo)

Similar to chopsticks, parachain teams can add their parachain config to pop-cli so:

pop up polkadot --parachains acala, moonbeam, asset_hub

And let's not forget those solo chains:

pop up

should detect that the working directory is a Substrate solo chain and run it.

Outside the directory:

pop up -p ./User/bruno/src/my_solo_chain

Proposal

Three deliverables

  1. Replace pop up parachain with pop up
  2. Add pop up polkadot command
  3. Add support for solo chain

@weezy20
Copy link
Contributor

weezy20 commented May 3, 2024

What do you have in mind for 3. Add support for solo chain?

@AlexD10S
Copy link
Collaborator

AlexD10S commented May 3, 2024

Personally I prefer the user to specify what he wants to do:

pop up parachain // Spin up your parachain
pop up contract // Deploy a SC

And then the new commands:

pop up polkadot // Spin up a Polkadot network
pop up chain // Spin up a solo chain

However, my opinion might be biased after using this tool so many times, so happy to change if the rest think is a better UX .

My only concern then on using 'pop up' instead of 'pop up parachain' is if this could lead to confusion when the same logic isn't applied to contracts, where the user has to type 'pop up contract'.

@brunopgalvao
Copy link
Contributor Author

Personally I prefer the user to specify what he wants to do:

pop up parachain // Spin up your parachain
pop up contract // Deploy a SC

The only reason we need the parachain or contract keyword in the following commands:

pop new parachain
pop new contract
pop build parachain
pop build contract
pop up parachain
pop up contract

is to differentiate between a parachain and a contract. If we only had one thing that we could create, build, and deploy then the commands would simply be

pop new
pop build
pop up

The UX should be done from a development workflow perspective.

For the pop build command the user should not have to type parachain or contract, Pop CLI should be smart enough to deduce that from the working directory. A smart contract dev will be in the contract directory... coding. A parachain dev will be inside the parachain directory.

For pop up, the development workflow is super important. For example, one cannot deploy a contract without a running first having a running network. Think in terms of the developer workflow:

  1. Dev creates a contract
  2. Dev wants to deploy the contract (contract dev spends all their time in the contract dir so they run Pop CLI from that perspective)
  3. Dev then spins up a network (Relay chain + contracts chain) because the dev needs a running network with a contracts chain to deploy their contract
  4. Dev deploys the contract for testing

Running a network is not equivalent to deploying a contract, therefore the commands should be different.

pop up

Will be the "gold standard" for running a network.

pop deploy contract

Will be the command to deploy a contract to a running network.

# will check working directory for the network.toml file and use that
# therefore every contract directory should have a network.toml file
pop up

Then

# deploying a contract is different than running a network, therefore the "deploy" command suits well 
# deploying a contract involves uploading and instantiating
pop deploy contract

For ease of development (and testing) there should also be pre-configured dev networks (and make this the default):

pop up --parachains pop_network, asset_hub

This would supersede the network.toml file.

Ideally, we should also have certain networks preconfigured so that when the user runs the following command:

pop up

Pop CLI will check the network.toml file for thos pre-configured networks e.g. pop-node and grab the binary automatically.

What do you have in mind for 3. Add support for solo chain?

pop up for solo chain as well. Pop CLI will check current directory and see if it is a solo chain.

@AlexD10S
Copy link
Collaborator

AlexD10S commented May 22, 2024

Closing this discussion to open specific issues addressing all the enhancements mentioned here:

  1. pop build without needing to specify if user wants to build a parachain or contract: Pop Build - Parachain/Contract cargo project detection on current working dir #91
  2. pop up contract run a node if localhost not running: pop up contract: run substrate-contracts-node if it does not exist #35
  3. pop deploy contract, rename pop up contract to pop deploy contract: refactor: rename pop up contract to pop deploy contract #189
  4. pop deploy polkadot feat: pop up polkadot #190
  5. pop up chain to run a solochain: Feature Request: Option to create a solochain pop new solochain #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevEx Change to improve the Developer Experience
Projects
None yet
Development

No branches or pull requests

3 participants