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

Persist network_id with ~/.kindelia/state and check on start #163

Open
steinerkelvin opened this issue Sep 20, 2022 · 4 comments
Open

Persist network_id with ~/.kindelia/state and check on start #163

steinerkelvin opened this issue Sep 20, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@steinerkelvin
Copy link
Contributor

No description provided.

@dan-da
Copy link

dan-da commented Nov 12, 2022

how should it be persisted? I'm thinking something like:

~/.kindelia/state/<network_id>/{blocks,heaps}

That way, state for various networks can be stored side by side. And the active network_id can be selected from the config file.

@steinerkelvin
Copy link
Contributor Author

That's sensible. I was thinking of just storing it and showing an error when the persisted state is incompatible with the current network id and prompting the user to remove it.

That's more useful — much easier to switch between networks. We can even have config like this:

[node.network]
network_id = "0xCAFE0004"

[node.network.0xCAFE0004]
initial_peers = [
  "64.227.110.69",
  "188.166.3.140",
]

[node.network.0xCAFE0005]
initial_peers = [
  ...
]

Do you intend to work on it?

btw, are you on our Discord server? can you DM me?

@dan-da
Copy link

dan-da commented Nov 15, 2022

yeah, I can take a stab at it. I'll sign up for discord later today.

dan-da added a commit to dan-da/Kindelia that referenced this issue Nov 17, 2022
Addresses kindelia#163

Previously chain state was stored under a path such as:

    ~/.kindelia/state/{blocks,heaps}

With this change, the data is stored at:

    ~/.kindelia/state/<network_id>/{blocks,heaps}

This enables for example flipping back and forth between a testnet
and mainnet just by changing network_id in the config, or even via
cli arg.
dan-da added a commit to dan-da/Kindelia that referenced this issue Nov 18, 2022
Addresses kindelia#163

node.network setting is now specified on a per network basis, eg:

   [node.network.0xCAFE0004]
   initial_peers = [
      "64.227.110.69",
      "188.166.3.140",
   ]

   [node.network.0xCAFE0005]
   initial_peers = [
     ...
   ]

Additionally:
* updated default.toml to use the new config syntax
* AppSettings::prop is now a String instead of &'static str
* fixed a typo in error string
@dan-da
Copy link

dan-da commented Nov 18, 2022

@steinerkelvin I sent you an email... discord signup failed.

dan-da added a commit to dan-da/Kindelia that referenced this issue Nov 28, 2022
Addresses kindelia#163

Previously chain state was stored under a path such as:

    ~/.kindelia/state/{blocks,heaps}

With this change, the data is stored at:

    ~/.kindelia/state/<network_id>/{blocks,heaps}

This enables for example flipping back and forth between a testnet
and mainnet just by changing network_id in the config, or even via
cli arg.
dan-da added a commit to dan-da/Kindelia that referenced this issue Nov 28, 2022
Addresses kindelia#163

node.network setting is now specified on a per network basis, eg:

   [node.network.0xCAFE0004]
   initial_peers = [
      "64.227.110.69",
      "188.166.3.140",
   ]

   [node.network.0xCAFE0005]
   initial_peers = [
     ...
   ]

Additionally:
* updated default.toml to use the new config syntax
* AppSettings::prop is now a String instead of &'static str
* fixed a typo in error string
dan-da added a commit to dan-da/Kindelia that referenced this issue Nov 28, 2022
Addresses kindelia#163

Previously chain state was stored under a path such as:

    ~/.kindelia/state/{blocks,heaps}

With this change, the data is stored at:

    ~/.kindelia/state/<network_id>/{blocks,heaps}

This enables for example flipping back and forth between a testnet
and mainnet just by changing network_id in the config, or even via
cli arg.
dan-da added a commit to dan-da/Kindelia that referenced this issue Dec 4, 2022
Addresses kindelia#163

Previously chain state was stored under a path such as:

    ~/.kindelia/state/{blocks,heaps}

With this change, the data is stored at:

    ~/.kindelia/state/<network_id>/{blocks,heaps}

This enables for example flipping back and forth between a testnet
and mainnet just by changing network_id in the config, or even via
cli arg.
dan-da added a commit to dan-da/Kindelia that referenced this issue Dec 7, 2022
Addresses kindelia#163

Previously chain state was stored under a path such as:

    ~/.kindelia/state/{blocks,heaps}

With this change, the data is stored at:

    ~/.kindelia/state/<network_id>/{blocks,heaps}

This enables for example flipping back and forth between a testnet
and mainnet just by changing network_id in the config, or even via
cli arg.
dan-da added a commit to dan-da/Kindelia that referenced this issue Dec 7, 2022
Addresses kindelia#163

Previously chain state was stored under a path such as:

    ~/.kindelia/state/{blocks,heaps}

With this change, the data is stored at:

    ~/.kindelia/state/<network_id>/{blocks,heaps}

This enables for example flipping back and forth between a testnet
and mainnet just by changing network_id in the config, or even via
cli arg.
dan-da added a commit to dan-da/Kindelia that referenced this issue Dec 13, 2022
Addresses kindelia#163

Previously chain state was stored under a path such as:

    ~/.kindelia/state/{blocks,heaps}

With this change, the data is stored at:

    ~/.kindelia/state/<network_id>/{blocks,heaps}

This enables for example flipping back and forth between a testnet
and mainnet just by changing network_id in the config, or even via
cli arg.
dan-da added a commit to dan-da/Kindelia that referenced this issue Dec 18, 2022
Addresses kindelia#163

Previously chain state was stored under a path such as:

    ~/.kindelia/state/{blocks,heaps}

With this change, the data is stored at:

    ~/.kindelia/state/<network_id>/{blocks,heaps}

This enables for example flipping back and forth between a testnet
and mainnet just by changing network_id in the config, or even via
cli arg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants