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

[OPS] Wishlist - Feature ideas #2102

Open
albttx opened this issue May 14, 2024 · 2 comments
Open

[OPS] Wishlist - Feature ideas #2102

albttx opened this issue May 14, 2024 · 2 comments

Comments

@albttx
Copy link
Member

albttx commented May 14, 2024

Description

Hello, after couple discussions with @zivkovicmilos and @thehowl about some ideas of features, they told me i should create a ticket to discuss about it.
This is a general ticket, if some feature makes debate, let's open smaller ticket to discuss about them.

1️⃣ $HOME/.gno

In cosmos-sdk, there is a feature i find cool is the client.toml file.
This file contains informations about the chain, like node (endpoint), chain-id, all client configurations to discuss with a blockchain.

Since in Gno philosophie, we want the gnoland-data folder to be only containing the chain data. it would be non-sense to put the client.toml file there.

My suggestions would be to to create a $HOME/gno folder where we could put a clients.toml (notice the S), to be able to have "context" (like in S3 clients), were we could replace commands like:

gnokey query -remote="http://rpc.staging.gno.land:36657" "bank/balances/g1qhuef2450xh7g7na8s865nreu2xw8j84kgkvt5"        

By having

#clients.toml
[default]
chain_id="dev"
remote="http://localhost:26657"

[staging]
chain_id="staging"
remote="http://rpc.staging.gno.land:36657"

[portal-loop]
chain_id="portal-loop"
remote="http://rpc.gno.land:26657"

So the command would be

gnokey query --ctx staging "bank/balances/g1qhuef2450xh7g7na8s865nreu2xw8j84kgkvt5"        

2️⃣ Put back default genesis.json file inside of the gnoland-data folder

I understand the feature and the benefit of having the genesis.json file outside of the folder but i don't believe it should be outside by default.

  • gnoland-data/config/genesis.json (tendermint style)
  • gnoland-data/genesis.json (make more sense with current folders)

It's so much simpler in multiple way... the other day i had issue because i was removing gnoland-data folder for having a new chain, and got errors because i forgot the genesis.json file.

3️⃣ gnoland init

There is already a LOT of PRs and public discussions about it, and i just want to find a solutions for this.

I understand @moul positions about UNIX style and avoid sugar syntax of tasks, but the default behavior is to do a simple init and after a start, and i don't believe really useful all the genesis init + secrets init + config init.

So here is some proposals that maybe could fit ?

Like migrating everything under init and having something like:

  • gnoland init (doing: gnoland init config + gnoland init genesis+gnoland init secrets`)

or by default and have the "lazy flags" for smaller cases like:

  • gnoland init --{config,secrets,genesis}-only

4️⃣ --data-dir into --home, remove --config-path

gnoland want to be simple. the CLI have different system which aren't logical.

with gnoland start i can set --data-dir, but i can't set a different --config-path, (which wouldn't make sense)

So in gnoland config init, i propose to update --config-path into --data-dir that will be {{ data_dir }}/config by default

  • what do you think about renaming --data-dir into --home ? (if $HOME/.gno is approved, it could be --gnhome :)
    even if i don't think gnoland will care of $HOME/.gno)
@moul
Copy link
Member

moul commented Jun 7, 2024

1️⃣ $HOME/.gno

About ~/gno, I believe we need to envision a future where we have multiple Gnovm chains while maintaining a unified language and a primary chain. In practice, I don't think we can say that ~/gno is solely for gno.land, but rather for the broader "Gnovm ecosystem" or just for the Gno language.

Having a client.toml file could make sense, but it should be specific to each zone or contain all the zones in one file.

I'm not fond of the idea of having to manage such configuration files manually or even from a CLI. Instead, I think we should focus more on hostnames/zones and auto-configuration, like go get DOMAIN/PATH works not because it's hardcoded, but because it follows a standard (HTML headers). We can do gno.land/r/zones. The only exception I can see is for local development, where you may want to override something. Even in this case, I'd prefer to find idiomatic patterns around localhost.

Maybe the question is: when you launch albert.land; would you prefer having ~/albert and using albertkey, and having the ~/gno for gno (the language/dev binary, not the gno.land binary)? If so, then I propose having ~/gno not for the chain, but just for the language, and then having ~/gnoland for the chain.

2️⃣ Put back default genesis.json file inside of the gnoland-data folder

No opinion.

3️⃣ gnoland init

I provided more details in a previous comment. The summary is that I anticipate 3 main cases for people who run the gnoland binary:

  • Lazy (for developers)
  • Fully manual (for zone architects)
  • Full nodes / new validators connecting to an existing zone (downloading configuration)

I can't find any evidence that your suggested unified gnoland init is better than the current solutions in any of the 3 cases mentioned. Is it?
Is there a fourth case that I've missed?

4️⃣ --data-dir into --home, remove --config-path

No opinion.

@albttx
Copy link
Member Author

albttx commented Jun 7, 2024

Thanks for replying @moul

1️⃣ $HOME/.gno

Since it's gno, it's for zone, and it's by chain-id, so it could manage all zones in 1 file.

I believe in the future having gnokey with context albert.mainnet would be great :)

This is a feature request, we can work on it later :)

BONUS: we could mention the $GNOROOT for each zone, the gnoland-data folder ... :)

3️⃣ gnoland init

Right now, it is not possible to start a node with only

gnoland config init
gnoland genesis init
gnoland secret init

It's lacking the gno.land/{r,p}/... in the genesis file.

So the only solutions is to gnoland start --lazy, wait a moment and ctrl+C, then setup...
(IIRC, @zivkovicmilos is working on this fix ?)
Nonetheless, once fixed, it will be 3 or 4 commands to init + 1 to start...
I understand the fine grain, but it's just more complexe...

I don't understand the purpose of --lazy. IMHO devs will use gno dev or a simple docker-compose.yml that we could provide to start a dev node.
But if it's decided, i'm not against. (Maybe rename to gnoland dev to stay consistent with gno dev ?)

IMHO, as a zone architect and full node runner, i would mostly use a gnoland init + gnoland config set ... (multiple times) + cp my_priv_validator_key.json -> gnoland start.

I don't see any world were i need to do only gnoland secrets init or gnoland config init without the rest of the commands.

I'm thinking as a new user, he will get the gnoland binary and run gnoland --help, and won't see an init. Could be complexe to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants