-
Notifications
You must be signed in to change notification settings - Fork 3
make it so that config is configured during setup. #11
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
Conversation
this allows for automated executable building later
| @@ -0,0 +1,72 @@ | |||
| name: Build Arbiter Signer | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, but there are a few points that need adjustment:
- There will be multiple apps in the future, not just Arbiter. You can refer to the feature_web branch, which is still in development. So it's better to write a generic build check method instead of just building Arbiter.
- The go.yaml file under workflows path needs to be deleted to avoid duplication.
- Additionally, the workflow here will affect the build check in the README.md, so it needs to be modified and tested accordingly in the README
| } `yaml:"arbiter"` | ||
| } | ||
|
|
||
| func getDefaultConfig() ConfigFile { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not possible to enforce that config.yaml be placed in the current location:
GoFrame is designed to look for configuration files sequentially from the current directory and then from the manifest/config directory. Since a single repository can have multiple different config.yaml files, they need to be placed in their respective manifest directories. The official recommended location is always under the manifest/config directory. the config retrieval order of arbiter:
1. Arbiter_Signer/
2. Arbiter_Signer/config
3. Arbiter_Signer/manifest/config
4. Arbiter_Signer/app/arbiter/
5. Arbiter_Signer/app/arbiter/config
6. Arbiter_Signer/app/arbiter/manifest/config
If you place a config.yaml file in the '.' directory, it will override the config.yaml under the manifest directory.
| return createKeyFiles(cfg) | ||
| } | ||
|
|
||
| func createKeyFiles(cfg ConfigFile) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users should not be prompted to input during the running process, as the current deployment is automated through scripts or Docker. Any process that requires user input will disrupt the deployment. If it is indeed necessary, it should be changed to: 'If the key file exists, use the key file.'
Maybe this is not really necessary, as creating a default config.yaml will affect GoFrame's configuration retrieval method.
| wg.Add(1) | ||
|
|
||
| // Initialize config file path for gf framework | ||
| g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetPath(".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove it, useless code does not affect GoFrame's own configuration retrieval
|
|
||
| # Arbiter | ||
| arbiter: | ||
| listener: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good!
| escArbiterAddress: "0x0262aB0ED65373cC855C34529fDdeAa0e686D913" | ||
| dataPath: "./app/arbiter/data" | ||
| keyFilePath: "./app/arbiter/data/keys/" | ||
| dataPath: "./data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to modify the default values here
- This config.yaml is just for convenience during local testing. You can modify the config.yaml example in README.md and adjust it as needed.
- Additionally, do not place the data directory under the '.' directory directly, as there may be multiple apps, and each app's data should be placed in a separate directory. If consolidation is necessary, you might consider renaming it to something like './data/arbiter' or similar
|
It is recommended to split the changes into different pull requests for better management @yujingr |
|
@mollkeith thanks for the comments and review. I should specify my intention here - to allow non-technical community members to be able to do a one-click setup. The code change prepares for the next step - automated github action that builds this into executables so that these non-technical members can quickly get the arbiter up and running. Therefore, the keys and config here are designed to be created during the setup. If I resolve the config file placement, do you think it would avoid conflicts down the road? |
|
@yujingr We need to automatically deploy the arbiter, but the arbiter needs to have the configuration file and key file created before it starts. If the logic for creating the configuration file is included in the arbiter's code, then we would have to start the arbiter to generate the configuration file, and then modify the configuration file afterwards. That seems problematic. |
this allows for automated executable building later