Skip to content

Commit

Permalink
Use consistent name for FirstTimeSetup hook
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
  • Loading branch information
awrichar committed Aug 18, 2021
1 parent a62de5d commit 88cc3b8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/blockchain/blockchain_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

type IBlockchainProvider interface {
WriteConfig() error
PreFirstTimeSetup() error
FirstTimeSetup() error
DeploySmartContracts() error
PreStart() error
PostStart() error
Expand Down
2 changes: 1 addition & 1 deletion internal/blockchain/ethereum/besu/besu_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (p *BesuProvider) WriteConfig() error {
return nil
}

func (p *BesuProvider) PreFirstTimeSetup() error {
func (p *BesuProvider) FirstTimeSetup() error {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/blockchain/ethereum/geth/geth_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (p *GethProvider) WriteConfig() error {
return nil
}

func (p *GethProvider) PreFirstTimeSetup() error {
func (p *GethProvider) FirstTimeSetup() error {
volumeName := fmt.Sprintf("%s_geth", p.Stack.Name)
gethConfigDir := path.Join(constants.StacksDir, p.Stack.Name, "blockchain")

Expand Down
8 changes: 4 additions & 4 deletions internal/stacks/stack_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ func checkPortAvailable(port int) (bool, error) {
func (s *StackManager) runFirstTimeSetup(verbose bool, options *StartOptions) error {
workingDir := filepath.Join(constants.StacksDir, s.Stack.Name)

s.Log.Info("performing early initialization tasks")
if err := s.blockchainProvider.PreFirstTimeSetup(); err != nil {
s.Log.Info("initializing blockchain node")
if err := s.blockchainProvider.FirstTimeSetup(); err != nil {
return err
}

Expand Down Expand Up @@ -487,8 +487,8 @@ func (s *StackManager) runFirstTimeSetup(verbose bool, options *StartOptions) er
return err
}

s.Log.Info("performing late initialization tasks")
if err := s.tokensProvider.PostFirstTimeSetup(); err != nil {
s.Log.Info("initializing token providers")
if err := s.tokensProvider.FirstTimeSetup(); err != nil {
return err
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/tokens/erc1155/erc1155_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (p *ERC1155Provider) DeploySmartContracts() error {
return DeployContracts(p.Stack, p.Log, p.Verbose)
}

func (p *ERC1155Provider) PostFirstTimeSetup() error {
func (p *ERC1155Provider) FirstTimeSetup() error {
for _, member := range p.Stack.Members {
p.Log.Info(fmt.Sprintf("initializing tokens on member %s", member.ID))
tokenInitUrl := fmt.Sprintf("http://localhost:%d/api/v1/init", member.ExposedTokensPort)
Expand Down
2 changes: 1 addition & 1 deletion internal/tokens/tokens_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

type ITokensProvider interface {
DeploySmartContracts() error
PostFirstTimeSetup() error
FirstTimeSetup() error
GetDockerServiceDefinitions() []*docker.ServiceDefinition
GetFireflyConfig(m *types.Member) *core.TokensConfig
}

0 comments on commit 88cc3b8

Please sign in to comment.