Coder Social home page Coder Social logo

my-cloud / ruthenium Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 1.0 4.52 MB

Golang implementation of the Ruthenium protocol

License: The Unlicense

Dockerfile 0.16% Go 93.66% HTML 6.19%
blockchain cryptocurrency sustainable proof-of-humanity p2p ecdsa cryptography decay sha256 income

ruthenium's Introduction

Ruthenium

Release Build

Ruthenium coin

Description

Doc Doc

Golang implementation of the Ruthenium protocol.

You will find a detailed description of the project in the wiki. To understand the motivations behind the creation of this blockchain, you can peruse the comprehensive details outlined in the Ruthenium whitepaper.

Quickstart

There are two ways to run a Ruthenium node. You can either use your own build from sources (Option A) or use a docker image provided in the repository packages (Option B).

Prerequisites

  • Option A (using sources):
    • You need to have Go installed.
    • If you are using Windows, you need to have tdm-gcc installed.
  • Option B (using docker image):
    • You need to have Docker installed.
  • Your firewall port 10600 must be open (please read "Program arguments" section of the node and UI server documentation if you want to use another port than 10600).
  • To get an income or validate blocks ou need to be registered in the Proof of Humanity registry.

Installation

  • Option A (using sources):
    • Download the sources archive:
      https://github.com/my-cloud/ruthenium/releases/latest
      
  • Option B (using docker image):
    • Pull the image:
      sudo docker pull ghcr.io/my-cloud/ruthenium:latest
      

Launch

  • Option A (using sources):
    • Extract files from the sources archive
    • At root level (ruthenium folder), run the node:
      go run src/node/main.go -private-key=<private key>
      
    • At root level (ruthenium folder), run the UI server:
      go run src/ui/main.go -host-ip=<your external IP address>
      
  • Option B (using docker image):
    • Run the node:
      sudo docker run -p 10600:10600 -ti ghcr.io/my-cloud/ruthenium:latest \app\node -private-key=<private key>
      
    • Run the UI server:
      sudo docker run -p 8080:8080 -ti ghcr.io/my-cloud/ruthenium:latest \app\ui -host-ip=<your external IP address>
      
  • Using a web browser, go to:

APIs

Contributing

Forks Stars

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please do not hesitate to report a new bug or request a new feature. Of course, you are welcome to fork the repository and create a pull request. In any case, please let's take a look at the contributing file.

⭐ Don't forget to give the project a star! Thanks again!

Contact

Founder: Jérémy Pansier - [email protected]

Repository: https://github.com/my-cloud/ruthenium

Authors and Acknowledgments

Contributors

Special thanks to Gwenall Pansier who contributed since the early developments.

For a tutorial to create a first blockchain in Go, thanks to Yuko Sakai & Jun Sakai.

License

License

license.png

Project status

Commit activity

Maintainability Security Reliability Coverage

While the main principles have been implemented, there is still a substantial amount of refactoring and test implementation remaining.

ruthenium's People

Contributors

dependabot[bot] avatar gwenall avatar jeremypansier avatar wendytp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

grantokawa

ruthenium's Issues

Block can have no reward recipient

Investigate if it can be an issue (i.e. to find the oldest reward recipient) and if so, solve it by adding a rule to always have a single reward recipient

Use broadcast messages

  • Use broadcast messages to send to the client:
    • success or failure messages
    • message informing that the wallet amount has changed
    • message informing that the transactions pool has changed
  • Do the appropriated treatment when receiving a message

💡see https://pkg.go.dev/context#Context.Done and use it here

Transaction don't have fee

If there is no transaction fee, the blockchain network is vulnerable to transactions spam.

  • Add transaction fee

Store and load the blockchain from a file

Context
Verifying the whole blockchain might take more time as it grows up.

Description
A lot of time can be saved if the blockchain can be stored into a file to be loaded the next time the node is started.

Tasks
Try to split the feature into small tasks.

  • Make it possible to store the blockchain into a file
  • Make it possible to load the blockchain from a file

Limit block size

Context
A hudge transactions count might lead to a blockchain propagation time to out of the validation delay.

Description
The problem might be avoided by limiting the number of transactions to be included into the next block. Higher transactions fees might be applied to ensure a transaction to be in the next block.

Tasks

  • Limit the block size or the number of transactions to be included into the next block.
  • If needed, propose to pay more fees to increase the chance of a transaction to be in the next block.

Fix get amount error when address is empty

In GitLab by @Styks on Jul 27, 2022, 18:44

When the wallet address is empty in a request from wallet side, the blochain side logs error because of a nil pointer dereference.

  • log it on wallet side only
  • handle the case to not get a nil pointer dereference on blockchain side

Limit Outbounds

In GitLab by @Styks on Sep 7, 2022, 12:07

  • Limit Outbound connections to 8
  • Change the validation process:
    • Validate
    • Resolve conflicts every 10 seconds
    • Don't ask for consensus
  • Remove consensus from the API

Improve blockchain reliability

In GitLab by @Styks on Jul 22, 2022, 08:21

  1. Only clear the transaction pool if a new block is validated
  2. Remove DeleteTransactions from the blockchain API
  3. Disallow start mining more than once

Validate transaction

In GitLab by @Styks on Aug 2, 2022, 14:37

  • Make the transaction be added to the pool only if the sender address correspond to the public key

Extract configuration variables

Context
Some of the constants defined in the project might have to be changed later on. It is a shame to modify source code to just change a setting.

Description
Most of the constants might be extracted to a configuration file

Tasks

  • Extract constants into a configuration file.

Update module name

the go.mod module name points to the gitlab repository. Update it to reflect the github repository.

Update release documentation

When merging with rebase onto main, each commit is added individually, and their revision identifiers seem to differ from those of dev. To avoid conflicts for the next release, the release branch must be merged locally to main.

Verify neighbors requests

In GitLab by @Styks on Aug 2, 2022, 08:43

  • Don't add in a new block the transactions from a sender wallet which have insufficient amount
  • Make ResolveConflict not accepting a blockchain with transactions which could not have been performed (verify signature and amount)
  • Propagate transactions pool
  • Make ResolveConflict not accepting a blockchain with mining rewards exceeding the consented one
  • Verify mining delay

Add universal basic income

Context
Since the wallet amount is decreasing, people need a basic income to be interested in creating an account.
Since the validators need an incentive to add as much as transactions as possible into the next block, the reward must depend on transaction fees.

Description
The validator reward must be replaced by the transaction fees.
Every wallet must get a basic income.

Tasks

  • Verify the Proof of Humanity for every wallet
  • Give a basic income to every wallet that is registered
  • Replace the actual reward calculation by the transaction fees

Proof of Humanity is known using a REST API instead of directly reading smart contract

For a first implementation, we taken the easy way. To know if someone is registered in the Proof of Humanity registry, we are requesting this REST API. This is a vulnerability because the data is centralized. We need to gather the information in a decentralized manner. To do so, we can directly read the isRegistered value from the Proof of Humanity smart contract.

  • Directly read the Proof of Humanity smart contract isRegistered value

💡 Here is where the REST API is called in our code

💡 This seems to be a good tutorial to know how to read a smart contract

Add a CI linter

  • add the following job in the quality workflow:
jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v3
        with:
          go-version: 1.18
      - uses: golangci/golangci-lint-action@v3

Improve neighbors finding

In GitLab by @Styks on Jul 22, 2022, 08:20

  • Fix timeout error (read tcp 192.168.1.90:5000->192.168.1.90:62368: i/o timeout)
  • Find neighbors only when needed
  • Investigate about how is done the neighbor finding for famous blockchains and apply it

Change release process

We need to create a release branch

  • edit the contributing file
  • edit the docker-publish.yml
  • add LABEL org.opencontainers.image.description DESCRIPTION in the Dockerfile

Wip packages are publicly visible

  • In the ruthenium/.github/workflows/docker-publish.yml file, remove the dev branch.

Instead of:

on:
  push:
    branches: [ "main", "dev" ]

We want:

on:
  push:
    branches: [ "main" ]

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.