Coder Social home page Coder Social logo

x9developers / xsn Goto Github PK

View Code? Open in Web Editor NEW
93.0 32.0 49.0 136.11 MB

XSN - Stakenet, the first cryptocurrency with Trustless Proof of Stake

Home Page: https://stakenet.io

License: MIT License

Makefile 1.13% Shell 0.75% M4 1.91% Python 12.49% QMake 0.01% C++ 67.65% C 14.12% HTML 0.21% CSS 0.79% Objective-C++ 0.07% Java 0.29% Assembly 0.28% Dockerfile 0.01% Sage 0.29%
xsn stakenet cryptocurrency blockchain masternode dao decentralized proof-of-stake trustless

xsn's Introduction

XSN Core integration/staging tree

Build Status

NOTE: Stakenet works extensively on off-chain Layer 2 (L2), as such development is across mutliple public and private repositories other than the main blockchain repository XSN.

Below are a collection of links for our current public development work.

Stakenet Cloud

https://stakenet.io

What is XSN?

XSN is an experimental digital currency that enables instant payments to anyone, anywhere in the world. XSN uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. XSN Core is the name of open source software which enables the use of this currency.

For more information, as well as an immediately useable, binary version of the XSN Core software, see https://stakenet.io/, or read the original whitepaper.

License

XSN Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.

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 XSN Core.

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

The Travis CI system makes sure that every pull request is built for Windows, Linux, and OS X, and that unit/sanity tests are run automatically.

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.

Running with Docker

If you are already familiar with Docker, then running XSN with Docker might be the the easier method for you. To run XSN using this method, first install Docker. After this you may continue with the following instructions.

Please note that we currently don't support the GUI when running with Docker. Therefore, you can only use RPC (via HTTP or the xsn-cli utility) to interact with XSN via this method.

Right now we don't store the image in docker hub, so you need to build it on your own:

docker build . -t xsn

Start XSN daemon: ( you might consider to bind custom ports in case you want to run a node or make usage of the json-rpc api https://docs.docker.com/engine/reference/run/)

docker run -d -P --name xsn xsn:latest

View current block count (this might take a while since the daemon needs to find other nodes and download blocks first):

docker exec xsn xsn-cli getblockcount

View connected nodes:

docker exec xsn xsn-cli getpeerinfo

Stop daemon:

docker stop xsn

Backup wallet:

docker cp xsn:/home/xsn/.xsncore/wallet.dat .

Start daemon again:

docker start xsn

Translations

Please reach out to us in Discord if you wish to offer translations and see the below translation process for further details translation process.

Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.

xsn's People

Contributors

achow101 avatar adinael avatar alexitc avatar andriidiachuk avatar cozz avatar durkmurder avatar fanquake avatar gavinandresen avatar gmaxwell avatar iblackshadow avatar instagibbs avatar jnewbery avatar jonasschnelli avatar jtimon avatar laanwj avatar luke-jr avatar morcos avatar non-github-bitcoin avatar paveljanik avatar petertodd avatar practicalswift avatar pstratem avatar rostyslavantonyshyn avatar ryanofsky avatar sdaftuar avatar sipa avatar thebluematt avatar theuni avatar ulyanaandrukhiv avatar yuraolex 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

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

xsn's Issues

QT Wallet close unexpectly

XSN QT Wallet - Ubuntu 16.04 x64 - XSN QT Version 1.0.0

When you go into Transaction Tab and Right Click inside the transactions table, the app quits unexpectedly.

From the debug.log I'm able to see the following error message that causes this:

 2018-03-10 03:34:15 GUI: ASSERT failure in QList<T>::at: "index out of range", file /home/ubuntu/build/POSWDev/depends/x86_64-unknown-linux-gnu/share/../include/QtCore/qlist.h, line 510

Add button for flushing mncache

Specially for windows user, we often need to delete mncache for wallet to display correct info.

This will require to restart the wallet and start staking from scratch.

It would be good if theres a buttton that we could flush the cache file so that we dont restart the wallet

Wrong results on getaddressutxos command

The getaddressutxos is supposed to return all the utxos for the given address, while playing a bit with the command, it seems to not be accurate.

As a example, look into this:

➜  xsncore-1.0.9 bin/xsn-cli getaddressutxos '{ "addresses": ["XcqpUChZhNkVDgQqFF9U4DdewDGUMWwG53"] }'
[
]

The command says that the given address doesn't have any utxos (see the same in the explorer).

On the other hand, a database tracking the utxos says that it have two non-zero utxos:

xsn_blockchain_2=# select index, value, hex_script, txid from transaction_outputs where spent_on is null and value > 0 and address = 'XcqpUChZhNkVDgQqFF9U4DdewDGUMWwG53';
 index |       value       |                               hex_script                               |                               txid                               
-------+-------------------+------------------------------------------------------------------------+------------------------------------------------------------------
     0 | 0.000035580000000 | 2103f46aecb86ca6f0404f9339e6ff242d82cd36e23612bad62f840986a570ddfd13ac | eabfd68fce47655e076ae589e0b69d80d2be15d31b2941006978c7f57006cd4e
     0 | 0.000044740000000 | 2103f46aecb86ca6f0404f9339e6ff242d82cd36e23612bad62f840986a570ddfd13ac | 0bedf3abb4b388b8205e4f861ae8f82d87285812fa383046989fcde6a736114d
(2 rows)

If I take the txid and the output index to query the RPC API with the gettxout command, it confirms that those two outputs are unspent outputs:

➜  xsncore-1.0.9 bin/xsn-cli gettxout 0bedf3abb4b388b8205e4f861ae8f82d87285812fa383046989fcde6a736114d 0
{
  "bestblock": "ac5dced3d62db5910d32b377c0fe3d8424596a698e11de8baed851f01e818f36",
  "confirmations": 166353,
  "value": 0.00004474,
  "scriptPubKey": {
    "asm": "03f46aecb86ca6f0404f9339e6ff242d82cd36e23612bad62f840986a570ddfd13 OP_CHECKSIG",
    "hex": "2103f46aecb86ca6f0404f9339e6ff242d82cd36e23612bad62f840986a570ddfd13ac",
    "reqSigs": 1,
    "type": "pubkey",
    "addresses": [
      "XcqpUChZhNkVDgQqFF9U4DdewDGUMWwG53"
    ]
  },
  "coinbase": true
}
➜  xsncore-1.0.9 bin/xsn-cli gettxout eabfd68fce47655e076ae589e0b69d80d2be15d31b2941006978c7f57006cd4e 0
{
  "bestblock": "ac5dced3d62db5910d32b377c0fe3d8424596a698e11de8baed851f01e818f36",
  "confirmations": 166359,
  "value": 0.00003558,
  "scriptPubKey": {
    "asm": "03f46aecb86ca6f0404f9339e6ff242d82cd36e23612bad62f840986a570ddfd13 OP_CHECKSIG",
    "hex": "2103f46aecb86ca6f0404f9339e6ff242d82cd36e23612bad62f840986a570ddfd13ac",
    "reqSigs": 1,
    "type": "pubkey",
    "addresses": [
      "XcqpUChZhNkVDgQqFF9U4DdewDGUMWwG53"
    ]
  },
  "coinbase": true
}

This is making difficult to verify that the database utxos are correct.

Masternode tab names needs more space

XSN QT Version 1.0.0 - Ubuntu 16.04 x64

When you go to the Masternode tab, Notice in the screenshot below that My Masternode and All Masternode its not entirely readable. those tabs needs to be a little bit expanded that text will display correctly:

image

rpc-commands for blockrewards return different results

Issue:

in special cases (don't know exactly when) the results of 2 rpc-commands differ ... but should return the same result (block)

  1. xsn-cli masternode winners 5000 | grep -E "receiving address masternode" shows a list of blocks ur node was rewarded for
  2. xsn-cli masternodelist lastpaidblock "collateral tx + id used for masternode activation) returns not the last block the node was rewareded for ... but the one before

Expected behavior:

Both commands should return same blocknumber (what i have seen is, that the winnerlist is working correctly (last listentry is last block that was payed)... so i guess there is a bug in "lastpaidblock"-rpc-command in this case

TPoS Contract status

have RPC command to check every status of TPoS contract to help merchants debug (including if node is registered on network/enabled ect)

Corrupted block

The block 95368 doesn't have a nextblockhash field even that we have more than 100k blocks.

Compilation error on Mac High Sierra

CXXLD bench/bench_xsn
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
CXX qt/libbitcoinqt_a-sendcoinsdialog.o
In file included from qt/sendcoinsdialog.cpp:6:
In file included from ./qt/sendcoinsdialog.h:8:
In file included from ./qt/walletmodel.h:12:
In file included from ./wallet/wallet.h:23:
./tpos/tposutils.h:13:1: warning: class 'CMutableTransaction' was previously declared as a struct [-Wmismatched-tags]
class CMutableTransaction;
^
./primitives/transaction.h:319:8: note: previous use is here
struct CMutableTransaction
^
./tpos/tposutils.h:13:1: note: did you mean struct here?
class CMutableTransaction;
^~~~~
struct
In file included from qt/sendcoinsdialog.cpp:6:
In file included from ./qt/sendcoinsdialog.h:8:
In file included from ./qt/walletmodel.h:12:
./wallet/wallet.h:80:1: warning: class 'TPoSContract' was previously declared as a struct [-Wmismatched-tags]
class TPoSContract;
^
./tpos/tposutils.h:17:8: note: previous use is here
struct TPoSContract
^
./wallet/wallet.h:80:1: note: did you mean struct here?
class TPoSContract;

Controller wallet doesn't detect node protocol version, leading to invalid protocol error

If you're using a wallet to control your masternodes (such as Windows wallet to control VPS nodes) , the wallet does not detect the node protocol properly.

What it means is .. if you have for example a 1.0.10 wallet and a 1.0.9 node , the wallet detects the node protocol as 70209 instead of 70208 . When you start a masternode with a wallet with a different protocol, it tries to activate the wallet's protocol instead of the node's, this getting the

"status": ""Not capable masternode: Invalid protocol version""

error.

You need to have a controller wallet with the same protocol as the node. So if you want to activate a 70208 node, you need a 70208 wallet.(edited)

Expected behavior: when using a different protocol wallet, it should detect and activate the correct protocol on the nodes. This would decrease a lot the confusion during network upgrades. Also, it would allow the user to properly evaluate its wallets.

Actual behavior:
When starting a 1.0.9 node with a 1.0.10 wallet the protocol column in the "my masternodes" tab lists the node as running 70209 instead of the correct 70208 protocol version. This in turn locks the node and pops up the ""status": ""Not capable masternode: Invalid protocol version"" error when querying masternode status on the vps.

When starting the same node with the 1.0.9 wallet, everything resumes and starts working properly.

Wallet misordering masternodes by active field

While pressing the active column twice, I expect the values to be sorted by the active field in descending order, this is partially true because it seems to be sorting the rows by the string value instead of the actual time, look to the image, 3d is before 38d:
wallet

XSN Core-Wallet dumps core on Linux

xsn-qt dumps core frequently but irregularly on my Debian 16.4.1 box.

There is not obvious issue visible in the debug.log. The last entry is always XsnMiner -- Failed to find a coinstake, but those entries are frequent without crash. It could be related to either the screen lock engaging or happen directly after logging in.

uname -a: Linux zbox 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I don't know where to look for the core dump, please tell me which files I should attach.

Abandoning Transaction Caused Permanently Locked Wallet

Setup:

  1. Swapped my POSW coins via Livecoin and installed the new XSN wallet on my linux server.
  2. Encrypted the wallet and unlocked it.
  3. Created new receiving address. Sent coins from Livecoin to address.

Steps:
4) Started staking these 17344.67972845 coins.
5) Sent 2060.5908951 more coins to staking wallet. Initially these appeared fine (see image link A at bottom).
5a) Wallet starts showing stakes with a "?" next to them in transactions screen (see image link B at
bottom).
6) A dev on the discord channel, 8489faustn, tells me to abandon the transaction (see image link B at bottom).
6a) Wallet immediately crashes.
6b) Restart wallet. Total correctly shows 19,405.25962355. But now wallet is locked.
7) Attempt to unlock wallet but it claims my password is wrong. I have used this password on this wallet several times before so I know it is correct.

Result: Wallet is locked and all of my XSN coins are inaccessible. Will not accept my password.

Wallet Version: 1.0.1 (I believe. The date below is correct so it was the latest wallet for that date).

Date: 3/25/18

Notes:

  1. Using an older, decrypted backup of the wallet results in the coins not showing up. I believe this is because I created the wallet address after I encrypted the wallet.
  2. Reinstalling the wallet did nothing.
  3. I contacted the dev team for weeks to get this resolved. John Draper told me to open an issue to have the bug resolved (see image link C at bottom).

Images:
A
a-redacted
B
b-redacted
C
c-redactedfixed

Stake Split Threshold error

Hi, i don't know if this is a small bug or a problem on my end.
I had a lil over 2k coins, i used the setsplitthreshold function and set it to 4000 ; i've minted on my own and via TPOS and my input was not split.
Then i bought more coins and went over 4000, so i used the setsplitthreshold function again and set it to 8000. If i use the getsetsplitthreshold function i receive 8000 as a results.
On the first mint i got (via TPOS) the inputs were split in 2 (both a lil over 2k); i minted again on both and were not split.
Is it possible that it kept the 4000 setting even if it shows 8000?

fix Coins already spent bug

tposerror
CTxOut(nValue=2000.00000000, scriptPubKey=76a914e69573abe1f3bb3263c1b276)
2018-03-30 07:20:02 keypool keep 76
2018-03-30 07:20:02 AddToWallet edf4b70422df1150e47a49164a4373984613cad8d6d7880c692b916af6d9b574 update
2018-03-30 07:20:02 CommitTransaction(): Error: Transaction not valid
2018-03-30 07:20:02 keypool return 75

^^ from debug log - Last two lines are when the error occured

12 word backup seed

Please confirm 12 word backup passphrase is working properly and activated

Non-consistent transaction format from the RPC API

As a example, the transaction f24cd135c34ebb9032f8bc5b45599f1424980d34583df2847c4a4db584c94e97 doesn't have the blocktime or time fields, this has broken the explorer several times.

Example call:

xsncore-1.0.9 bin/xsn-cli getrawtransaction f24cd135c34ebb9032f8bc5b45599f1424980d34583df2847c4a4db584c94e97 1 
{
  "hex": "0100000001f402c6a51689c50c65ffb6231283dcaedec8e882ceee34281269592f97937917010000006a4730440220187bd17e8e4e5fd984eeb7413e08e4158bed0489daf4d172cfa5882e0ab5e9240220175beade81605352083a5dc9ca38c00268497d3c4017ce883701c0049ac557e8012102eca9a91d1e0a6cfa8f4fff2fc0ae97d251458695837df3d6779b9d9d20f556d7ffffffff03000000000000000000b781be9b1a0000001976a914200ed407409342e079826fdde05471cbb10b9a7488ac400cb378000000001976a914144842839c0d7ebe1492fe9910762b57aab86cf988ac00000000",
  "txid": "f24cd135c34ebb9032f8bc5b45599f1424980d34583df2847c4a4db584c94e97",
  "size": 234,
  "version": 1,
  "locktime": 0,
  "vin": [
    {
      "txid": "177993972f5969122834eece82e8c8deaedc831223b6ff650cc58916a5c602f4",
      "vout": 1,
      "scriptSig": {
        "asm": "30440220187bd17e8e4e5fd984eeb7413e08e4158bed0489daf4d172cfa5882e0ab5e9240220175beade81605352083a5dc9ca38c00268497d3c4017ce883701c0049ac557e8[ALL] 02eca9a91d1e0a6cfa8f4fff2fc0ae97d251458695837df3d6779b9d9d20f556d7",
        "hex": "4730440220187bd17e8e4e5fd984eeb7413e08e4158bed0489daf4d172cfa5882e0ab5e9240220175beade81605352083a5dc9ca38c00268497d3c4017ce883701c0049ac557e8012102eca9a91d1e0a6cfa8f4fff2fc0ae97d251458695837df3d6779b9d9d20f556d7"
      },
      "value": 1122.57103223,
      "valueSat": 112257103223,
      "address": "XdcMDgA1sWNfBPq9U5P5ngcP5L3sePMCpL",
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00000000,
      "valueSat": 0,
      "n": 0,
      "scriptPubKey": {
        "asm": "",
        "hex": "",
        "type": "nonstandard"
      }
    }, 
    {
      "value": 1142.82103223,
      "valueSat": 114282103223,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 200ed407409342e079826fdde05471cbb10b9a74 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914200ed407409342e079826fdde05471cbb10b9a7488ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "XdcMDgA1sWNfBPq9U5P5ngcP5L3sePMCpL"
        ]
      }
    }, 
    {
      "value": 20.25000000,
      "valueSat": 2025000000,
      "n": 2,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 144842839c0d7ebe1492fe9910762b57aab86cf9 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914144842839c0d7ebe1492fe9910762b57aab86cf988ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "XcY5unoGBDZdRJJrHXPePGJgK3W7Th9LzG"
        ]
      }
    }
  ],
  "blockhash": "ee5ee42a4f9c106808b8867f9469a47cb7d5fc5f71ec58e56f0bff895ac2b78d",
  "height": -1,
  "confirmations": 0
}

I have patched the explorer to set a 0 when these fields are not preset, can we get consistent responses from the RPC API?

getblockchaininfo says that 1.0.13 is a pre-release

Calling the getblockchaininfo command from the xsn-cli displays this warning This is a pre-release test build - use at your own risk - do not use for mining or merchant applications, isn't this version an actual release?

Can`t switch lock-status in listview of coincontrol to release locked coins

Walletversion: 1.0.13
Binary: xsn-qt (XSN Core Version v1.0.13.0-96f714ff1 (64-Bit))
OS: Ubuntu 18.04 / XFCE / German

Issue:
When trying to switch status of locked collateral coins under Send Coins -> Inputs -> Listview nothing happens.

Expected bahavior:
Locked coins become unlocked, and unlocked coins become locked. This ensures to be able to move collaterals of masternodes or tpos-coins.

Reproducable: Yes

Unlock wallet for staking only feature

There are many valid concerns about leaving a unlocked wallet running for staking that allows anyone to transfer your coins without asking for your encrypted password.

We should always ask for password when making a transaction.

Genesis block contains a transaction that can't be retrieved

Is there any particular reason why this is not found? The current block explorer is not displaying the genesis block due to this.

1. Find the genesis block

bin/xsn-cli getblockhash 0
00000c822abdbb23e28f79a49d29b41429737c6c7e15df40d1b1f1b35907ae34

2. Get the block details

bin/xsn-cli getblock 00000c822abdbb23e28f79a49d29b41429737c6c7e15df40d1b1f1b35907ae34
{
  ...
  "tx": [
    "922ab2360f766457416dfc59c6594248c5b79e33c8785bce491c0e01930738f6"
  ],
  ...
}

3. Get the transaction details

bin/xsn-cli getrawtransaction 922ab2360f766457416dfc59c6594248c5b79e33c8785bce491c0e01930738f6 1
error code: -5
error message:
No information available about transaction

test/coins_tests.cpp: no matching function

when building from "git clone https://github.com/X9Developers/XSN.git" i get following compile error:

test/coins_tests.cpp:377:86: error: no matching function for call to ‘Coin::Coin(__gnu_cxx::__alloc_traits<std::allocator >::value_type&, unsigned int&, bool)’

test/coins_tests.cpp:724:73: error: no matching function for call to ‘Coin::Coin(std::remove_reference<CTxOut&>::type, int, bool&)’

XSN QT Wallet is banning all the peers

Ubuntu 16.04 LTS x64 - XSN QT Version 1.0.0

I'm not able to syncronize with the network, I realized all peers are banned.

As soon as I unban everyone, it gets in sync.

However this happens again and again.

image

Cleanup of information about old clients for TPoS merchants

After clients ends his TPoS with merchant, merchant still watches his address, so he gets transaction for tpos address in his transaction log. This can be fixed by introducing rpc call in format:
tposcontract cleanup contract_id that will remove address from set of watch only set.

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.