Giter VIP home page Giter VIP logo

chainspace / chainspace-prototype Goto Github PK

View Code? Open in Web Editor NEW
57.0 57.0 37.0 26.11 MB

Chainspace is a distributed ledger platform for high-integrity and transparent processing of transactions within a decentralized system.

Home Page: https://chainspace.io

Java 31.64% Python 65.05% Shell 2.53% Roff 0.27% Makefile 0.23% Batchfile 0.14% Dockerfile 0.13%
blockchain consensus decentralization sharding

chainspace-prototype's Introduction

Please note: this is prototype code which serves as a validation of the ideas expressed in the Chainspace S-BAC peer-reviewed academic paper accepted by NDSS 2018. We are currently building out our production codebase in Go, and the Go codebase will be used going forward. We will replace this Java code with the Go code when it's feature-equivalent. Existing contract code will continue to function.

Chainspace

Chainspace is a distributed ledger platform for high-integrity and transparent processing of transactions within a decentralized system.

Developer Installation

The bulk of the code is to be found in chainspacecore. To run a network of chainspace nodes, you need to first compile and package this module.

Build

cd chainspacecore
mvn -Dversion=1.0-SNAPSHOT package assembly:single

This should produce an "uber jar" in the folder chainspacecore/target

Run

There are two parts to chainspace, the client and the network.

The network is a set of nodes that are communicating with each other based on the BFT SMaRt library.

The client is a http server which connects to the network and allows you to submit transactions.

./contrib/core-tools/easystart.mac.sh

This will show you all running chainspace processes:

ps aux | grep -v grep | grep chainspace | awk '{print $2 $11}'
ps aux | grep -v grep | grep chainspace | awk '{print $2 " " $11 " " $12 " " $13}'

If you need to kill everything:

ps aux | grep -v grep | grep chainspace | awk '{print $2}' | xargs kill

Developer Setup [IntelliJ Ultimate]

There are intellij modules in this folder for each of the submodules. Create a new empty project in intellij. A dialog will prompt you for the project structure, ignore this and wait for the project to load. You will see the .iml module files in the explorer and you can right click and import them to the project from there.

You will need to set the project sdk to be a JDK 1.8 and also a python virtualenv which you can create and link to each python module.

The modules are:

  • chainspaceapi [python]
  • chainspacecontract [python]
  • chainspacemeasurement [python]
  • chainspacecore [java]

You will need to add petlib manually to your python virtualenv from a shell... Intellij will have created your virtual env somewhere of your choosing indicated here as ($PATH_TO_VIRTUAL_ENV$)...

source $PATH_TO_VIRTUAL_ENV$/bin/activate
pip install petlib

chainspace-prototype's People

Contributors

asonnino avatar biaspro avatar futurechimp avatar gdanezis avatar musalbas avatar sheharbano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chainspace-prototype's Issues

Errors in tests when building the project

Once in the chainspacecore folder I am trying to build the chainspace core using mvn -Dversion=1.0-SNAPSHOT package assembly:single but get errors in the tests.

But if I skip the tests mvn -Dversion=1.0-SNAPSHOT -Dmaven.test.failure.ignore=true package assembly:single the project seems to be built successfully.

Can you fix the tests please?

Error message: https://ghostbin.com/paste/bghrt

UPD: was running the code on the linux machine.

issues when trying to run chainspace on ec2

Hi, I was trying to run tester.py clientlatency and all the ec2 were set properly
but somehow it went wrong:

inputs: ()
reference_inputs: ()
POST http://127.0.0.1:5000/api/1.0/transaction/process HTTP/1.1
{"transaction": {"inputIDs": [], "methodID": "init", "parameters": [], "outputs": ["o"], "returns": [], "dependencies": [], "referenceInputIDs": [], "contractID": "simulator"}, "store": {}}
Traceback (most recent call last):
File "tester.py", line 356, in
print t.measure_client_latency(min_batch, max_batch, batch_step, runs)
File "tester.py", line 83, in measure_client_latency
dumper.simulation_batched(num_transactions, inputs_per_tx=1, batch_size=batch_size, batch_sleep=1)
File "/Users/GiGi/PycharmProjects/chainspace-prototype/chainspacemeasurements/dumper.py", line 106, in simulation_batched
process(init_tx)
File "/Users/GiGi/PycharmProjects/chainspace-prototype/chainspacemeasurements/dumper.py", line 22, in process
client.process_transaction(transaction)
File "/Users/GiGi/PycharmProjects/chainspace-prototype/chainspaceapi/api.py", line 17, in process_transaction
r = requests.post(endpoint, json=transaction)
File "/Users/GiGi/PycharmProjects/chainspace-prototype/venv/lib/python2.7/site-packages/requests/api.py", line 112, in post
return request('post', url, data=data, json=json, **kwargs)
File "/Users/GiGi/PycharmProjects/chainspace-prototype/venv/lib/python2.7/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/GiGi/PycharmProjects/chainspace-prototype/venv/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/Users/GiGi/PycharmProjects/chainspace-prototype/venv/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/Users/GiGi/PycharmProjects/chainspace-prototype/venv/lib/python2.7/site-packages/requests/adapters.py", line 508, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /api/1.0/transaction/process (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x106654550>: Failed to establish a new connection: [Errno 61] Connection refused',))

Do you know how to fix this?

Running chainspace processes

Hello there!

When I try to run these 2 commands:

ps aux | grep -v grep | grep chainspace | awk '{print $2 $11}'
ps aux | grep -v grep | grep chainspace | awk '{print $2 " " $11 " " $12 " " $13}'

what exactly should be the output? Because I don't see any processes running.

UPD: was running the code on the linux machine.

Questions when running console client

Hi, this is Amy and I had some issues for this project.
I followed the instructions from the INSTALL.md to start the console client and it gave me the error: could not find or load main class.

Do you have any thoughts about how to make it work?

Also could you tell me how to have the result figures from the chainspacemeasurements folder?

best regards,
Amy

add more documentation

It is unclear from the project how to start and test, there is a script which starts multiple instances in screen but it doesn't facilitate analysis of what is going on and customisation of the test environment. for inclusion in DECODE OS we would like to have a breakdown of basic functions to setup nodes. We can also contribute if given some input and moved to decodeproject as mentioned in #37

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.