class Blockchain
  class << self
    def blockchain_config
      blockchain_config = {}

      begin
        config = Rails.application.config_for(:configuration).symbolize_keys!
        blockchain_config = config[:blockchain].symbolize_keys!
        raise 'blockchain config missing' if blockchain_config.blank?
      rescue => ex
        raise ex if Rails.env.production?

        puts %Q{\033[33m [warning] blockchain config or configuration.yml missing,
                 please add it or execute 'cp config/configuration.yml.example config/configuration.yml' \033[0m}
        blockchain_config = {}
      end
      blockchain_config
    end
  end
end