Giter Club home page Giter Club logo

core's Introduction

Mintlayer core

NOTE THIS REPO IS NOT LONGER UNDER ACTIVE DEVELOPMENT GO TO OUR NEW REPO

https://www.mintlayer.org/

For a more technical introduction to Mintlayer visit our docs.

A draft of the consensus paper can be found here.

Security issues

If you find an issue related to the security of Mintlayer then please contact us at [email protected] so we can address the issue. Mintlayer has a bug bounty program so if your security issue is valid you are elligble for a reward paid in MLT. Do not disclose the security issue publicly until the core Mintlayer team has agreed the issue can be disclosed. See SECURITY.md for more info.

Bugs

Non-security related bugs should be opened as issues in the core Mintlayer repo. Give as much detail as possible. If you want to fix a bug then see our guidelines for contributing.

How to build and run Mintlayer

Rust Setup

First, complete the basic Rust setup instructions.

Run

Use Rust's native cargo command to build and launch the template node:

cargo run --release -- --dev --tmp

Build

The cargo run command will perform an initial build. Use the following command to build the node without launching it:

cargo build --release

or

cargo build to build a debug version

to purge the local chain run ./target/release/mintlayer-core purge-chain --dev

Docs

Once the project has been built, the following command can be used to explore all parameters and subcommands:

./target/release/mintlayer-core -h

You can also find docs in the docs directory and within the directory for a specific pallet or lib.

Single-Node Development Chain

This command will start the single-node development chain with persistent state:

./target/release/mintlayer-core --dev

Purge the development chain's state:

./target/release/mintlayer-core purge-chain --dev

Start the development chain with detailed logging:

RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/mintlayer-core -lruntime=debug --dev

Connect with Polkadot-JS Apps Front-end

Once the node template is running locally, you can connect it with Polkadot-JS Apps front-end to interact with your chain. Click here connecting the Apps to your local node template.

Connect with Mintlayer's UI

TODO

Multi-Node Local Testnet

If you want to see the multi-node consensus algorithm in action, refer to our Start a Private Network tutorial.

Project Structure

Node

  • Networking: Mintlayer uses libp2p as its native networking stack for all inter-node communication.
  • Bootnodes: Mintlayer has bootnodes that a new node will attempt to boot to unless a specific node is specified by the user
  • Consensus: Mintlayer uses AURA as its base consensus algorithm for the time being. There will be an update to introduce DSA in the future but DSA is still in development.
  • Finality: Since we are using AURA for our consensus we currently rely on GRANDPA for finality.
  • Chain Spec: You can find our chain specification in chain_spec.rs. It defines the basics of the chain such as the genesis block and the bootnodes.
  • Services: service.rs defines the node implementation itself. It is here you'll find the consensus setup.

Runtime

For more information on what a runtime is follow the link. Code in the runtime must be written in no_std Rust since it compiles to Wasm.

  • lib.rs: The main file in Mintlayer's runtime. Here you'll find the Mintlayer specific code for block production such as the block production period.
  • staking.rs: Here you'll find Mintlayer's staking implementation.

Pallets

Mintlayer relies on a host of Substrate pallets and a few Mintlayer specific pallets.

  • pp: The implementation of programmable pools on Mintlayer. Essentially Wasm smart contracts
  • utxo: Mintlayer's UTXO system

Libs

Libs is home to code that is code that Mintlayer relies on but isn't technically a pallet.

  • chainscript: Mintlayer's bitcoin script implementation.
  • bech32: code for handling transactions with destinations encoded using bech32

Testing

You'll find unit tests littered throughout the codebase but the test directory is home to the functional test framework which is heavily based on Bitcoin's functional test framework.

Crypto

As it stands Mintlayer uses Schnorr for all crypto-related things. There is a plan to move to our BLS implementation in the near future but this, as it stands, is a work in progress.

Contributing

See this guide

Branches

The key branches are master and staging. Master is used for fully tested code, staging is used as the development branch. Fixes or features should be created on new branches branched from staging. A PR is then created to merge the branch into staging where it will require a review from a member of the Mintlayer team. To merge into master create a PR to merge staging to master, a review is required and CI will run. Only select people have push access to master.

Firewall rules

The node uses TCP port 30333 for communications, this needs to be opened if you want to allow inbound connections.

Using UFW: sudo ufw allow 30333/tcp

Using iptables: sudo iptables -A INPUT -p tcp --dport 30333 -j ACCEPT

core's People

Contributors

iljakuklic avatar b-yap avatar sinitcin avatar altonen avatar muursh avatar thequantumphysicist avatar erubboli 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.