Пример #1
0
        public UserController(IConfiguration configuration)
        {
            _configuration = configuration;

            _web3                = new Web3Geth(_configuration["Ethereum:RPCServer"] as string);
            _contractAddress     = EV.ContractAddress;
            _walletAddress       = EV.WalletAddress;
            _gas                 = long.Parse(_configuration["Ethereum:Gas"]);
            _ethereumUserService = new EthereumUserService(_web3, _contractAddress, _walletAddress, _gas);
        }
Пример #2
0
        public FileController(IConfiguration configuration)
        {
            _configuration = configuration;

            _ipfsService = new IpfsService(
                _configuration["IPFS:API:host"],
                int.Parse(_configuration["IPFS:API:port"]),
                _configuration["IPFS:API:protocol"]
                );

            //todo get secure info from Environment Variables
            _web3            = new Web3Geth(_configuration["Ethereum:RPCServer"] as string);
            _contractAddress = EV.ContractAddress;
            _walletAddress   = EV.WalletAddress;
            _gas             = long.Parse(_configuration["Ethereum:Gas"]);

            _ethereumFileService = new EthereumFileService(_web3, _contractAddress, _walletAddress, _gas);
            _ethereumUserService = new EthereumUserService(_web3, _contractAddress, _walletAddress, _gas);
        }