mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 18:02:54 +01:00
3c4157a698
* Replace AppConfig with more specific types * Rework database configuration In this commit we: 1) Introduce new database settings for all submodules, and at the same time remove the singular datbase setting for the entire project 2) Introduce a new method .initialize on all configs that is responsible for creating needed directories, databases and files 3) Introduce a new class BitcoinSAppConfig that wraps configs for all three other subproject config. We also provide implicit conversions that enable this super-config to be passed in wherever a specialized config is required. 4) Add more tests for our configuration setup. * Add Ammonite to Docs deps |
||
---|---|---|
.. | ||
src/main/scala/org/bitcoins/node | ||
README.md |
State of the world
Currently this project is a heavy WIP. The most important files are
Client
- this handles all of the networking code. Currently this uses akka but the plan is to move away from akka in the future for compatability with other JVM based platformsPeerMessageReceiver
- this handles messages we receive on the p2p network. The only messages that are currently handled areVerackMessage
andVersionMessage
. As this project get's built out this is where we need to add code for calling other subsystems that handle transactions, blocks, peer related information etc. All messages are algebraic data types, so we can easily pattern match on them and implement features inPeerMessageReceiver.handleControlPayload
andPeerMessageReceiver.handleDataPayload
PeerMessageReceiverState
- the states that our peer message receiver can be in. It transitions through these states during the connect/disconnect process with our peer.PeerMessageSender
- this handles sending messages to our peer on the p2p network. Since we are lite client, we probably won't be sending a lot of messages to peers so this isn't that interesting.PeerHandler
- this combines aPeerMessageReceiver
and aPeerMessageSender
into a pair.Peer
- The low level socket details need to connect to a peer
There is still a lot of code commented out on the project, but the unit tests should pass for the ones that are not. Interesting unit tests are
ClientTest
- currently tests that we can connect with peersPeerMessageHandlerTest
- tests that we can get our node into thePeerMessageReceiverState.Normal
state. This means we can send / receive arbitrary messages from our peer.