GithubHelp home page GithubHelp logo

isabella232 / elixir-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aeternity/elixir-node

0.0 0.0 0.0 4.98 MB

Elixir full node implementation of the aeternity specification

License: ISC License

Elixir 99.08% Makefile 0.64% Dockerfile 0.16% Shell 0.12%

elixir-node's Introduction

Travis Build

CURRENTLY NOT COMPATIBLE TO THE AETERNITY NETWORK

This implementation aims to be a aims to be a full node that complies with the aeternity specification, in the current state this is not ready yet and should never be used to join the aeternity network.

Aeternity Elixir Full Node

This is an elixir full node implementation of the aeternity specification.

Compatibility to the erlang aeternity implementation is documented in docs/aeternity-erlang-compatibility.md.

Getting started

Required packages

Elixir 1.6 with Erlang/OTP20 is the basis of the project

Rust is needed for persistent storage dependency

libsodium 1.0.16 is needed for elliptic curve support

sudo apt-get install autoconf autogen libtool libgmp3-dev lsof
wget -O libsodium-src.tar.gz https://github.com/jedisct1/libsodium/releases/download/1.0.16/libsodium-1.0.16.tar.gz
mkdir libsodium-src && tar -zxf libsodium-src.tar.gz -C libsodium-src --strip-components=1
cd libsodium-src && ./configure && make && make check && sudo make install && cd ..

Fetching dependencies

mix deps.get

Starting the application

Start the application in interactive Elixir

  • Development config: make iex-0
  • Production config: MIX_ENV=prod make iex-0

The default sync port is 3015, this can be adjusted using SYNC_PORT=some_port iex -S mix phx.server. The node will run an http api at localhost:4000, this can be adjusted using PORT=some_port iex -S mix phx.server.

Usage

Elixir interactive api-calls

  • Miner.resume() to start the miner

  • Miner.suspend() to stop the miner

  • Miner.mine_sync_block_to_chain() mine the next block

  • Chain.top_block() to get the top block of the current chain

  • Chain.top_block_chain_state() to get the top block chainstate

  • Chain.chain_state(block_hash) to get the chainstate of certain block

  • Pool.get_pool() to get all transactions from the pool

  • Peers.all_peers() to get all connected peers

  • Peers.try_connect(%{host: host, port: port, pubkey: pubkey}) to manually connect a new peer

  • Peers.get_info_try_connect(uri) to connect to another elixir node, providing a get connection info interface

Running the tests

Run the testsuite with mix test

Logging

Debug, error, warning and info logs is found in apps/aecore/logs

Docker Container

A Dockerfile and docker-compose.yml are found in the base directory, prebuilt images are not yet published.

  • Build container docker build . -t elixir-node

  • Run node in container docker run --name elixir-node -it -p 4000:4000 -p 3015:3015 elixir-node

  • Run multiple nodes network with docker compose docker-compose up runs 3 connected nodes, with 2 mining

Detailed Usage

docs/detailed-usage.md

Developer Documentation

docs/developer-docs.md

elixir-node's People

Contributors

0legiv avatar andonov avatar artur64 avatar cheezus1 avatar cytadela8 avatar d-velev avatar danielaivanova avatar gorbak25 avatar gspasov avatar hristohr avatar meivantodorov avatar nedelcho-delchev-tues avatar nikolaidimitrov avatar rdimitrovbg avatar thepiwo avatar tony612 avatar untra avatar velzevur avatar willhol 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.