0

I'm trying to use alecalve's bitcoin-parser pkg for python. The problem is, my node is saved on an s3 bucket. As the parser uses os.path.expanduser for the .dat files dir, expecting a filesystem, I can't just use my s3 path. The example from the documentation is:

import os
from blockchain_parser.blockchain import Blockchain


blockchain = Blockchain(os.path.expanduser('~/.bitcoin/blocks'))
for block in blockchain.get_ordered_blocks(os.path.expanduser('~/.bitcoin/blocks/index'), end=1000):
    print("height=%d block=%s" % (block.height, block.hash))

And the error I'm getting is as follows:

'name' arg must be a byte string or a unicode string

Is there a way to use s3fs or any different s3-to-filesystem method to use the s3 paths as dirs for the parser to work as intended?

Andrew Gaul
  • 2,296
  • 1
  • 12
  • 19
Tero
  • 31
  • 1
  • 3
  • Not a chance. blockchain_parser uses memory-mapped files to read the file, it needs a file that can be mapped. You _might_ be able to use s3fs – Anon Coward May 12 '22 at 18:07
  • Yeah, that was pretty much my question, if and how I could use s3fs in that manner. – Tero May 13 '22 at 07:46

0 Answers0