Add tape.toml for configs#26
Conversation
|
Cool , |
|
Also i feel we dont wanna use cli args because the reason for adding toml is to make things easier to configure wdyt @zfedoran |
|
add |
|
Welcome @4rjunc, I hope this is one of many PRs, I'd love to see more in the future. I'm curious, why are we removing the local cluster option? |
I removed the default local cluster option because |
|
Ah understood, I thought the |
Nagaprasadvr
left a comment
There was a problem hiding this comment.
few things to update , can u also add a unit test to test the toml parsing works properly
| } | ||
|
|
||
| /// validate values in tape.toml | ||
| fn validate(&self) -> anyhow::Result<()> { |
There was a problem hiding this comment.
we also need to check urls are right here, just check for valid url using grep or something
|
So there is a non-zero chance that we may point tapedrive at all three clusters at the same time, but only one would be considered primary (where tokens are earned). Does this remove the need for the config file? I guess not, but it might be worth thinking about what this file would look like with more than one source. @Nagaprasadvr what are your thoughts? |
For that we can just change the cluster url when we spawn the node in the config file , ig along with this we can have a field primary_cluster to mark which cluster is primary to use |
U mean simultaneously running tape node on multiple clusters ? |
Yeah, exactly this. The premise is that users can write wherever it is cheapest. Assuming they are okay with lower recovery guarantees. |
What is the difference will be in this case between a primary cluster ,(possibly mainnet ) and other clusters like devnet and testnet |
|
@Nagaprasadvr I have pushed code addressing your comments. lmk if this needs to be changed. If this looks good to go, I will start working on code to pass values from |
|
Lots of good stuff in here. @4rjunc if you'd like, I'd love to give you access to the dev channel in discord |
|
thank you! @zfedoran i haven't joined the discord yet. i will join now. my username: |
6b1229a to
496b5dc
Compare
|
|
||
|
|
||
| let context = Context::try_build(&cli)?; | ||
| let config = match TapeConfig::load_with_path(&cli.config_path) { |
There was a problem hiding this comment.
Let's just do this
let config = TapeConfig::load(&cli.config)?;Move this inside context so we can get everything from context
|
This is looking really awesome @4rjunc. One more thing I'd love to see in here is the miner name. The current approach uses the word "default", which is fine, but we might as well put it in the config. @Nagaprasadvr what are your thoughts? (related issue: #36) |
Yeah definitely ig i missed it but it's a good addition |
thank you! you mean to use a custom name instead of "default" in this line right ? |
Let's add miner_name to miner config and hardcode it to "default" |
|
Hey @4rjunc ig we have changes from previous commits did u rebase this ? |
Yes, exactly this |
> transaction > performance > identity > solana > storage > network > logging feat: add validate + default values for toml.config feat: log_level is enum fix: resolving comments > change the `max_memory_mb` 2gb -> 16 gb > add few comments on what to change fix: remove the `NetworkConfig` feat: add enum for commitment level > add a impl for `CommitmentLevel` fix: fix the keypair loading up from ~ path feat: removed the helper function for tilde, add function used in anchor feat: add abstract StorageConfig feat: add URL validation fix: rename performance -> mining_config > add max_poa_thread > add max_pow_thread feat: better error handling for config::load() - ConfigFileNotFound - InvalidUrl(String) - KeypairNotFound(String) - HomeDirectoryNotFound - FileReadError(std::io::Error) - ParseError(toml::de::Error) - DefaultConfigCreationFailed(String) feat: add `--config` option feat: add error handling for config load > create new config is not found in default path, `--config` is not used > if config file not found in given path -> error will be shown feat: add `--config` option feat: add error handling for config load > create new config is not found in default path, `--config` is not used > if config file not found in given path -> error will be shown
> rm keypair_path > update keypair_path() helper function
> open_read_only_store_conn
|
looks good |
|
closing, there are about 100k lines of diffs at this point in the proof of stake version, will review this once it is time for this |
|
Okay, will open a new PR for this when tapedrive v2 is open |
PR for #16
I have pushed code of simple implementation of using
tape.toml. In the following code change of onlyrpc_urlis used fromtape.tomlconfig file. Couple of changes I madetomlcrate for handling toml filelfrom cli argsrpc_urlfromtape.tomlwont be used. if not it will be used.tape.tomlit is passed through cli contexttape.tomlis created at home dirI tested the above change in
archivecommand~/tape.tomlcargo run -p tapedrive-cli --manifest-path ~/Documents/solana/tape/cli/Cargo.toml archivecargo run -p tapedrive-cli --manifest-path ~/Documents/solana/tape/cli/Cargo.toml archive -ul