Skip to content
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

Add tezosconnector support #261

Merged
merged 10 commits into from
Sep 28, 2023
Merged

Add tezosconnector support #261

merged 10 commits into from
Sep 28, 2023

Conversation

denisandreenko
Copy link
Member

No description provided.

Signed-off-by: Dzianis Andreyenka <andreenkodn@gmail.com>
Signed-off-by: Dzianis Andreyenka <andreenkodn@gmail.com>
Signed-off-by: Dzianis Andreyenka <andreenkodn@gmail.com>
Signed-off-by: Dzianis Andreyenka <andreenkodn@gmail.com>
Signed-off-by: Dzianis Andreyenka <andreenkodn@gmail.com>
Signed-off-by: Dzianis Andreyenka <andreenkodn@gmail.com>
Signed-off-by: Dzianis Andreyenka <andreenkodn@gmail.com>
Signed-off-by: Dzianis Andreyenka <andreenkodn@gmail.com>
Signed-off-by: Dzianis Andreyenka <andreenkodn@gmail.com>
Copy link
Contributor

@nguyer nguyer left a comment

Choose a reason for hiding this comment

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

This is a great start and will get us to an easy way to get Tezosconnect up and running! I have some questions around how we want to do End-To-End tests for FF + Tezosconnect. Typically that's involved setting up a local dev chain and running FF connected to it, but I'm not sure what our options are there for Tezos. That's for the next PR though :)

cmd/init_tezos.go Outdated Show resolved Hide resolved
Comment on lines +24 to +29
type Connector interface {
GetServiceDefinitions(s *types.Stack, dependentServices map[string]string) []*docker.ServiceDefinition
GenerateConfig(stack *types.Stack, member *types.Organization) Config
Name() string
Port() int
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since there is only one type of Tezos connctor (tezosconnect) and one type of Tezos implementation, I don't know that we need this interface. The reason it exists for Ethereum is that there are different Ethereum implementations that are set up very differently (Besu, Geth, etc)

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about it. But I still think it's good practice to use interfaces, even if we currently have 1 implementation.
This does not complicate the code, but at the same time gives additional flexibility.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with leaving it. In general I'm not a fan of just adding extra interfaces unless 1) It is necessary for unit testing 2) We are certain that there will be another implementation in the future. I know it is common practice in other languages to use interfaces and abstraction absolutely everywhere but I have always disliked that pattern. But I recognize this is a personal preference. So I'm fine with this as is.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for sharing your opinion @nguyer !

Comment on lines +33 to +35
serviceDefinitions[i] = &docker.ServiceDefinition{
ServiceName: "tezosconnect_" + member.ID,
Service: &docker.Service{
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we also need to set up a signer service here?

Copy link
Member Author

Choose a reason for hiding this comment

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

The thing is that the signatory service works with many different kms and everyone should decide which one they prefer.
That's why there is no one in the FF CLI.
The idea is that user run its own service for tx signing using chosen kms and after that uses FF CLI with the '--connector-config' and provided address of this service.

Configuration example:

connector:
  blockchain:
    signatory: http://127.0.0.1:6732

Copy link
Member Author

Choose a reason for hiding this comment

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

In the future, there is an idea to make a kind of local signing of transactions, something like FF signer.
But at the moment, there are other priorities.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay. This is fine for now. I think when we go to create automated E2E tests we will need to revisit this though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course.
In fact, the idea of setting up the Signature as part of the FF stack is not that bad,
because by default we can use local keys for tx signing (similar to FF signer).
This is not super secure and for production KMS should be used (or HSM),
but for local use it is a very good option

Co-authored-by: Nicko Guyer <nguyer@users.noreply.github.com>
Signed-off-by: Dzianis Andreyenka <andreenkodn@gmail.com>
@nguyer nguyer merged commit 5f7fbf7 into hyperledger:main Sep 28, 2023
12 checks passed
@denisandreenko denisandreenko deleted the tezos-simple branch September 28, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants