GithubHelp home page GithubHelp logo

threadshare / rchain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rchain/rchain

0.0 1.0 0.0 34.88 MB

License: Other

Scala 65.36% Makefile 1.84% Common Lisp 0.01% PostScript 5.31% C++ 16.89% C 5.18% Python 4.06% Perl 0.01% Roff 0.37% Shell 0.44% CMake 0.13% Scheme 0.19% Nix 0.01% sed 0.01% Dockerfile 0.02% TLA 0.19%

rchain's Introduction

RChain

Build Status codecov

The open-source RChain project is building a decentralized, economic, censorship-resistant, public compute infrastructure and blockchain. It will host and execute programs popularly referred to as “smart contracts”. It will be trustworthy, scalable, concurrent, with proof-of-stake consensus and content delivery.

RChain Developer features project-related tutorials and documentation, project planning information, events calendar, and information for how to engage with this project.

Note on the use of this software

This code has not yet completed a security review. We strongly recommend that you do not use it in production or to transfer items of material value. We take no responsibility for any loss you may incur through the use of this code.

Use the public testnet

The RChain Cooperative maintains a public testnet running the latest version of RNode. Learn more at RChain public testnet information.

Installation

Docker

$ docker pull rchain/rnode

Debian/Ubuntu

  1. Download a .deb package from the releases page
  2. $ sudo apt install ./rnode_<VERSION>.deb, where <VERSION> is something like 0.9.18

RedHat/Fedora

  1. Download a .rpm package from the releases page
  2. $ sudo rpm -U ./rnode_<VERSION>.noarch.rpm, where <VERSION> is something like 0.9.18

macOS

  1. Install Homebrew by following steps at the Homebrew homepage
  2. $ brew install rchain/rchain/rnode

Running

Docker will be used in the examples port portability reasons, but running the node as a standalone process is very similar.

To fetch the latest version of RNode from the remote Docker hub and run it (exit with C-c):

$ docker run -v $HOME/tmp:/var/lib/rnode -ti -p 40400:40400 rchain/rnode:latest

In order to use both the peer-to-peer network and REPL capabilities of the node, you need to run more than one Docker Rnode on the same host, the containers need to be connected to one user-defined network bridge:

$ docker network create rnode-net

$ docker run -v $HOME/tmp/peer0:/var/lib/rnode -dit --name rnode0 --network rnode-net rchain/rnode:latest run -s --network localnet

$ docker ps
CONTAINER ID        IMAGE                      COMMAND             CREATED             STATUS              PORTS               NAMES
15aa78b45da4        rchain/rnode:latest        "/bin/main.sh -s"   3 seconds ago       Up 2 seconds                            rnode0

To attach terminal to RNode logstream execute

$ docker logs -f rnode0
[...]
08:38:11.460 [main] INFO  logger - Listening for traffic on rnode://[email protected]?protocol=40400&discovery=40404
[...]

A repl instance can be invoked in a separate terminal using the following command:

$ docker run -v $HOME/tmp/rnode-repl:/var/lib/rnode -it --name rnode-repl --network rnode-net rchain/rnode:latest --grpc-host rnode0 repl

  ╦═╗┌─┐┬ ┬┌─┐┬┌┐┌  ╔╗╔┌─┐┌┬┐┌─┐  ╦═╗╔═╗╔═╗╦
  ╠╦╝│  ├─┤├─┤││││  ║║║│ │ ││├┤   ╠╦╝║╣ ╠═╝║
  ╩╚═└─┘┴ ┴┴ ┴┴┘└┘  ╝╚╝└─┘─┴┘└─┘  ╩╚═╚═╝╩  ╩═╝

rholang $

Type 5 in REPL console. This command should result in (rnode0 output):

[...]
Evaluating:
5

A peer node can be started with the following command (note that --bootstrap takes the listening address of rnode0):

$ docker run -v $HOME/tmp/peer1:/var/lib/rnode -it --name rnode1 --network rnode-net rchain/rnode:latest run --network localnet --bootstrap 'rnode://[email protected]?protocol=40400&discovery=40404'
[...]
08:58:36.267 [main] INFO  logger - Listening for traffic on rnode://[email protected]?protocol=40400&discovery=40404.
08:58:36.279 [main] INFO  logger - Bootstrapping from #{PeerNode ee00a5357f2f4cb58b08a8a4c949da1b}.
08:58:36.294 [main] INFO  logger - Initialize first phase handshake (encryption handshake) to #{PeerNode ee00a5357f2f4cb58b08a8a4c949da1b}
08:58:36.816 [repl-io-29] INFO  logger - Initialize second phase handshake (protocol handshake) to #{PeerNode ee00a5357f2f4cb58b08a8a4c949da1b}
08:58:36.890 [repl-io-30] INFO  logger - Connected #{PeerNode ee00a5357f2f4cb58b08a8a4c949da1b}.
08:58:41.939 [repl-io-30] INFO  logger - Peers: 1.

The above command should result in (rnode0 output):

08:58:36.769 [repl-io-29] INFO  logger - Responded to encryption handshake request from #{PeerNode 29d77e8cfd924db49e715d4cf4eeb28d}.
08:58:36.882 [repl-io-29] INFO  logger - Responded to protocol handshake request from #{PeerNode 29d77e8cfd924db49e715d4cf4eeb28d}
08:58:37.211 [repl-io-35] INFO  logger - Peers: 1.

To get a full list of options rnode accepts, use the --help option: $ docker run -it rchain/rnode --help.

Configuration file

Most of the command line options can be specified in a configuration file rnode.conf.

The default location of the configuration file is the data directory. An alternative location can be specified with the command line option --config-file <path>.

The format of the configuration file is HOCON.

The reference.conf configuration file shows all options and default values.

Example configuration file:

rnode {
  server {
    host = localhost
    upnp = false
    port = 40400
    port-http = 40403
    port-kademlia = 40404
    port-admin-http = 40405
    send-timeout = 2 seconds
    standalone = false
    bootstrap = "rnode://[email protected]?protocol=40400&discovery=40404"
    data-dir = "/var/lib/rnode"
    store-size = 1G
    map-size = 1G
    max-connections = 500
    max-message-size = 256K

    tls {
      certificate = /etc/ssl/node.certificate.pem"
      key = /etc/ssl/node.key.pem
    }

    metrics {
      prometheus = false
      influxdb = true
      zipkin = false
      sigar = false
    }
  }

  grpc {
    host = localhost
    port-external = 40401
    port-internal = 40402
  }

  casper {
    # validator-public-key =
    # validator-private-key-path =
    # bonds-file =
    # known-validators-file =
    validators = 5
   }
}

Development

Compile the project with:

$ sbt clean rholang/bnfc:clean rholang/bnfc:generate compile node/docker:publishLocal

Run the resulting binary with:

$ ./node/target/docker/stage/opt/docker/bin/rnode

For more detailed instructions, see the developer guide.

Caveats and filing issues

Caveats

During this pre-release phase of the RChain software, there are some known issues.

Filing Issues

File issues in our Public Jira Instance: File a bug

Acknowledgements

We use YourKit to profile rchain performance. YourKit supports open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of YourKit Java Profiler and YourKit .NET Profiler, innovative and intelligent tools for profiling Java and .NET applications.

Licence information

To get summary of licenses being used by the RChain's dependencies, simply run sbt node/dumpLicenseReport. The report will be available under node/target/license-reports/rnode-licenses.html

rchain's People

Contributors

9rb avatar abnerzheng avatar adaszko avatar arturgajowy avatar birchmd avatar bors[bot] avatar dckc avatar dosofredriver avatar dzajkowski avatar echatav avatar encodepanda avatar goral09 avatar griff-pyrofex avatar guardbotmk3 avatar henrytill avatar jeremybusk avatar kellyatpyrofex avatar kentshikama avatar kirkwood avatar kjmcqueen avatar lukasz-golebiewski avatar nashef avatar nzpr avatar odeac avatar pyrocto avatar tgrospic avatar tymm avatar woky avatar ys-pyrofex avatar zsluedem avatar

Watchers

 avatar

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.