Esempio n. 1
0
        public static CheckpointStorageProvider Open(string checkpointPath, uint?network = null, byte?addressVersion = null, UInt160?scriptHash = null)
        {
            var checkpointTempPath = RocksDbUtility.GetTempPath();
            var metadata           = RocksDbUtility.RestoreCheckpoint(checkpointPath, checkpointTempPath, network, addressVersion, scriptHash);

            var db = RocksDbUtility.OpenReadOnlyDb(checkpointTempPath);
            var rocksDbStorageProvider = new RocksDbStorageProvider(db, readOnly: true);

            return(new CheckpointStorageProvider(rocksDbStorageProvider, checkpointTempPath));
        }
Esempio n. 2
0
        public CheckpointStore(string checkpointPath, uint?network = null, byte?addressVersion = null, UInt160?scriptHash = null)
        {
            checkpointTempPath = RocksDbUtility.GetTempPath();
            var metadata = RocksDbUtility.RestoreCheckpoint(checkpointPath, checkpointTempPath, network, addressVersion, scriptHash);

            Settings = ProtocolSettings.Default with
            {
                Network        = metadata.network,
                AddressVersion = metadata.addressVersion,
            };

            var db = RocksDbUtility.OpenReadOnlyDb(checkpointTempPath);

            this.store = new RocksDbStore(db, readOnly: true);
        }