Exemple #1
0
        public Sp8deTransactionStorage(Sp8deStorageConfig config)
        {
            if (config is null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            this.store = DocumentStore.For(s =>
            {
                s.Connection(config.ConnectionString);

                s.Schema.For <Sp8deTransaction>().Identity(x => x.Id);

                s.Schema.For <Sp8deTransaction>().Duplicate(x => x.Type);
                s.Schema.For <Sp8deTransaction>().Duplicate(x => x.Status);
                s.Schema.For <Sp8deTransaction>().Duplicate(x => x.DependsOn);
            });
        }
Exemple #2
0
        public Sp8deBlockStorage(Sp8deStorageConfig config)
        {
            if (config is null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            this.store = DocumentStore.For(s =>
            {
                s.Connection(config.ConnectionString);

                s.Schema.For <Sp8deBlock>().Identity(x => x.Id);
                s.Schema.For <Sp8deBlock>().Duplicate(x => x.ChainId);
                s.Schema.For <Sp8deBlock>().Duplicate(x => x.Hash);
                s.Schema.For <Sp8deBlock>().Duplicate(x => x.PreviousHash);
                s.Schema.For <Sp8deBlock>().Duplicate(x => x.Signer);
            });
        }