Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Create workspace for multiple networks #54

Merged
merged 6 commits into from
Jul 31, 2021
Merged

Create workspace for multiple networks #54

merged 6 commits into from
Jul 31, 2021

Conversation

jacobkaufmann
Copy link
Collaborator

  • Create individual packages for the state and history networks.
  • Move the main() function from main.rs to lib.rs for the state network.
  • Remove main.rs for the state nework.
  • Add a basic main() function in the history network lib.rs.
  • Create a 'trin' package to host a single entry point for the program.

- Create individual packages for the state and history networks.
- Move the main() function from main.rs to lib.rs for the state network.
- Remove main.rs for the state nework.
- Add a basic main() function in the history network lib.rs.
- Create a 'trin' package to host a single entry point for the program.
@carver
Copy link
Collaborator

carver commented Jul 28, 2021

Hey, moving from side-channel to the PR:

I could not remember whether we wanted to maintain the ability to run the binaries individually or always spin them all up at once. The latter is what is implemented.

It's fine to launch them combined. We can add separate launches later, if we want.

Though it does become extra important for the version of chain-history on master to not crash on launch, so it doesn't halt development on state network. (that seems like a good invariant to target anyway)

I was also not sure how command line args are handled with this approach, once you CLI args for history

Yeah, similar to full clients, there will probably just be a ton of arguments that need to be named in a disambiguated way. The more we can just use good defaults, the better.


Feel fee to mention me when it's ready for final review.

@SamWilsn
Copy link
Collaborator

I was also not sure how command line args are handled with this approach, once you CLI args for history

If you use structopt (which I think we are now), you can define the argument structs in each library crate and merge them together in the binary crate, which might be a neat way to do it.

Comment on lines +3 to +10
tokio::select! {
history = trin_history::main() => {
history
},
state = trin_state::main() => {
state
},
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a cleaner way to do this? Do we want any logging here, or should we leave that to the individual network main() functions?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, fine to leave it bland for now. Seems okay to me.

At some point we can play with whether we want them in separate threads/runtimes, but for now a 👍🏻 from me.

@jacobkaufmann
Copy link
Collaborator Author

It looks like the win-build CI test has been failing ever since the merge of PR #49. Perhaps we want to create an issue to figure out why.

A number of additional items we could handle in this PR or as separate tasks:

  • Reorganize structopt to differentiate arguments for state vs history
    • The history network has no CLI arguments as of now, but we could go ahead and create a structure in the binary crate to wrap the state network's arguments.
  • Move shareable jsonrpc.rs and portalnet code to a separate library crate to be shared among state and history.

@jacobkaufmann jacobkaufmann marked this pull request as ready for review July 28, 2021 15:13
@jacobkaufmann jacobkaufmann requested a review from carver July 28, 2021 17:11
@KolbyML
Copy link
Member

KolbyML commented Jul 28, 2021

It looks like the win-build CI test has been failing ever since the merge of PR #49. Perhaps we want to create an issue to figure out why.

@jacobkaufmann I think it is because I used a ton of credits when I was originally making the CI test for windows then after I realized that I started using the credits on my circleci account, so it should be fine whenever it resets.

@carver
Copy link
Collaborator

carver commented Jul 30, 2021

A number of additional items we could handle in this PR or as separate tasks:

  • Reorganize structopt to differentiate arguments for state vs history

    • The history network has no CLI arguments as of now, but we could go ahead and create a structure in the binary crate to wrap the state network's arguments.
  • Move shareable jsonrpc.rs and portalnet code to a separate library crate to be shared among state and history.

I'm all for adding issues to tackle these both after #54 is merged. I would only consider letting them delay merging this PR if it either was necessary to unblock work on chain history.

Copy link
Collaborator

@carver carver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure the Cargo.toml change in #53 makes it in here, then should be good to go after handling some nitpicks.

README.md Outdated
@@ -12,6 +12,16 @@ This should sound similar to a light client. It is, but with a peer-to-peer
philosophy rather than the LES client/server model, which has introduced
challenges in an altruistic environment.

## Repository Structure

Trin is a collection of networks.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe:

Suggested change
Trin is a collection of networks.
The portal protocol is a collection of networks. Trin needs to connect to all of them.

trin/Cargo.toml Outdated
[package]
name = "trin"
version = "0.1.0"
authors = ["Jacob Kaufmann <jacobkaufmann18@gmail.com>"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add both of us for the joint one? At some point, this will probably turn into a joint member list, like trin@ethereum.org. But for now, we can just list individual maintainers of the individual crates.

Comment on lines +3 to +10
tokio::select! {
history = trin_history::main() => {
history
},
state = trin_state::main() => {
state
},
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, fine to leave it bland for now. Seems okay to me.

At some point we can play with whether we want them in separate threads/runtimes, but for now a 👍🏻 from me.

@mrferris mrferris merged commit 0b38528 into master Jul 31, 2021
@lithp lithp deleted the workspace branch October 22, 2021 17:27
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants