-
Notifications
You must be signed in to change notification settings - Fork 41
Add Canton Blockchain #2332
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
base: main
Are you sure you want to change the base?
Add Canton Blockchain #2332
Conversation
| script += fmt.Sprintf(` | ||
| # Participant %02[1]d | ||
| echo "Checking ${CANTON_PARTICIPANT_GRPC_HEALTHCHECK_PORT_PREFIX}%02[1]d" | ||
| grpcurl -plaintext "localhost:${CANTON_PARTICIPANT_GRPC_HEALTHCHECK_PORT_PREFIX}%02[1]d" grpc.health.v1.Health/Check | ||
| `, i) |
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.
Does this Sprintf work as expected? I see 3 format verbs (%02[1]d) but just one arg in the varargs section of the args (i rather than i,i,i)
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.
Yeah, arguments can be explicitly indexed: https://pkg.go.dev/fmt#hdr-Explicit_argument_indexes
This seems cleaner than repeating the same argument i all over again
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.
Oh nice! TIL. 😄
| if err != nil { | ||
| return nil, err | ||
| } | ||
| _ = c |
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.
You could do _, err := ... on line 30 to avoid doing this
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.
Similarly for other lines
Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.
Why
The changes introduce support for the Canton blockchain network within a blockchain simulation framework. This includes defining new constants for the Canton type and family, extending validation for the Canton network type, and implementing the necessary container setup for running a Canton network. These updates allow users to simulate and interact with Canton networks, enhancing the framework's versatility and support for different blockchain technologies.
What
framework/components/blockchain/blockchain.go
TypeCantonconstant to define Canton type.FamilyCantonconstant to define Canton family.Typefield validation inInputstruct to includecanton.NumberOfValidatorsfield toInputstruct for Canton specific configuration.TypeCantoninNewWithContextfunction to handle Canton network setup.TypeCantonhandling inTypeToFamilyfunction to map Canton type to its family.framework/components/blockchain/canton.go
framework/components/blockchain/canton/canton.go
framework/components/blockchain/canton/nginx.go
framework/components/blockchain/canton/postgres.go
framework/components/blockchain/canton/splice.go