Skip to content

Commit

Permalink
Merge pull request #234 from kaleido-io/evmconnect-default
Browse files Browse the repository at this point in the history
Set default connector to evmconnect
  • Loading branch information
nguyer committed Jan 19, 2023
2 parents fc3bbda + c419cd2 commit 80c9a10
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/init.go
Expand Up @@ -240,7 +240,7 @@ func init() {
initCmd.PersistentFlags().IntVarP(&initOptions.FireFlyBasePort, "firefly-base-port", "p", 5000, "Mapped port base of FireFly core API (1 added for each member)")
initCmd.PersistentFlags().IntVarP(&initOptions.ServicesBasePort, "services-base-port", "s", 5100, "Mapped port base of services (100 added for each member)")
initCmd.PersistentFlags().StringVarP(&initOptions.DatabaseProvider, "database", "d", "sqlite3", fmt.Sprintf("Database type to use. Options are: %v", fftypes.FFEnumValues(types.DatabaseSelection)))
initCmd.Flags().StringVarP(&initOptions.BlockchainConnector, "blockchain-connector", "c", "ethconnect", fmt.Sprintf("Blockchain connector to use. Options are: %v", fftypes.FFEnumValues(types.BlockchainConnector)))
initCmd.Flags().StringVarP(&initOptions.BlockchainConnector, "blockchain-connector", "c", "evmconnect", fmt.Sprintf("Blockchain connector to use. Options are: %v", fftypes.FFEnumValues(types.BlockchainConnector)))
initCmd.Flags().StringVarP(&initOptions.BlockchainProvider, "blockchain-provider", "b", "ethereum", fmt.Sprintf("Blockchain to use. Options are: %v", fftypes.FFEnumValues(types.BlockchainProvider)))
initCmd.Flags().StringVarP(&initOptions.BlockchainNodeProvider, "blockchain-node", "n", "geth", fmt.Sprintf("Blockchain node type to use. Options are: %v", fftypes.FFEnumValues(types.BlockchainNodeProvider)))
initCmd.PersistentFlags().StringArrayVarP(&initOptions.TokenProviders, "token-providers", "t", []string{"erc20_erc721"}, fmt.Sprintf("Token providers to use. Options are: %v", fftypes.FFEnumValues(types.TokenProvider)))
Expand Down
2 changes: 1 addition & 1 deletion cmd/init_ethereum.go
Expand Up @@ -57,7 +57,7 @@ func init() {
initEthereumCmd.Flags().StringVar(&initOptions.ContractAddress, "contract-address", "", "Do not automatically deploy a contract, instead use a pre-configured address")
initEthereumCmd.Flags().StringVar(&initOptions.RemoteNodeURL, "remote-node-url", "", "For cases where the node is pre-existing and running remotely")
initEthereumCmd.Flags().Int64Var(&initOptions.ChainID, "chain-id", 2021, "The chain ID - also used as the network ID")
initEthereumCmd.Flags().StringVarP(&initOptions.BlockchainConnector, "blockchain-connector", "c", "ethconnect", "Blockchain connector to use. Options are: [evnconnect ethconnect]")
initEthereumCmd.Flags().StringVarP(&initOptions.BlockchainConnector, "blockchain-connector", "c", "evmconnect", "Blockchain connector to use. Options are: [evmconnect ethconnect]")
initEthereumCmd.Flags().StringVarP(&initOptions.BlockchainNodeProvider, "blockchain-node", "n", "geth", fmt.Sprintf("Blockchain node type to use. Options are: %v", fftypes.FFEnumValues(types.BlockchainNodeProvider)))

initCmd.AddCommand(initEthereumCmd)
Expand Down
24 changes: 14 additions & 10 deletions internal/core/manifest.go
Expand Up @@ -40,12 +40,23 @@ func GetManifestForReleaseChannel(releaseChannel fftypes.FFEnum) (*types.Version
return nil, err
}

imageDigest, err := docker.GetImageDigest(imageName)
manifest, err := GetReleaseManifest(gitCommit)
if err != nil {
return nil, err
}

manifest, err := GetReleaseManifest(gitCommit)
return manifest, nil
}

func GetReleaseManifest(version string) (*types.VersionManifest, error) {
manifest := &types.VersionManifest{}
if err := request("GET", fmt.Sprintf("https://raw.githubusercontent.com/hyperledger/firefly/%s/manifest.json", version), nil, &manifest); err != nil {
return nil, err
}

imageName := fmt.Sprintf("%s:%s", constants.FireFlyCoreImageName, version)

imageDigest, err := docker.GetImageDigest(imageName)
if err != nil {
return nil, err
}
Expand All @@ -54,17 +65,10 @@ func GetManifestForReleaseChannel(releaseChannel fftypes.FFEnum) (*types.Version
// Fill in the FireFly version number
manifest.FireFly = &types.ManifestEntry{
Image: "ghcr.io/hyperledger/firefly",
Tag: version,
SHA: imageDigest[7:],
}
}
return manifest, nil
}

func GetReleaseManifest(version string) (*types.VersionManifest, error) {
manifest := &types.VersionManifest{}
if err := request("GET", fmt.Sprintf("https://raw.githubusercontent.com/hyperledger/firefly/%s/manifest.json", version), nil, &manifest); err != nil {
return nil, err
}

return manifest, nil
}
Expand Down

0 comments on commit 80c9a10

Please sign in to comment.