Giter Site home page Giter Site logo

minterteam / minter-go-node Goto Github PK

View Code? Open in Web Editor NEW
354.0 45.0 68.0 10.65 MB

🚀 Official Minter Blockchain Implementation in Go

Home Page: https://minter.network

License: MIT License

Go 78.27% Makefile 0.22% Shell 0.11% Assembly 0.88% Dockerfile 0.03% C 18.17% M4 0.70% Java 0.82% Sage 0.81%
blockchain golang cryptocurrency minter

minter-go-node's Introduction

Version Go version License Last commit Go Report Card Github Actions Report Card Docker Pulls

Minter is a global rewards and loyalty points network powered by a fast blockchain. Any brand, community, or blogger can create their own coins and launch their reward or loyalty system in minutes.

NOTE: This is alpha software. Please contact us if you intend to run it in production.

Installation

Docker

  1. Grab latest docker-compose, save docker-compose.yml and run docker-compose up -d. To run it in production we recommend to use bind host mount instead of volume.

  2. To build from source clone this repo, make your changes and run docker-compose up --build -d

Manual

You can get official installation instructions in our docs.

  1. Download Minter Node

    Get latest binary build suitable for your architecture and unpack it to desired folder.

  2. Run Minter Node

./minter node

Resources

Related repositories

Community

Versioning

SemVer

Minter uses SemVer to determine when and how the version changes. According to SemVer, anything in the public API can change at any time before version 1.0.0

To provide some stability to Minter users in these 0.X.X days, the MINOR version is used to signal breaking changes across a subset of the total public API. This subset includes all interfaces exposed to other processes, but does not include the in-process Go APIs.

Upgrades

In an effort to avoid accumulating technical debt prior to 1.0.0, we do not guarantee that breaking changes (ie. bumps in the MINOR version) will work with existing blockchain. In these cases you will have to start a new blockchain, or write something custom to get the old data into the new chain.

However, any bump in the PATCH version should be compatible with existing histories (if not please open an issue).

minter-go-node's People

Contributors

azimuth0x28 avatar daniildulin avatar danil-lashin avatar danmer avatar dmitry-ee avatar edwardstock avatar grkamil avatar moon004 avatar progmer avatar shrpne avatar sidorov-panda avatar tazhate avatar tokvv avatar trim777 avatar wirwolf avatar zramsay 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minter-go-node's Issues

Create "events" db

Create database with blockchain events, so we can extend API to be able to retrieve information about:

  • Slashes for unavailability or double-signing
  • Rewards

Не сходятся суммы делегированные при просчете по формуле и запросом по API

To Reproduce
Steps to reproduce the behavior:

Через запрос по API

получаю список делегаторов.
Выбираю произвольного с SHSCION
http://take.ms/QaXye

value: "292666000000000000000000",
bip_value: "53180217160045527885907"

Результат Запроса: 53180217160045527885907

Проверяю Формулу:

Делаю запрос по API
Получаю

symbol: "SHSCOIN",
volume: "1788176875639295577530972",
crr: 50,
reserve_balance: "319757654110053536997683",

Делаю расчет по формуле из Документации CalculateSaleReturn

Array
(
[$sPipAmountFrom] => 292666000000000000000000
[$arCoinHitCache] => Array
(
[SHSCOIN] => Array
(
[name] => Stakeholder Coin
[symbol] => SHSCOIN
[volume] => 1788176875639295577530972
[crr] => 50
[reserve_balance] => 319757654110053536997683
[creator] => Mx6eadf5badeda8f76fc35e0c4d7f7fbc00fe34315
)

    )

[$sSupplyPip] => 1788176875639295577530972
[$fCrr] => 0.5
[$sReserveBaseCoinPip] => 319757654110053536997683
[$sSellAmountPip] => 1788176875639295577530972
[$sSaleReturnBaseCoinPip] => 319757654110053536997683
[$sDelegatedRatio] => 0.163667254613930877
[$sResult] => 52333857389983373208646

)

Результат Формулы 52333857389983373208646

52333857389983373208646 !== 53180217160045527885907

Что я упустил ?

  • Minter Version [0.2.3]

create API endpoint for pending transactions like txPool in eth

In some business cases it will be useful to know all transactions that are not yet included in the block and have a pending status.

That can solve some issues like:

client send valid transaction to the node that accepted transaction and went immediately down.

I suggest to implement API endpoint /api/transactions/pending that return list of pending transactions.

Proposal: introduce upper and lower bounds for Sell/Buy coin transactions

Problem

User cannot predict how much coins he will get after SellCoin tx. And similarly he cannot predict how much coins he will spend after BuyCoins tx.

Solution

Extend SellCoin and BuyCoins tx with MinReturn field in which user/app will specify min/max amount of coins they want to get/spend.

Change /block API endpoint

We should change sections with validators' signatures to make it simple to determine who signed the block and who did not.

external access to gui

I've installed minter on Google Cloud Platform VM.
How could I access minter GUI interface from the outside, not http://localhost:3000 ?

I have set up nginx and configure proxy for 3000 port:
location /{
proxy_pass http://localhost:3000;
}
but it returns 404 error only.
And if I use curl localhost:3000 from server console it returns valid html

First time user experience issues

1. user: Current not implemented on linux/amd64

When I've tried to run a freshly downloaded binary (same when building from source), I got:

root@f26985dca600:/go# ./minter
panic: user: Current not implemented on linux/amd64

goroutine 1 [running]:
github.com/MinterTeam/minter-go-node/cmd/utils.GetMinterHome(0xc, 0x0)
        /Users/daniillashin/go/src/github.com/MinterTeam/minter-go-node/cmd/utils/flags.go:32 +0x10b
github.com/MinterTeam/minter-go-node/config.init.0()
        /Users/daniillashin/go/src/github.com/MinterTeam/minter-go-node/config/config.go:30 +0x26

Env:

uname -a
Linux f26985dca600 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 GNU/Linux
minter 0.6.0
# go version
go version go1.10.4 linux/amd64
docker run --rm -it golang:1.10 /bin/bash
Client: Docker Engine - Community
 Version:           18.09.0-ce-beta1
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        78a6bdb
 Built:             Thu Sep  6 22:41:53 2018
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0-ce-beta1
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       78a6bdb
  Built:            Thu Sep  6 22:49:35 2018
  OS/Arch:          linux/amd64
  Experimental:     true

2. docs: use -p when creating multiple directories

When installing from source, it should be

mkdir -p $GOPATH/src/github.com/MinterTeam

without -p flag, it will throw an error

mkdir: cannot create directory '/go/src/github.com/MinterTeam': No such file or directory

3. docs: tendermint update

Tendermint is known to open more than 1024 files. https://minter-go-node.readthedocs.io/en/dev/install.html#too-many-open-files-24

That is not true anymore (at least for the past 3 versions). Please file an issue otherwise!

Add validator status to GUI

Add node status to GUI:

  • Is node declared as candidate
  • Node's status (On/Off)
  • Is node included in validator's list
  • Node's total stake

New transaction type: Multisend

Add new transaction type which allows send coins to multiple addresses in one tx.

const TypeMultisend = 0x0D

type MultisendData struct {
  List []MultisendDataItem
}

type MultisendDataItem struct {
  Coin  types.CoinSymbol
  To    types.Address
  Value *big.Int
}

NONCE API improvement

For clients that going to work with Minter, will be cool to simplify api requests for wallet logic implementation.

Use-case:

  1. Client want to make transaction

  2. Client should make /api/balance/{address} - to get actual balance

  3. Client should make /api/transactionCount/{address} - to get actual nonce

I suggest to combine 2 and 3 in one api call.

It can be a new endpoint like /api/account/{address} that return all the data from /api/balance plus actual nonce

or

just add nonce field to the balance response.

How to update the version of the application?

Hi. I use google cloud VM on Ubuntu.
After the release of the new version of the application, in some time the old version launched on the server freezes (the Latest Block Height stops increasing).
A simple update of the executable file and its restarting does not help, errors start to pour in the console or the application does not start at all.
You have to completely delete the directory ./minter, synchronize again and apply for registration new masternode. At the same time, I understand that all the history of previous validations is lost and Voting Power is reset. On a test network, this is probably not critical, but how to be after launching a production one?

Allow masternode's owners to change address

We need to implement transaction which will allow masternode's owners to change addresses (rewards address and owner address) of masternode. This should be useful in case of wallet's private key comprometation.

Расчет коэф-та конвертации

Вычисляем через Данные Кандидата

Исходные данные http://take.ms/dfDYR
PoolTotalStake | 2,01736E+23
Owner Bonded | 2E+23
Holder MNT | 1E+21

Holder Total = PoolTotalStake - Owner Bonded | 1,7361E+21

Holder BELT (MNT-pip )= Holder Total - Holder MNT | 7,36104E+20

Конвертируем MNT-pip =>BELT -pip

BELT-pip | 5,82027E+18

BELT/MNT Rate = BELT-pip / Holder BELT (MNT-pip ) | 126,4724646

Теперь сверяем с данными конвертера

BELT-pip | 1E+18
MNT-pip | 9,94301E+19

BELT/MNT Rate = MNT-pip / BELT-pip | 99,43013495

ИТОГО 126,4724646 != 99,43013495

Возможно я где-то не прав. То поправьте.

Limit coins volume

We should limit coins volume because now it can be used to send information just through the amount of Send transaction.

Node launch from docker-compose missing file

Actually - fail to run node from docker-compose.

Just followed this instruction

Error looks like this

Pulling minter (minterteam/minter:0.7.0)...
ERROR: manifest for minterteam/minter:0.7.0 not found

Docker compose file looks like this

version: "3.4"
services:
  minter:
    image: minterteam/minter:0.7.0
    volumes:
      - ~/.minter:/minter
    ports:
      - "8841:8841"
      - "3000:3000"
    restart: always
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8841/api/status"]
      interval: 5s
      timeout: 5s
      retries: 3

Handle computation of stakes in parallel

Currently stake values re-computed each 12 blocks. In worst case node should calculate 256x3x1 000=768 000 values. This can and should be done in parallel.

func (s *StateDB) RecalculateTotalStakeValues() {
stateCandidates := s.getStateCandidates()
validators := s.getStateValidators()
for i := range stateCandidates.data {
candidate := &stateCandidates.data[i]
totalBipStake := big.NewInt(0)
for j := range candidate.Stakes {
stake := &candidate.Stakes[j]
stake.BipValue = stake.CalcBipValue(s)
totalBipStake.Add(totalBipStake, stake.BipValue)
}
candidate.TotalBipStake = totalBipStake
for j := range validators.data {
if bytes.Equal(validators.data[j].PubKey, candidate.PubKey) {
validators.data[j].TotalBipStake = totalBipStake
break
}
}
}
s.setStateValidators(validators)
s.MarkStateValidatorsDirty()
s.setStateCandidates(stateCandidates)
s.MarkStateCandidateDirty()
}

Multisignature wallets

Motivation

We need multisignatures to:

  • Atomic swaps with sidechains' coins
  • Basic usage to manage funds within Minter Blockchain

Implementation

In Minter we will implement Tendermint's multisignature scheme presented in ADR 012.

crash node in linux

To Reproduce
Steps to reproduce the behavior:

  1. download bin file from github
  2. unzip
  3. launch one process
  4. launch another process
wir_wolf@Developer-PC ~ $ ./minter_0.1.8_linux_amd64 
panic: resource temporarily unavailable

goroutine 1 [running]:
github.com/MinterTeam/minter-go-node/core/minter.NewMinterBlockchain(0xc4207c24e0)
        /Users/daniillashin/go/src/github.com/MinterTeam/minter-go-node/core/minter/minter.go:58 +0x242
main.main()
        /Users/daniillashin/go/src/github.com/MinterTeam/minter-go-node/cmd/minter/main.go:33 +0xb3


Screenshots
screenshot_20180815_211853

Desktop (please complete the following information):

  • OS: KUbuntu 16.04.03
  • Minter Version v0.1.8

Add special cases to Formulas

CalculatePurchaseAmount and CalculateSaleAmount should be extended to handle special cases when:

  • CRR == 100
  • Amount == 0

Permanent error "pong timeout"

Use latest release 0.7.1 on Windows Server 2016 Datacenter x64. Is Synced = Yes. Constant error appears (something like that):
Connection failed @ sendRoutine module=p2p [email protected]:26656 conn=MConn{136.243.33.21:26656} err="pong timeout"
I tried everything. Turned off the firewall, deleted the entire blockchain cache and downloaded again. Nothing helps. Stiil have validator status Down. And transaction SET CANDIDATE ON successfully completed.

image

Не верные параметры в docker-compose.yml

Не совпадают директории монтирования в конфиге и в мануалах. (лишний знак ":")

volumes:
- ~/.minter:/minter
volumes:
- ~/.tendermint:/tendermint

mkdir -p ~/.tendermint/data
mkdir -p ~/.minter/data

Расчет CUSTOM coin в MNT прошу пояснить

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Адрес Mx8d3c1212512bbb7e754e49e8d5880fc753a92762

смотрим Делегата в API
http://95.216.148.138:8841/api/candidate/Mp8f053f3802d33f5e7092bb01ca99ae77606f4faf759c72560d5ee69b8e191a56

owner: "Mx8d3c1212512bbb7e754e49e8d5880fc753a92762",
coin: "SHSCOIN",
value: "359245000000000000000000",
bip_value: "55214201947413662915536"

Получается что если продать 359245000000000000000000 то можно получить 55214201947413662915536

Проверяем
http://95.216.148.138:8841/api/estimateCoinSell?coin_to_sell=SHSCOIN&value_to_sell=359245000000000000000000&coin_to_buy=MNT

will_get: "74821901820913662915536",

Почему расходятся цифры , баг ли это или все Ок ?
если ок, то как можно получить 55214201947413662915536, через какой эндпоинт API ?

  • Minter Version 0.2.3

Error "Dialing failed"

I'm trying to run a minter on windows server 2016 x64. Run as administrator. When I start, I get the error "Dialing failed". Tried to add inbound/outbound rules for the application in the firewall. Just turned off the firewall. Does not help. This is screenshot
1
And have no peers
2

Пожелание к API минтера

Приветствую.
Предлагаю добавить в выдачу endpoint /api/candidate/ .....
Информацию о версии Тендерминта (tm_status) и минтера

Это удобно для отслеживания состояния валидаторов, не разглашая их IP
в случае sentryNode архитектуры, валидатор скрыт от сети. Но в целях мониторинга было бы удобно и это важно, видеть какая версия ноды работает у валидатора.
Сейчас это можно узнать только через прямой запрос к Минтеру работающему в паре с Блокчейном. А соответственно раскрываем IP.
Если все ноды будут знать о версиях По у Валидаторов, то без раскрытия IP, можно будет отслеживать соcтояние ПО Валидаторов.

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.