Giter VIP home page Giter VIP logo

dheba's People

Contributors

daubajee avatar suen avatar

Watchers

 avatar  avatar  avatar

dheba's Issues

Block exchange

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

Dummy Transaction

For the minimum usable version, implement a dummy transaction to be used to create block.

Create Unspent transaction output index

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.

Create transaction models

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.

Refactor internal messaging convention

Currently, there is no convention for the async communciation between Verticles.

Implement the convention as follows:

  • A verticle can listen to at most two types of topics. Either a specific topic of which it is the only destination or a generic topic where many verticles could be listening.
  • A specific topic is to be used when the message being passed concerns only a specific instance of a Verticle. Every verticle listen to its specific topic. Only the creator of the Verticle knows the specific address of the Verticle and may share with other Verticles.
  • A generic topic is to be used when the sendor does not know about the recipient.
  • A generic topic may be used to broadcast messages that is of common interest.

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)}

Mine Block

  • Mine a block locally using a dummy transaction
  • Integrate the mined block into the blockchain.
  • Mining to be done in a separate component.
  • A node may have one or many miners.
  • A miner starts mining a block on receiving the message to mine. The message contains the necessary block information (called raw block).
  • If a miner receives a new raw block that has index greater than current block it is mining, it will abandon the current mining and start mining the new block.
  • A miner should be informed of any block mined by another miners. On receiving the message, the miner stops the current block mining if the new block's index is equal or superior to the the index of block it is currently mining.
  • The first implementation is to be done such that a block is found every 5 minute and be as little resource intensive as possible.

Peer discovery

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.

Make TCP ports customizable at runtime via system properties or environment variable

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

Write a README.md

Sections to include

  1. Introduction to project
  2. Getting Started
  3. Code base structure
  4. Contributing

Create first wallet

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.