Git Product home page Git Product logo

biosphere's Introduction

Biosphere

Build Status

Distributed platform for services based on autonomic computing, organic computing and blockchain technologies.

Biosphere is a project to provide a platform for distributes applications, is based on the concept of organic computing where each element is autonomous follows the directive of the colectivity.

This implementation assume the distributed to be a tissue composed cells, all cells share a DNA that defines the behaviour of the tissue. To ensure the integrity of the DNA the blockchain technology is used, all changes in the DNA are registered in a public ledger that is shared amongst all cells.

The project is implemented in Java and defines the tissue protocol that enables other languages implementations.

Check out our wiki for more information in the wiki

biosphere's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

biosphere's Issues

Support new cell instance to rejoin tissue

Support one cell to rejoin the tissue, with:

  • already used certificate

  • old DNA

  • old Chain

  • The dead cell eviction should then not remove the cell but put it in a AWOL state

HTTP ServletTissueListener

Allow a new cell to without UDP access to the Tissue to join the tissue using the HTTP handler (TCP).

AbstractHandler

Embed all the repeated methods and attributes, make the implementation of a servlet service more simple.

GetTissueListenersHandler

Return a structure of the cells listening in the tissue with hostname and port, the service in the DNA is already available and being used the chain.

This will support to the mobile app to choose a cell to call TissueListenerTCP

This should be exposed as JSON

Service Discovery

Defined the service discovery in the Tissue, use the already prepared diagrams.

SLF4J does not respect the logging level definitions

//https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html
public final static String logLevelParameter = "org.slf4j.simpleLogger.defaultLogLevel";
public final static String logLevelValue = "trace";
public final static String logShowDateTimeParameter = "org.slf4j.simpleLogger.showDateTime";
public final static String logShowDateTimeValue = "true";
public final static String logOutputParameter = "org.slf4j.simpleLogger.logFile";
public final static String logOutputValue = "System.out";
public final static String logDateFormatParameter = "org.slf4j.simpleLogger.dateTimeFormat";
public final static String logDateFormatValue = "yyyy-MM-dd_HH:mm:ss:SSS";
public final static String jettLogLevelParameter = "org.eclipse.jetty.LEVEL";
public final static String jettLogLevelValue = "ALL";
public final static String jettLogOutputParameter = "org.eclipse.jetty.util.log.class";
public final static String jettLogOutputValue = "org.eclipse.jetty.util.log.Slf4jLog";
//public final static String jettLogOutputValue = "org.eclipse.jetty.util.log.StdErrLog";

Cell join tissue

  • Create new certificate sign request
  • Call certificate sign from the tissue
  • receives a new signed certificate from the tissue
  • uses the certificate as client and server

Cell startup process

  • Create keystore
  • Create private key
  • Create certificate sign request
  • Sign its own certificate

The appendBlock should be something common by all the local and remote calls

  • append(String payload)
    • create a newBlock with the payload
    • choose one of the pending blocks of the currentBlock (choosenNextBlock)
    • update the nextBlock in the current block to the choosenBlock
    • change the currentBlock to the choosenBlock
    • set the newBlock as pendingBlock of the currentBlock
    • notify the tissue of the new block
  • append(String JSONBlock)
    • check if the newBlock is valid
      • the prevBlock is the currentBlock or currentBlock pendingBlock
      • the calculated SHA-256 hash of the block matches provided hash
    • create a newBlock with the JSON
    • if the newBlock prevBlock is the currentBlock the add newBlock in the currentBlock's pendingBlocks
    • if the newBlock prevBlock is a pendingBlock of the currentBlock
      • update the nextBlock in the current block to the choosenBlock
      • change the currentBlock to the choosenBlock
      • set the newBlock as pendingBlock of the currentBlock
  • Should check first for the acceptance of the block before appending (if mostly rejected that wait for the currentBlock to be changed)

Cell only join once the tissue

Does not accept the Welcome request twice, control if it is processing the Welcome request and if had already joined a Tissue

Review Logger solution

Check a better solution for the loggin into the application

  • Support multi language
  • Multiple logging levels

ToFlat using JSON

/*
ObjectMapper mapper = new ObjectMapper();

String flatInString=null;
String flatReturn=null;
try
{
  flatInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this);
  flatReturn = mapper.writeValueAsString(this);
}
catch (JsonProcessingException e)
{
  e.printStackTrace();
}
System.out.println(flatInString);

return flatReturn;
*/

/**'
  • Return one Block created from a String structure
  • @param String
  • @return
    /
    private Block blockFromFlat(String flatBlock)
    {
    /

    Block block = null;
    ObjectMapper mapper = new ObjectMapper();
    try
    {
    block = mapper.readValue(flatBlock, Block.class);
    //TODO check if the Hash of the just created block matches the hash sent, raise one exception in case fails
    }
    catch (JsonMappingException | JsonParseException e)
    {
    e.printStackTrace();
    }
    catch (IOException e)
    {
    e.printStackTrace();
    }
    return block;
    */
    return null;
    }

WelcomeResponse

Support three messages (Greetings,Busy,AlreadyJoined)

TissueListener should be able to handle the different responses in a appropriate way.

Migrate DNA to JSON

Review the DNA to keep working with XML or move to JSON
JSON is easier to maintain and the structure of the DNA is not that complex right now.

Mobile application persistence

Get ready in the API to the used by a mobile application

  • save keystore
  • save DNA
  • save Chain

This will require the cell to be able to rejoin a tissue #44

Service load class handler

Requires the DNA to support the byte code of the service in the classloader
The bytecode of the service will be stored in the DNA and loaded as needed when the service is instantiated.

If tissue join timeout < acceptanceTimeout error and fail to start

Joining cell is giving up before the acceptance was decided...

public final static long acceptanceTimeout = 2000L;
public final static long acceptanceInterval = 500L;
public final static int joinMaxRetries = 1;
public final static String joinPollInternval = "5000";

flatBlock format

blockID:timestamp:cellID:Base64(prevHash):prevBlockID:Base64(payload):Base64(blockHash):nextBlockID

Service discovery

Implement the service discovery protocol, this requires to have the service control start/stop to be working

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.