Ejemplo n.º 1
0
        public SeedController(ISp8deTransactionStorage storage, ICryptoService cryptoService, Sp8deNodeConfig config)
        {
            if (config == null || config.PrivateKeys == null)
            {
                throw new ArgumentNullException(nameof(Sp8deNodeConfig));
            }

            this.keys               = config.PrivateKeys.Select(x => EthKeySecret.Load(x)).ToArray();
            this.storage            = storage;
            this.cryptoService      = cryptoService;
            this.transactionService = new Sp8deTransactionNodeService(cryptoService, storage, Enumerable.Empty <IExternalAnchorService>());
        }
Ejemplo n.º 2
0
 private IKeySecret GetKey()
 {
     return(EthKeySecret.Load(appConfig.PrivateKeys[new Random().Next(0, appConfig.PrivateKeys.Length)]));
 }