code: func (r *Replicator) ReplicateChains() []string {
  	var replicatedChains []string
  	channels := r.discoverChannels()
  	pullHints := r.channelsToPull(channels)
  	totalChannelCount := len(pullHints.channelsToPull) + len(pullHints.channelsNotToPull)
  	r.Logger.Info("Found myself in", len(pullHints.channelsToPull), "channels out of", totalChannelCount, ":", pullHints)
  
  	// Append the genesis blocks of the application channels we have into the ledger
  	for _, channels := range [][]ChannelGenesisBlock{pullHints.channelsToPull, pullHints.channelsNotToPull} {
  		for _, channel := range channels {
  			ledger, err := r.LedgerFactory.GetOrCreate(channel.ChannelName)
  			if err != nil {
  				r.Logger.Panicf("Failed to create a ledger for channel %s: %v", channel.ChannelName, err)
  			}
  			gb, err := ChannelCreationBlockToGenesisBlock(channel.GenesisBlock)
  			if err != nil {
  				r.Logger.Panicf("Failed converting channel creation block for channel %s to genesis block: %v",
  					channel.ChannelName, err)
  			}
  			r.appendBlock(gb, ledger, channel.ChannelName)
  		}
  	}
  
  	for _, channel := range pullHints.channelsToPull {
  		err := r.PullChannel(channel.ChannelName)
  		if err == nil {
  			replicatedChains = append(replicatedChains, channel.ChannelName)
  		} else {
  			r.Logger.Warningf("Failed pulling channel %s: %v", channel.ChannelName, err)
  		}
  	}
  
  	// Last, pull the system chain.
  	if err := r.PullChannel(r.SystemChannel); err != nil && err != ErrSkipped {
  		r.Logger.Panicf("Failed pulling system channel: %v", err)
  	}
  	return replicatedChains
  }
docs: // ReplicateChains pulls chains and commits them.
  // Returns the names of the chains replicated successfully.