Git Product home page Git Product logo

radixdlt-core's Introduction

IMPORTANT

This repository has been archived as part of our move to a monorepo.

  • Monorepo is here
  • The code for this repo is available in the radixdlt-core subdirectory of the monorepo.

radixdlt-core

radixdlt-core is Radix's core consensus and networking module for the Radix Distributed Ledger. It includes a variant implementation of the HotStuff BFT-style consensus.

Table of contents

Building

Clone the required repository:

git clone https://github.com/radixdlt/radixdlt-core.git

Checkout the required branch:

cd radixdlt-core && git checkout release/1.0-beta.21

Run tests (note that integration tests take several minutes to run):

./gradlew test integrationTest

Unfortunately the integration tests currently use hardcoded TCP/UDP port numbers 12345 and 23456, and may fail if these ports are not available on your machine. We plan to fix this.

Launching

You will need docker and docker-compose installed to launch a node. We use Docker Desktop for Mac.

We generate initial validator keys and genesis/universe at launch time, so the easiest way to launch a set of nodes is to use the startup script provided.

./docker/scripts/rundocker.sh 2

The number indicates the count of nodes to include in the configuration. Configuration files are provided for node counts between 1 and 5 inclusive. Note that each node requires approximately 1GiB of RAM.

If you need to run docker-compose using sudo, this can be specified on the command line as well:

DOCKER_COMPOSE_LAUNCH="sudo -E docker-compose" ./docker/scripts/rundocker.sh 2

Note that the -E flag is required here, as startup information such as keys and universe configuration generated by the script is provided in environment variables.

API interface can be accessed via localhost:8080, eg:

curl localhost:8080/api/universe

See also radixdlt-java for a Java client library and radixdlt-js for Javascript.

Contribute

Contributions are welcome, we simply ask to:

  • Fork the codebase
  • Make changes
  • Submit a pull request for review

When contributing to this repository, we recommend discussing with the development team the change you wish to make using a GitHub issue before making changes.

Please follow our Code of Conduct in all your interactions with the project.

Links

Link Description
radixdlt.com Radix DLT Homepage
documentation Radix Knowledge Base
forum Radix Technical Forum
@radixdlt Follow Radix DLT on Twitter

License

The radixdlt-core code is released under the Apache 2.0 License.

radixdlt-core's People

Contributors

clstrfsck avatar danoshifusermoto avatar domhof avatar flotothemoon avatar lfeagan avatar lukasgasior1 avatar motoras avatar radixbot avatar sajjon avatar shambupujar avatar siy avatar talekhinezh avatar theoklitos 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

Watchers

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

radixdlt-core's Issues

Cannot launch

I keep getting the following error when trying to launch a node with docker-compose -f docker/single-node.yml up --build:

Building core Step 1/11 : FROM eu.gcr.io/lunar-arc-236318/base-core ERROR: Service 'core' failed to build: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication

Any advice on how to fix this?

Radix.java:120) - Unable to start -- can't connect to remote host (172.18.0.2):

pc@linux-a7b0:~/workarea/radix/my-radixexample/radixdlt-core> ./gradlew deb4docker
<-------------> 0% CONFIGURING [2s]
> root project > Resolve dependencies of detachedConfiguration3 > me.champeau.gradle.jmh.gradle.plugin-0.5.1.> root project > Resolve dependencies of detachedConfiguration3 > me.champeau.gradle.jmh.gradle.plugi
> Task :faucet-service:versionFile
Base tags : []

> Task :radixdlt:versionFile
Base tags : []

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings

pc@linux-a7b0:~/workarea/radix/my-radixexample/radixdlt-core> sudo docker-compose -f docker/single-node.yml up --build
[sudo] password for root: 
WARNING: The RADIXDLT_UNIVERSE variable is not set. Defaulting to a blank string.
WARNING: The RADIXDLT_UNIVERSE_TOKEN variable is not set. Defaulting to a blank string.
WARNING: The RADIXDLT_UNIVERSE_PRIVKEY variable is not set. Defaulting to a blank string.
Creating network "docker_single_node" with the default driver
[...docker build stuff...]
faucet_1  | wget: can't connect to remote host (172.18.0.2): Connection refused
core_1    | # 2020-11-22T08:49:19,944 [FATAL/Radix/main] (Radix.java:120) - Unable to start
core_1    | com.google.inject.ProvisionException: Unable to provision, see the following errors:
core_1    | 
core_1    | 1) Error in custom provider, java.lang.IllegalStateException: Error while deserialising universe
core_1    |   at com.radixdlt.CheckpointModule.universe(Unknown Source)
core_1    |   while locating com.radixdlt.universe.Universe
core_1    |     for the 2nd parameter of com.radixdlt.network.transport.udp.UDPTransportModule.natHandlerProvider(Unknown Source)
core_1    |   at com.radixdlt.network.transport.udp.UDPTransportModule.natHandlerProvider(Unknown Source)
core_1    |   while locating com.radixdlt.network.transport.udp.NatHandler
core_1    |     for the 5th parameter of com.radixdlt.network.transport.udp.NettyUDPTransportImpl.<init>(Unknown Source)
core_1    |   while locating com.radixdlt.network.transport.udp.NettyUDPTransportImpl
core_1    |   while locating com.radixdlt.network.transport.Transport annotated with @com.google.inject.internal.Element(setName=,uniqueId=11, type=MULTIBINDER, keyType=)
[...long stacktrace...]
Attaching to docker_faucet_1, docker_core_1
faucet_1  | Waiting for http://core:8080 to become ready ...
faucet_1  | wget: can't connect to remote host (172.18.0.2): Connection refused
core_1    | + find /usr -type f -name java -exec setfattr -n user.pax.flags -v em {} ;
core_1    | + env
core_1    | + sort
core_1    | HOME=/root
core_1    | HOSTNAME=fb561b744e25
faucet_1  | wget: bad address 'core:8080'
faucet_1  | wget: bad address 'core:8080'
faucet_1  | wget: bad address 'core:8080'
faucet_1  | wget: bad address 'core:8080'

Reduce cursor opens when fetching committed atoms

The current implementation in CommittedAtomsStore.getCommittedAtoms uses an approach that first pulls all committed atom ids and then fetches them by repeatedly fetching individual LedgerEntry. This results in repeatedly opening a new cursor. It is more efficient to address this by scrolling a single cursor. Architecturally, this could be done in one of two ways:

  1. adding a new method to the ledger store that takes a Collection of AtomIDs and returns a List of LedgerEntry
  2. adding a new method to the ledger store that returns an ImmutableList of committed LedgerEntry, rather than AtomID

As the LedgerEntryStoreView already has a precedent of returning LedgerEntry (no new imports), I feel it makes the most sense to add the new method getNextCommittedLedgerEntries, in the spirit of the existing method getNextCommitted, but returning LedgerEntry rather than AtomID. (Is it just me or is anyone else blah on AID plural being AIDs?)

I have a PR that implements this new method along with a new integration test that ensures the correct functionality that I will be attaching shortly.

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.