Open surajsjain opened 1 year ago
Figured it out. Just had to change var Trie = require('merkle-patricia-tree/secure')
to var Trie = require('merkle-patricia-tree').SecureTrie;
But after that, I am getting the following error with respect to the length of the root's value:
begin
assert.js:339
throw err;
^
AssertionError [ERR_ASSERTION]: Invalid root length. Roots are 32 bytes
at SecureTrie.set root [as root] (/home/web3success/ethereum_database_research_and_testing/leveldb/javascript/node_modules/merkle-patricia-tree/dist/baseTrie.js:46:9)
at new Trie (/home/web3success/ethereum_database_research_and_testing/leveldb/javascript/node_modules/merkle-patricia-tree/dist/baseTrie.js:36:23)
at new CheckpointTrie (/home/web3success/ethereum_database_research_and_testing/leveldb/javascript/node_modules/merkle-patricia-tree/dist/checkpointTrie.js:11:9)
at new SecureTrie (/home/web3success/ethereum_database_research_and_testing/leveldb/javascript/node_modules/merkle-patricia-tree/dist/secure.js:16:9)
at Object.<anonymous> (/home/web3success/ethereum_database_research_and_testing/leveldb/javascript/print_transaction_trie_keys.js:26:12)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
I tried running the
print_state_trie_keys.js
file usingnode print_state_trie_keys.js
after installing all the requirements by running the commandnpm install levelup leveldown rlp merkle-patricia-tree assert --save
.Then, I got the following error saying that
secure
is not present withinmerkle-patricia-tree
:Please help me resolve this