Skip to content
Snippets Groups Projects
  1. Feb 03, 2025
  2. Feb 02, 2025
  3. Feb 01, 2025
  4. Jan 31, 2025
  5. Jan 30, 2025
  6. Jan 29, 2025
  7. Jan 06, 2025
  8. Dec 16, 2024
  9. Dec 14, 2024
  10. Dec 12, 2024
  11. Dec 11, 2024
  12. Dec 08, 2024
  13. Nov 26, 2024
  14. Nov 25, 2024
  15. Nov 02, 2024
  16. Nov 01, 2024
  17. Oct 24, 2024
  18. Oct 16, 2024
  19. Oct 03, 2024
    • Özgün Özerk's avatar
      Zombienet Improve DevX with new methods (#261) · 3460ec1c
      Özgün Özerk authored
      Revamped version of #252, didn't overwrite that PR in case you guys want
      to compare both solutions.
      
      Fixes #251 
      
      
      TL;DR -> here is the suggestion:
      ```rust
      let network_config = NetworkConfigBuilder::with_nodes_and_chain(
          vec!["alice".to_string(), "bob".to_string()],
          "rococo-local",
      )
      .with_collators_and_parachain_id(vec!["collator1".to_string(), "collator2".to_string()], 100)
      .build()
      .unwrap();
      ```
      
      I found an even better way than creating a wrapper. Here is the summary:
      
      - I want to protect the safety measures provided by the original crate
      as we discussed.
      - At the same time, I don't want to opt-out of the high-degree of
      configurability that `configuration` crate offers. Even though the aim
      is to grant better DevX to the community, it should still preserve the
      configuration options.
      - “advanced users can still use the `configuration` crate if they wanted
      to” is not a good argument imo. Here is the reason:
      - although there are many common settings amongst the projects in the
      ecosystem, probably most of the projects only tinkers with a specific
      setting w.r.t their needs, and this specific setting is most likely
      changing across projects. So, if we do not expose the tinkering options
      to people with this wrapper approach, most of the projects won’t use
      this wrapper. Then what is the point?
      - The aim should be providing the default options with a better DevX,
      whilst still providing a way to configure niche details somehow within
      the same API.
      - As first trial, I completed simple to use wrapper builders with the
      default settings. However, to expose the niche configurations, I had to
      copy-paste nearly every other function/method in the `configuration`
      crate.
      - And also, in order to comply with the `configuration` crate’s type
      state pattern, I had to export nearly all the states from
      `configuration` crate for the builder types in the `lib.rs`. The whole
      thing was quickly becoming ugly.
      - The difference between my wrapper and the `configuration` crate was,
      basically the extra methods that granted better DevX (for initializing
      the structs with default settings).
      - So I thought, instead of creating a new wrapper with tremendous amount
      of duplications, I can simply put these new methods into the
      `configuration` crate itself!
      
      Notes:
      
      - there are 2 new methods: (edited after last commit)
          - `with_nodes_and_chain`
          - `with_collators_and_parachain_id`
      - I also expanded the tests for these new methods.
      - I want to signal to the developers that these new methods are easier
      and faster to use compared to their equivalents, since they are
      utilizing the default settings, and should be much less intimidating to
      newcomers
      - So, I tried to name the methods accordingly, but they turned out to be
      a bit long. Don't know whether we can do better, I'm open to all
      suggestions.
      
      Hope it makes sense!
    • Javier Viola's avatar
      add validation to node name, can't be empty (#266) · bd51865f
      Javier Viola authored
      Add: 
        - Validate `node_name`, can't be empty
      
      cc: @ozgunozerk