Skip to content
Snippets Groups Projects
Commit c61a7855 authored by Hugo Trentesaux's avatar Hugo Trentesaux Committed by Vincent Texier
Browse files

[feat] example for loading local blockchain

parent 8d1fe3bf
No related branches found
No related tags found
2 merge requests!128Release 0.62.0,!124#130: Support reading Duniter's local json blockchain
# this example lets you load locally copy of duniter blockchain into duniterpy objects
# by default, it searches in ~/.config/duniter/duniter_default/g1/
from duniterpy.helpers.blockchain import load
bc = load() # gets blockchain iterator
b = next(bc) # gets block
b.number # should return 0
# you can access all properties of this block through it's duniterpy objects attributes
next(bc).number # should return 1
next(bc).number # should return 2 (and so on)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment