package blockchain

import (
	"fmt"
	"github.com/fonchain_enterprise/utils/chain"
)

//ChainClient 区块链单例
var (
	ChainClient chain.BlockChain
)

type ChainConfig struct {
	IP                   string
	AdminMnemonicWords   string
	AdminContractAccount string
	ContractName         string
	ContractType         string
}

func LoadEnv(chainConfig ChainConfig) {
	//从本地读取环境变量
	fmt.Println("1----", chainConfig)
	ChainClient = chain.NewXuperChain(chainConfig.IP, chainConfig.AdminMnemonicWords, chainConfig.ContractName, chainConfig.ContractType, chainConfig.AdminContractAccount)
}
