Giter Club home page Giter Club logo

thelindaprojectinc / metrix Goto Github PK

View Code? Open in Web Editor NEW
41.0 22.0 18.0 25.78 MB

Decentralized, Anonymous, Fast & Secure Cryptocurrency

Home Page: https://metrixcoin.com

License: MIT License

Makefile 1.01% C++ 72.32% Shell 3.81% Python 13.87% C 5.55% HTML 0.13% CSS 0.65% Assembly 0.82% M4 1.33% Java 0.18% Scheme 0.04% QMake 0.01% Batchfile 0.03% Perl 0.01% CMake 0.05% Objective-C++ 0.03% Sage 0.18%
cryptocurrency decentralized blockchain metrix evm solidity

metrix's Introduction

Metrix Coin

license release cpp-linter build

What is Metrix?

Metrix is a decentralized blockchain project forked from Qtum, built on Bitcoin's UTXO model, with support for Ethereum Virtual Machine based smart contracts, and secured by a proof of stake consensus model. It achieves this through the revolutionary Account Abstraction Layer which allows the EVM to communicate with Metrix's Bitcoin-like UTXO blockchain. For more general information about the original Qtum blockchain, go to https://qtum.org

Welcome to the Metrix Ignition Main Network. This is the main network where the tokens hold value and should be guarded very carefully. If you are testing the network, or developing unstable software on Metrix, we highly recommend using either testnet or regtest mode.

The major features of the Metrix network include:

  1. Compatibility with the Ethereum Virtual Machine, which allows for compatibility with most existing Solidity based smart contracts. No special solidity compiler is required to deploy your smart contract to Metrix.
  2. A Proof of Stake consensus system which is optimized for Metrix's contract model. Any user can stake and help to secure the network.
  3. The Decentralized Governance Protocol is completely implemented and functional, which allows certain network parameters to be modified without a fork or other network disruption. This currently controls parameters like block size, gas prices, etc.
  4. Uses the UTXO transaction model and is compatible with Bitcoin, allowing for existing tooling and workflows to be used with Metrix. This allows for the infamous SPV protocol to be used which is ideal for light wallets on mobile phones and IoT devices.

Note: Metrix Core is considered beta software. We make no warranties or guarantees of its security or stability.

Metrix Documentation and Usage Resources

These are some resources that might be helpful in understanding Metrix.

Basic usage resources:

Core Team

Administrators

•. Trent Richards - CEO

• Chris Bowe - Director of Web-wallet & Pool

What is Metrix Core?

Metrix Core is our primary mainnet wallet. It implements a full node and is capable of storing, validating, and distributing all history of the Metrix network. Metrix Core is considered the reference implementation for the Metrix network.

Metrix Core currently implements the following:

  • Sending/Receiving MRX coins
  • Sending/Receiving MRC20 tokens on the Metrix network
  • Sending/Receiving MRC721 tokens on the Metrix network
  • Staking and creating blocks for the Metrix network
  • Creating and interacting with smart contracts
  • Running a full node for distributing the blockchain to other users
  • "Prune" mode, which minimizes disk usage
  • Regtest mode, which enables developers to very quickly build their own private Metrix network for Dapp testing
  • Testnet mode, using the public Metrix Testnet
  • Compatibility with the Bitcoin Core set of RPC commands and APIs
  • Full SegWit capability with p2sh-segwit (legacy) and bech32 (native) addresses

Alternative Wallets

Metrix Core uses a full node model, and thus requires downloading the entire blockchain. If you do not need the entire blockchain, and do not intend on developing smart contracts, it may be more ideal to use an alternative wallet such as one of our light wallets that can be synchronized in a matter of seconds.

Altitude

Download: https://github.com/TheLindaProjectInc/Altitude/releases

Paper Wallet

https://paper.metrixcoin.com

Web Wallet

https://webwallet.metrixcoin.com

Community Resources

Make sure to check out these resources as well for more information and to keep up to date with all the latest news about Metrix. At least 1 developer is always around, so if you're developing on Metrix and need help, we'd love to welcome you to our community.

Website
Discord
Reddit
Twitter
GitHub

Metrix Smart Contract Limitations

  • EVM smart contracts cannot receive coins from or send coins to any address type other than pay-to-pubkeyhash (starts with M) addresses. This is due to a limitation in the EVM
  • Contracts are not allowed to create contracts with an initial endowment of coins. The contract must first be created, and then be sent coins in a separate transaction. Humans are also not allowed to create contracts with an initial endowment of coins.
  • Although all of the infrastructure is present, Metrix Core does not currently parse Solidity event data. You must parse this yourself using either searchlogs or -record-log-opcodes features.
  • It is not possible to send a contract coins without also executing the contract. This is also the case of Ethereum. This was promised in earlier discussions and technically does work, but due to lack of time for testing this feature was disabled. We hope to reenable this feature with release of the x86 virtual machine in 2020.
  • In Metrix there can be multiple addresses used to create a proof-of-stake block. However, the EVM can only see the first output using the coinbase operation in Solidity (this address is also the one registered for the continuous staker rewards after 500 blocks).

Building Metrix Core

Validate and Reproduce Binaries

Metrix uses a tool called Gitian to make reproducible builds that can be verified by anyone. Instructions on setting up a Gitian VM and building Metrix are provided in Gitan Building

Build on Ubuntu

This is a quick start script for compiling Metrix on Ubuntu

Low resource systems need swap space to compile this also

## Create Swapfile
fallocate -l 3G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
sudo echo -e "/swapfile none swap sw 0 0 \n" >> /etc/fstab

sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils git cmake libboost-all-dev libgmp3-dev
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev

# If you want to build the Qt GUI:
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler qrencode

git clone https://github.com/TheLindaProjectInc/metrix --recursive
cd metrix

# Note autogen will prompt to install some more dependencies if needed
./autogen.sh
./configure --disable-bench
make -j2

Build on CentOS

Here is a brief description for compiling Metrix on CentOS, for more details please refer to the specific document

# Compiling boost manually
sudo yum install python-devel bzip2-devel
git clone https://github.com/boostorg/boost.git
cd boost
git checkout boost-1.66.0
git submodule update --init --recursive
./bootstrap.sh --prefix=/usr --libdir=/usr/lib64
./b2 headers
sudo ./b2 -j4 install

# Installing Dependencies for Metrix
sudo yum install epel-release
sudo yum install libtool libdb4-cxx-devel openssl-devel libevent-devel gmp-devel

# If you want to build the Qt GUI:
sudo yum install qt5-qttools-devel protobuf-devel qrencode-devel

# Building Metrix
git clone --recursive https://github.com/TheLindaProjectInc/metrix.git
cd metrix
./autogen.sh
./configure --disable-bench
make -j4

Build on Mac OS

The commands in this guide should be executed in a Terminal application. The built-in one is located in /Applications/Utilities/Terminal.app.

Preparation

Install the Mac OS command line tools:

xcode-select --install

When the popup appears, click Install.

Then install Homebrew.

Dependencies

brew install cmake automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf qt5 libevent imagemagick librsvg qrencode gmp

NOTE: Building with Qt4 is still supported, however, could result in a broken UI. Building with Qt5 is recommended.

Build Metrix Core

  1. Clone the metrix source code and cd into metrix

     git clone --recursive https://github.com/TheLindaProjectInc/metrix.git
     cd metrix
    
  2. Build metrix-core:

    Configure and build the headless metrix binaries as well as the GUI (if Qt is found).

    You can disable the GUI build by passing --without-gui to configure.

    ./autogen.sh
    ./configure --disable-bench
    make
    
  3. It is recommended to build and run the unit tests:

    make check
    

Run

Then you can either run the command-line daemon using src/metrixd and src/metrix-cli, or you can run the Qt GUI using src/qt/metrix-qt

License

Metrix is GPLv3 licensed.

Development Process

The master branch is regularly built and tested, but is not guaranteed to be completely stable. Tags are created regularly to indicate new official, stable release versions of Metrix.

The contribution workflow is described in CONTRIBUTING.md.

Testing

Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.

Automated Testing

Developers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: make check. Further details on running and extending unit tests can be found in /src/test/README.md.

There are also regression and integration tests, written in Python, that are run automatically on the build server. These tests can be run (if the test dependencies are installed) with: test/functional/test_runner.py

Manual Quality Assurance (QA) Testing

Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.

metrix's People

Contributors

blackout00000 avatar braaparound avatar davidstoneham avatar justintether avatar nibbles83 avatar seqsee avatar squidicuzz 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

Watchers

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

metrix's Issues

Altitude Language settings not saved

In the Altitude wallet you have the option to change language. This works for the current session in the wallet. But when you close down the wallet and open it up again it's in my native language again (Dutch).

Compilation fails

I've downloaded the latest master branch.
Compilation fails here:
In file included from ./qtum/qtumstate.h:10,
from ./validation.h:41,
from bench/block_assemble.cpp:11:
./qtum/qtumtransaction.h: In static member function ‘static VersionVM VersionVM::fromRaw(uint32_t)’:
./qtum/qtumtransaction.h:24:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
24 | VersionVM x = (VersionVM)&val;
| ^~~~~~~~~~~~~~~~
./qtum/qtumtransaction.h:24:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
In file included from ./qtum/qtumstate.h:10,
from ./validation.h:41,
from bench/checkblock.cpp:9:
./qtum/qtumtransaction.h: In static member function ‘static VersionVM VersionVM::fromRaw(uint32_t)’:
./qtum/qtumtransaction.h:24:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
24 | VersionVM x = (VersionVM)&val;
| ^~~~~~~~~~~~~~~~
./qtum/qtumtransaction.h:24:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
In file included from /usr/include/c++/9/tuple:39,
from /usr/include/c++/9/functional:54,
from ./bench/bench.h:8,
from bench/block_assemble.cpp:5:
/usr/include/c++/9/array: In instantiation of ‘struct std::__array_traits<std::shared_ptr, 18446744073709551257>’:
/usr/include/c++/9/array:110:56: required from ‘struct std::array<std::shared_ptr, 18446744073709551257>’
bench/block_assemble.cpp:30:69: required from here
/usr/include/c++/9/array:50:19: error: size ‘18446744073709551257’ of array exceeds maximum object size ‘9223372036854775807’
50 | typedef _Tp _Type[_Nm];
| ^~~~~

Update Team Section of ReadMe

Next time you have a commit you should update the readme file to clean up the team section. This is obviously not a priority but it's a little out of date. Should be able to do it with the next actual commit.

Connection refused.

I just thought I would share this as it might be a bug in the coding. Please run a fresh wallet sync to see if you can reenact the issue.

I have found a full sync with a fresh wallet hangs time to time on a block. You have to restart the daemon to get it working through the blocks again.

connect() to #.#.#.#:33820 failed after select(): Connection refused (111)
socket recv error Connection reset by peer (104)

Also this fatal error came up after leaving it stuck for hours...

************************
EXCEPTION: St13runtime_error
tinyformat: Not enough conversion specifiers in format string
Metrix in ProcessMessages()

Again, restarting the daemon got it working.

Both errors have occurred on two separate wallet setups. :octocat:


Linux x64 CLI wallet v3.4.0.0

metrixd is crashing when I try to start staking

I've currently installed the latest version of metrix core, 4.0.6, on Linux and started staking as follows:

On one shell: metrixd
On another shell: metrix-cli walletpassphrase "$1" 99999999 true

Where $1 is the password.

Console output:
2021-04-13T04:23:33Z No coin database inconsistencies in last 6 blocks (18 transactions)
2021-04-13T04:23:33Z block index 13887ms
2021-04-13T04:23:33Z init message: Loading wallet...
2021-04-13T04:23:33Z BerkeleyEnvironment::Open: LogDir=/home/martin/.metrixcoin/wallets/database ErrorFile=/home/martin/.metrixcoin/wallets/db.log
2021-04-13T04:23:33Z [default wallet] Wallet File Version = 169900
2021-04-13T04:23:33Z [default wallet] Keys: 0 plaintext, 4008 encrypted, 4008 w/ metadata, 4008 total. Unknown wallet records: 0
2021-04-13T04:23:33Z [default wallet] Wallet completed loading in 496ms
2021-04-13T04:23:33Z [default wallet] setKeyPool.size() = 2000
2021-04-13T04:23:33Z [default wallet] mapWallet.size() = 417
2021-04-13T04:23:33Z [default wallet] mapAddressBook.size() = 2
2021-04-13T04:23:33Z block tree size = 199796
2021-04-13T04:23:33Z nBestHeight = 196690
2021-04-13T04:23:33Z torcontrol thread start
2021-04-13T04:23:33Z Imported mempool transactions from disk: 0 succeeded, 0 failed, 0 expired, 0 already there
2021-04-13T04:23:33Z Bound to [::]:33830
2021-04-13T04:23:33Z Bound to 0.0.0.0:33830
2021-04-13T04:23:33Z init message: Loading P2P addresses...
2021-04-13T04:23:34Z Loaded 12687 addresses from peers.dat 332ms
2021-04-13T04:23:34Z init message: Starting network threads...
2021-04-13T04:23:34Z net thread start
2021-04-13T04:23:34Z addcon thread start
2021-04-13T04:23:34Z dnsseed thread start
2021-04-13T04:23:34Z init message: Done loading
2021-04-13T04:23:34Z opencon thread start
2021-04-13T04:23:34Z msghand thread start
2021-04-13T04:23:45Z Loading addresses from DNS seed mainnet.metrixcoin.com
2021-04-13T04:23:45Z 0 addresses found from DNS seeds
2021-04-13T04:23:45Z dnsseed thread exit
2021-04-13T04:23:46Z Leaving InitialBlockDownload (latching to false)
Speicherzugriffsfehler (Speicherabzug geschrieben)

After starting it a second time it works.

Typical bugs when running deamon as masternode on ubuntu or debian server

Exemplary tested on 18.04. ubuntu VPS
"version" : "v3.1.0.0-g",
"protocolversion" : 70000,

Lindad getinfo shows these THREE typical errors:

  1. Lindad getinfo shows errors: "EXCEPTION... "
    short after it shows beahaviour below or crashes completly and need to start again.

  2. Lindad hangs / crashes but is still visible htop with SHRvalue of ZERO [0] and TIME+ up to 12h
    lindad-timedelay
    Can only be solved by killing the deamon before restarting it.

  3. Lindad block sync hangs and only stopping of deamon, bootsrapping and restart helps to get it in sync again

During all the three errors CPU consumption is often around 100% all the time!

If different rootscauses are investigated by the DEV's plz split this issues into 3 single ones...

MacOSX version v3.1.0.1 runs slow even after bootstrapping

Is there any reason why the MacOSX qt wallet syncs slowly and hangs multiples times, compared to the Win64 qt wallet? It can never keep up with the latest block, unless the bootstrap file happens to be super fresh off the cooker.

I have witnessed this on previous versions of the wallet as well, so it's not a recent issue.

OpenSSL version: 1.0.2g 1 Mar 2016

Does that come packaged with the qt wallet? As my OpenSSL version is higher than that!

:octocat:

wallet version 3.1.0.1 sync error

In version 3.1.0.1 wallet # 476204th block is not synchronized.

So I have to sync with a lower version wallet and have to reload the version again.

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.