1

I'm working on a c# application that reads the data from ethereum parity and parses it. As of present i managed to read the key value pairs from the files and convert them to hex. While looking at the data i couldn't find what i was looking for, that is, the block header or transaction data.

Has anyone done something similar and can help with gathering of data?

In order to read data from rocksdb i'm using the following package: https://github.com/warrenfalk/rocksdb-sharp

Right now i have the following code:

        var options = new DbOptions().SetCreateIfMissing(false).SetErrorIfExists(false).SetCreateMissingColumnFamilies(false).IncreaseParallelism(Environment.ProcessorCount - 1).PrepareForBulkLoad();
        ColumnFamilies columnFamilies = new ColumnFamilies();
        for (int i = 0; i < 8; i++)
        {
            columnFamilies.Add("col" + i, new ColumnFamilyOptions());
        }
        var db = RocksDb.Open(options, path, columnFamilies);
        Parallel.For(0, 8, (i, state) =>
        {
            var columnFamily = db.GetColumnFamily("col" + i);
            var iterator = db.NewIterator(columnFamily);
            iterator.SeekToFirst();
            LevelDbData ethereumData = new LevelDbData();
            while (iterator.Valid())
            {
                string key = iterator.StringKey().ToHex();
                string value = iterator.StringValue().ToHex();
                ethereumData.Keys.Add(key);
                ethereumData.Values.Add(value);
                iterator.Next();
            }
        });

Thanks in advance for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.