suen / dheba Goto Github PK
View Code? Open in Web Editor NEWA minimal usuable toy cryptocurrency
License: MIT License
A minimal usuable toy cryptocurrency
License: MIT License
After HANDSHAKE_ACT message has been sent, the receiving peer should establish a connection with the connecting peer.
The connecting peer should not create another connection.
Create a config file of type key-value to put all hard coded configuration in it.
Implement Block exchange protocol.
After nodes have established their connection, they verify if the remote node has longest chain than them. If so, the node asks for the missing block by issuing a request to get the next block that comes after the best block it has. It continues until the length of the remote chain and its local chain length is same.
See the Bitcoin getblock as reference to determine the message format
For the minimum usable version, implement a dummy transaction to be used to create block.
An input in a transaction references an output from another transaction that hasn't already been spent. To speed up the validation of a transaction, it is better to have unspent transaction output indexed for quick lookup.
A transaction is composed of inputs and outputs. Expressed in form of scripts, the input and output acts as unlocking and locking values in the transaction.
With inspiration from Bitcoin transaction, devise a transaction structure.
Currently, there is no convention for the async communciation between Verticles.
Implement the convention as follows:
Some generic topics to be defined:
Topic | Description | Message Schema |
---|---|---|
REMOTE_PEER_INBOX | for messages received from the remote peer | {"remoteHostAddress": string, "remoteHostPort": integer, "content": json} |
REMOTE_PEER_OUTBOX | for messages to be sent to the remote peers | {"remoteHostAddress": string, "remoteHostPort": integer, "content": json} |
REMOTE_PEER_EVENT | for connected and disconnected notifications on a remote peer | {"remoteHostAddress": string, "remoteHostPort": integer, "type": string (CONNECTED|DISCONNECTED)} |
Write documentation explaining the event-driven internal architecture and the rationale for it.
Currently, the application supposes that the remote peer is reachable and will behave as expected. If this is not case, there are cascading failures.
After the first handshake message, exchange the addresses of connected peer with the new node.
The bitcoin network exchanges the peer address via "getaddr" and "addr".
Define a message format for addr et getaddr and exchange these messages after the initial handshake.
These messages may be exchanged at any point during the exchange.
Currently, the TCP ports used to listen to P2P connection, HTTP connection and SSH connection are all hard coded which makes running multiple nodes on local machine impossible.
Make these ports customizable via System Properties or environment variable.
The order of priority goes on as follows :
System Properties > Environement Variable > Hard coded default values
if system properties is present, it takes precedence over others, and so on..
The variable names are as follows:
dheba.port.http
dheba.port.ssh
dheba.port.p2p
Sections to include
A transaction input is a digital signature proving the ownership of the public key referenced in the transaction output. A standard practice to keep the public and private key pairs in a file called wallet.
Create a wallet model and have every node generate one automatically in the beginning.
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.