rooch-network / rooch

VApp Container with Move Language
https://rooch.network
Apache License 2.0
128 stars 54 forks source link

Refactor the keypair management of sequencer, proposer, and relayer #903

Closed baichuan3 closed 7 months ago

baichuan3 commented 7 months ago

resolve https://github.com/rooch-network/rooch/issues/800

Summary

  1. Init server config when Rooch init, and generate rooch key pair in keystore, both for sequencer, proposer, and relayer

Notice Due to dependencies (Keystore is in WalletContext), the server loads key pairs from the command line by default and then passes them to the RPC Server. KeyPair does not have a clone attribute. The ServerOpt attribute is newly added to encapsulate and extend KeyPairs and other configurations. There will be an impact on the SDK.

Todo Wait the password option to decrypt private key for commands

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **rooch** | ⬜️ Ignored ([Inspect](https://vercel.com/rooch/rooch/2Gu3RhGAMG13hnwEGEvkhkUJrV8v)) | [Visit Preview](https://rooch-git-serverkeypair-rooch.vercel.app) | | Oct 3, 2023 0:47am |
baichuan3 commented 7 months ago

The design is very simple. Use a extra key address as the keypair of sequencer, proposer and relayer. When rooch init, write the key address to the Server Config configuration. When the server starts, load the KeyPair of the Key Address from the configuration. @feliciss

feliciss commented 7 months ago

The design is very simple. Use a extra key address as the keypair of sequencer, proposer and relayer. When rooch init, write the key address to the Server Config configuration. When the server starts, load the KeyPair of the Key Address from the configuration. @feliciss

As mentioned by @jolestar, I do not think there's a need to add an extra key pair for server options. When the server starts, the user can choose the key pair in the store or possibly init it as server config.

baichuan3 commented 7 months ago

Find a bug about account account create and account account list, the newly created account will be overwritten in the keystore and cannot be displayed in the account list. It will be located and resolved in a separate PR.

baichuan3 commented 7 months ago

I will merge this PR first, and handle the output in another PR