dakk / caravand-fullnode Goto Github PK
View Code? Open in Web Editor NEWType-safe bitcoin full-node
License: MIT License
Type-safe bitcoin full-node
License: MIT License
The "actual" blockchain state include also:
- A. blocks in the main branch: the transactions in these blocks are considered at least tentatively confirmed
- B. blocks on side branches off the main branch: these blocks have at least tentatively lost the race to be in the main branch
- C. orphan blocks: these are blocks which don't link into the main branch, normally because of a missing predecessor or nth-level predecessor
We need to save them, they are used for fork-detection and data verification. A better abstraction for the storage code could help storing A/B blocks, while we can prune orphan blocks.
https://en.bitcoin.it/wiki/Protocol_rules#Blocks
This is necessary for:
With:
We should use bc functions instead (or move api to blockchain)
Implement pruning by:
Serialize and parsing should never fail; If fail even for one Tx in a block, there is a problem. A block / tx parsing could fail only for new block, new tx
The shutdown procedure should avoid data corruption; we need to handle the exit signal and execute this procedure:
#We need to integrate these validity tests for blocks, headers and txs:
https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages
https://en.bitcoin.it/wiki/Protocol_rules#.22block.22_messages
The last part of the fork detector, is the branch handler; at every step of the blockchain thread:
Disable the recursion and select the best peer with the major last_seen
Maybe a blacklist problem, or unhandled messages; in particular we need to reply to getheaders and getdata messages, mainly sent on connection startup.
/block/hash for already present blocks is not working
Disable peer message by default
Related to #33 , letchain needs a better storage abstraction to handle main branch and other branchs. A git-like model could be a good idea, but still using leveldb as data backend.
The snapshot feature of leveldb could help storing and handling different branches.
The IO is always at 99% when receiving blocks; try to reduce the amount of r/w by using caching and batch operations
Offer the blockchain parsing/serializing code in an external library useful for other projects.
Blocked by dakk/bitcoinml#9
Add some command line arguments:
Thread 1 killed on uncaught exception Pervasives.Exit
Raised at file "src/blockchain/branch.ml", line 75, characters 13-355
Called from file "_none_", line 0, characters 254-1023
Called from file "list.ml", line 59, characters 20-23
Called from file "src/blockchain/storage.ml", line 149, characters 28-78
Called from file "src/blockchain/storage.ml", line 208, characters 9-48
Called from file "src/blockchain/storage.ml" (inlined), line 249, characters 1-16
Called from file "src/blockchain/chain.ml", line 191, characters 5-51
Called from file "src/blockchain/chain.ml", line 262, characters 5-27
Called from file "src/blockchain/chain.ml", line 284, characters 14-44
Called from file "src/blockchain/chain.ml", line 299, characters 2-12
Called from file "thread.ml", line 39, characters 8-14
The crash occurs with a 100% cpu usage (maybe from the network thread).
It could be a problem with the find_peer during a WAITPING operation; a possible fix could be to check the available peer number before trying the find_peer.
Crash occurs only on certain PING
If last n received headers messages are empty, assume that the node is in sync
The number of requested blocks should be dynamic and should depend on the speed of block processing
Don't parse the full block when received, parse it only if the the header is valid and only when the node need this data
The addresses are always converted with mainnet prefixes; we first need to fix this: dakk/bitcoinml#13
Then, in storage, we need to pass the correct address prefix
The opam version is outdated, modify travis-sh to pin dev version.
Network is just a data provider; we can abstract from this by providing other data sources, like bindings to another node softwares. Data sources should implement a threading instance which reads and write in the request / response queues.
Another useful datasource could be a torrent backup of first years of chain
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.