Giter Site home page Giter Site logo

alephium / alephium Goto Github PK

View Code? Open in Web Editor NEW
142.0 16.0 55.0 22.68 MB

Reference client for Alephium protocol

Home Page: https://www.alephium.org

License: GNU Lesser General Public License v3.0

Scala 96.61% Makefile 0.01% Shell 0.03% Java 3.34%
blockchain utxo sharding scala defi alephium

alephium's Introduction

Alephium

codecov Discord

This repository contains the reference implementation of Alephium, a sharded blockchain that makes programmable money scalable and secure. For more information, please visit the wiki.

Overview

The protocol's innovations extend battle-tested ideas from Bitcoin and Ethereum:

  • BlockFlow algorithm based on UTXO model enables sharding and scalability for today (code + algorithm paper)
    • The first sharding algorithm that supports single-step cross-shard transactions, offering the same user experience as single chain
    • Simple and elegant PoW based sharding, does not rely on beacon chain
  • Stateful UTXO model combines the advantages of both eUTXO model and account model (see code, wiki to come)
    • Tokens are first-class citizens and UTXO-based, which are owned by users directly instead of contracts
    • Offer the same expressiveness as account model. DApps can be easily built on top of it with better security
    • Support multiple participants in a single smart contract transaction. Multiple calls can be packed into a single transaction too.
  • Novel VM design resolves many critical challenges of dApp platforms (see code, wiki to come)
    • Less IO intensive
    • Flash loan is not available by design
    • Eliminate many attack vectors of EVM, including unlimited authorization, double dip issue, reentrancy attack, etc
    • UTXO style fine-grained execution model reduces risk-free arbitrage
  • PoLW algorithm reduces the energy consumption of PoW in the long term (research paper)
    • Adaptive rewards based on hashrate and timestamp are designed and implemented
    • Internal mining cost through burning will be activated when hashrate and energy consumption is significantly high

Installation

Prerequisites

The following dependencies must be installed in order to run the JAR deliverable:

  • java (11+)

Running

You can obtain our latest single JAR distribution from the GitHub releases and start the application using the following command:

java -jar alephium-<VERSION>.jar

Build From Source

Requirements

In order to build the project from source the following dependencies must be installed on your system:

  • java (11+)
  • SBT

Single JAR

Use the following command to build a single runnable JAR :

make assembly

The resulting assembly file will appear in /app/target/scala-2.13/ directory.

Universal Zip distribution

Use the following command to build a zip distribution including launch scripts:

make package

The resulting package file will appear in the app/target/scala-2.13/universal directory.

Docker Image

Use the following command to build a docker image:

make docker

Configuration

You can define user specific settings in the file $ALEPHIUM_HOME/user.conf, where by default $ALEPHIUM_HOME points to ~/.alephium.

Testing

There are two kinds of tests:

  1. Unit tests and property based tests, which can be run with the make test command.
  2. Integration tests, which can be run with the make itest command.

Contribution

Have a look at our contribution guide described in CONTRIBUTING.md

Acknowledgements

YourKit supports open source projects with innovative and intelligent tools for monitoring and profiling Java and .NET applications. YourKit is the creator of YourKit Java Profiler, YourKit .NET Profiler, and YourKit YouMonitor.

alephium's People

Contributors

0xbasar avatar aloiscochard avatar arbaba avatar gvakhrushev avatar h0ngcha0 avatar jimmyhoffa avatar killerwhile avatar lbqds avatar nop33 avatar polarker avatar ross-weir avatar simerplaha avatar suyanlong avatar sven-hash avatar tdroxler avatar zheli 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  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

alephium's Issues

Single wallet info API call

Issue type

Feature request

Affected version

v0.7.5

Description

A API GET /wallets/{wallet_name} would be useful to get details about a single wallet, such as "Is my wallet locked?"
Currently iterating through all the wallets is needed to do the same.

Improve networking API

  • group all of the networking api under the same section
  • add an API to ban IP manually
  • add an API for unreachable IP
  • add more information for inter clique cliques: client version for example

Undeterministic wallet restore

so :

  • if i restore wallet with mnemonic and after going to check balance it gives me new wallet addres.
  • than i have to delete it , restore again and go first to "list your wallets address" and then to check balance and it will be my old wallet

InternalServerError returned by the API doesn't comply to APIError

Issue type

Improvement

Affected version

v0.7.5

Description

InternalServerError are not mapped to APIError. For instance, from the logs:

No status code mapping for value: InternalServerError(Not enough balance)

It would be really convenient to keep the same error wrapping, making API client easier to write (2xx code -> one type of object, non 4xx/5xx -> another type of object)

Also true for (probably not exhaustive, but that's the one I saw):

  • OutOfGas
  • TooManyInputs
  • NonExistInput

Add a --help parameter in the jar to list available options

Issue type

improvement

Affected version

v0.7.1

Description

Not all sysadmins are familiar with hocon format, nor are wanting to unzip config files from the jar to get the list of available parameters and their defaults.

An improvement would be to add a --help parameter (or --dump-config) which details the configuration parameters and the current value.

Get wallet should return 404 (not found) if the wallet does not exist

Issue type

improvement

Affected version

v0.7.1

Description

The get wallet API call returns 400 (server error) when the wallet does not exist.
It should return 404 (not found) instead.

How to reproduce

Call get wallet on a non existing wallet, you'll get a 400 (server error)

List wallets should always list the wallets, even when locked

Issue type

bug

Affected version

v0.7.1

Description

The list wallets API call returns 401 when at least one wallet is locked.
Since the response contains a lock flag, it should always list all the wallets.

How to reproduce

Create two wallets, wait until they are locked, unlock one, call list wallet function. It returns 401.
Unlock the second one, it returns the correct list of wallet.

Add a `reason` field in error responses

Issue type

improvement

Affected version

v0.7.1

Description

The error response are rather rough, they especially do not return any meaningful reason of the error (except a "server error").
It would be good for the caller to get more details about the error.

Documentation

  • Ability to start mining on boot.
  • Ability to configure number of CPUs for mining.
  • Documentation about each configuration parameter.
  • Documentation about active wallet, locked amount, semantics in general.

Add an option to auto-start mining at startup

Issue type

improvement

Affected version

v0.7.3

Description

Currently "start-mining" API call must be explicitly called after alephium restart.
An option to turn on auto-start mining at startup might be convenient!

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.