Skip to main content
conclusion
Source Link
comodoro
  • 1.2k
  • 1
  • 12
  • 16

An idea, instead of

var blockchain = new Blockchain()

try to instantiate using

var blockchain = new Blockchain({blockDB : BlockChainDB})

according to the ethereumjs-blockchain github page

EDIT: ethereumjs-blockchain interacts with LevelDB, but expects a format of block hashes as keys and RLP encoded blocks as values (see the source). geth also uses LevelDB, but stores the state trie (see this answer). This makes it possible to pass the DB to Blockchain constructor (like any LevelDB), but not to interact with it.

An idea, instead of

var blockchain = new Blockchain()

try to instantiate using

var blockchain = new Blockchain({blockDB : BlockChainDB})

according to the ethereumjs-blockchain github page

An idea, instead of

var blockchain = new Blockchain()

try to instantiate using

var blockchain = new Blockchain({blockDB : BlockChainDB})

according to the ethereumjs-blockchain github page

EDIT: ethereumjs-blockchain interacts with LevelDB, but expects a format of block hashes as keys and RLP encoded blocks as values (see the source). geth also uses LevelDB, but stores the state trie (see this answer). This makes it possible to pass the DB to Blockchain constructor (like any LevelDB), but not to interact with it.

Source Link
comodoro
  • 1.2k
  • 1
  • 12
  • 16

An idea, instead of

var blockchain = new Blockchain()

try to instantiate using

var blockchain = new Blockchain({blockDB : BlockChainDB})

according to the ethereumjs-blockchain github page