Giter VIP home page Giter VIP logo

bitshares-core's Introduction

BitShares Core

BitShares Core is the BitShares blockchain node software and command-line wallet software. For UI reference wallet software (browser-based wallet and desktop wallet) visit BitShares UI.

Visit BitShares.github.io to learn about BitShares and join the community at BitSharesTalk.org.

Information for developers can be found in the Wiki and the BitShares Developer Portal. Users interested in how BitShares works can go to the BitShares Documentation site.

Visit Awesome BitShares to find more resources and links E.G. chat groups, client libraries and extended APIs.

Branch Build Status
master
develop
hardfork
testnet
master of bitshares-fc

Getting Started

Build instructions and additional documentation are available in the Wiki.

Prebuilt binaries can be found in the releases page for download.

Installing Node and Command-Line Wallet Software

We recommend building on Ubuntu 20.04 LTS (64-bit)

Install Operating System Dependencies:

sudo apt-get update
sudo apt-get install autoconf cmake make automake libtool git libboost-all-dev libssl-dev g++ libcurl4-openssl-dev doxygen

Build Node And Command-Line Wallet:

git clone https://github.com/bitshares/bitshares-core.git
cd bitshares-core
git checkout master # may substitute "master" with current release tag
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

Upgrade Node And Command-Line Wallet:

cd bitshares-core
git remote set-url origin https://github.com/bitshares/bitshares-core.git
git checkout master
git remote set-head origin --auto
git pull
git submodule update --init --recursive # this command may fail
git submodule sync --recursive
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

NOTE:

  • BitShares requires a 64-bit operating system to build, and will not build on a 32-bit OS. Tested operating systems:

    • Linux (heavily tested with Ubuntu LTS releases)
    • macOS (various versions)
    • Windows (various versions, Visual Studio and MinGW)
    • OpenBSD (various versions)
  • BitShares requires Boost libraries to build, supports version 1.58 to 1.74. Newer versions may work, but have not been tested. If your system came pre-installed with a version of Boost libraries that you do not wish to use, you may manually build your preferred version and use it with BitShares by specifying it on the CMake command line.

    Example: cmake -DBOOST_ROOT=/path/to/boost ..

  • BitShares requires OpenSSL libraries to build, supports version 1.0.2 to 1.1.1. If your system came pre-installed with a version of OpenSSL libraries that you do not wish to use, you may manually build your preferred version and use it with BitShares by specifying it on the CMake command line.

    Example: cmake -DOPENSSL_ROOT_DIR=/path/to/openssl ..

Running and Stopping Node Software

Run Node Software:

Stay on bitshares-core/build directory before you run the below witness_node command

./programs/witness_node/witness_node

Under build directory the node run will automatically create the directory witness_node_data_dir along with config files underneath then start synchronizing the blockchain. It may take usually several hours to fully synchronize the blockchain data. The blockchain data will be stored under the directory witness_node_data_dir.

Stop Node Software:

For stopping the node run cleanly, you will need to access the node run terminal then press on Ctrl+C then wait for the run to stop, please note that it may take usually few minutes to exit the run. It's recommended to use linux command screen to initiate the node run so you can go back to the node run screen to stop it.

IMPORTANT: By default the node will start in reduced memory mode by using some of the commands detailed in Memory reduction for nodes. In order to run a full node with all the account histories which usually unnecessary, you need to remove partial-operations and max-ops-per-account from your config file. Please note that currently(2018-10-17) a full node will need more than 160GB of RAM to operate and required memory is growing fast. Consider the following table as minimal requirements before running a node:

Default Full Minimal ElasticSearch
150G HDD, 16G RAM 640G SSD, 64G RAM * 120G HDD, 4G RAM 1TB SSD, 32G RAM

* For this setup, allocate at least 500GB of SSD as swap.

To use the command-line wallet or other wallets / clients with the node, the node need to be started with RPC connection enabled, which can be done by starting the node with the --rpc-endpoint parameter, E.G.

./programs/witness_node/witness_node --rpc-endpoint=127.0.0.1:8090

or configure it in the config file by editing witness_node_data_dir/config.ini as follows:

rpc-endpoint = 127.0.0.1:8090

You can run the program with --help parameter to see more info:

./programs/witness_node/witness_node --help

Using Command-Line Wallet

Stay on bitshares-core/build directory before you run the below cli_wallet command

./programs/cli_wallet/cli_wallet

IMPORTANT: The cli_wallet or API interfaces to the node wouldn't be fully functional unless the node is fully synchronized with the blockchain. The cli_wallet command info will show result head_block_age which will tell you how far you are from the live current block of the blockchain.

To check your current block:

new >>> info

To query the blockchain, E.G. get info about an account:

new >>> get_account <account_name_or_id>

If you need to transact with your account but not only query, firstly set your initial password and unlock the wallet:

  • For non-Windows operating systems, you can type the commands and press [ENTER], then input the password and press [ENTER], in this case the password won't show:

    new >>> set_password [ENTER]
    Enter password:
    locked >>> unlock [ENTER]
    Enter password:
    unlocked >>>
    
  • For Windows, or you'd like to show the password, type the commands with the password:

    new >>> set_password <PASSWORD>
    locked >>> unlock <PASSWORD>
    unlocked >>>
    

To be able to transact with your account, import the corresponding private keys:

unlocked >>> import_key <ACCOUNT_NAME> <WIF_KEY>

The private keys will be encrypted and stored in the wallet file, the file name is wallet.json by default. The private keys are accessible when the wallet is unlocked.

unlocked >>> dump_private_keys

Use lock command to make the private keys inaccessible. There is no auto-lock feature so far.

unlocked >>> lock

To import your initial (genesis) balances, import the private keys corresponding to the balances:

unlocked >>> import_balance <ACCOUNT_NAME> [<WIF_KEY> ...] true

Use help to see all available wallet commands.

>>> help

Use gethelp <COMMAND> to see more info about individual commands. E.G.

>>> gethelp get_order_book

The definition of all commands is available in the wallet.hpp source code file. Corresponding documentation can be found in the Doxygen documentation.

You can run the program with --help parameter to see more info:

./programs/cli_wallet/cli_wallet --help

There is also some info in the Wiki.

Support

Technical support is available in the BitSharesTalk technical support subforum.

BitShares Core bugs can be reported directly to the issue tracker.

Questions can be posted in Github Discussions.

BitShares UI bugs should be reported to the UI issue tracker.

Up to date online Doxygen documentation can be found at https://bitshares.github.io/doxygen.

Using Built-In APIs

Node API

The witness_node software provides several different API sets, known as node API.

Each API set has its own ID and a name. When running witness_node with RPC connection enabled, initially two API sets are available:

  • API set with ID 0 has name "database", it provides read-only access to the database,
  • API set with ID 1 has name "login", it is used to login and gain access to additional, restrictable API sets.

Here is an example using wscat package from npm for websockets:

$ npm install -g wscat
$ wscat -c ws://127.0.0.1:8090
> {"id":1, "method":"call", "params":[0,"get_accounts",[["1.2.0"]]]}
< {"id":1,"result":[{"id":"1.2.0","annotations":[],"membership_expiration_date":"1969-12-31T23:59:59","registrar":"1.2.0","referrer":"1.2.0","lifetime_referrer":"1.2.0","network_fee_percentage":2000,"lifetime_referrer_fee_percentage":8000,"referrer_rewards_percentage":0,"name":"committee-account","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[],"address_auths":[]},"active":{"weight_threshold":6,"account_auths":[["1.2.5",1],["1.2.6",1],["1.2.7",1],["1.2.8",1],["1.2.9",1],["1.2.10",1],["1.2.11",1],["1.2.12",1],["1.2.13",1],["1.2.14",1]],"key_auths":[],"address_auths":[]},"options":{"memo_key":"GPH1111111111111111111111111111111114T1Anm","voting_account":"1.2.0","num_witness":0,"num_committee":0,"votes":[],"extensions":[]},"statistics":"2.7.0","whitelisting_accounts":[],"blacklisting_accounts":[]}]}

We can do the same thing using an HTTP client such as curl for APIs which do not require login or other session state:

$ curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_accounts", [["1.2.0"]]], "id": 1}' http://127.0.0.1:8090/
{"id":1,"result":[{"id":"1.2.0","annotations":[],"membership_expiration_date":"1969-12-31T23:59:59","registrar":"1.2.0","referrer":"1.2.0","lifetime_referrer":"1.2.0","network_fee_percentage":2000,"lifetime_referrer_fee_percentage":8000,"referrer_rewards_percentage":0,"name":"committee-account","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[],"address_auths":[]},"active":{"weight_threshold":6,"account_auths":[["1.2.5",1],["1.2.6",1],["1.2.7",1],["1.2.8",1],["1.2.9",1],["1.2.10",1],["1.2.11",1],["1.2.12",1],["1.2.13",1],["1.2.14",1]],"key_auths":[],"address_auths":[]},"options":{"memo_key":"GPH1111111111111111111111111111111114T1Anm","voting_account":"1.2.0","num_witness":0,"num_committee":0,"votes":[],"extensions":[]},"statistics":"2.7.0","whitelisting_accounts":[],"blacklisting_accounts":[]}]}

When using an HTTP client, the API set ID can be replaced by the API set name, E.G.

$ curl --data '{"jsonrpc": "2.0", "method": "call", "params": ["database", "get_accounts", [["1.2.0"]]], "id": 1}' http://127.0.0.1:8090/

The definition of all node APIs is available in the source code files including database_api.hpp and api.hpp. Corresponding documentation can be found in Doxygen:

Wallet API

The cli_wallet program can also be configured to serve all of its commands as APIs, known as wallet API.

Start cli_wallet with RPC connection enabled:

$ ./programs/cli_wallet/cli_wallet --rpc-http-endpoint=127.0.0.1:8093

Access the wallet API using an HTTP client:

$ curl --data '{"jsonrpc": "2.0", "method": "info", "params": [], "id": 1}' http://127.0.0.1:8093/
$ curl --data '{"jsonrpc": "2.0", "method": "get_account", "params": ["1.2.0"], "id": 1}' http://127.0.0.1:8093/

Note: The syntax to access wallet API is a bit different than accessing node API.

Important:

  • When RPC connection is enabled for cli_wallet, sensitive data E.G. private keys which is accessible via commands will be accessible via RPC too. It is recommended that only open network connection to localhost or trusted addresses E.G. configure a firewall.
  • When using wallet API, sensitive data E.G. the wallet password and private keys is transmitted as plain text, thus may be vulnerable to network sniffing. It is recommended that only use wallet API with localhost, or in a clean network, and / or use --rpc-tls-endpoint parameter to only serve wallet API via secure connections.

Accessing restrictable node API sets

You can restrict node API sets to particular users by specifying an api-access file in config.ini or by using the --api-access /full/path/to/api-access.json command-line option on node startup. Here is an example api-access file which allows user bytemaster with password supersecret to access four different API sets, while allowing any other user to access the three public API sets necessary to use the node:

{
   "permission_map" :
   [
      [
         "bytemaster",
         {
            "password_hash_b64" : "9e9GF7ooXVb9k4BoSfNIPTelXeGOZ5DrgOYMj94elaY=",
            "password_salt_b64" : "INDdM6iCi/8=",
            "allowed_apis" : ["database_api", "network_broadcast_api", "history_api", "network_node_api"]
         }
      ],
      [
         "*",
         {
            "password_hash_b64" : "*",
            "password_salt_b64" : "*",
            "allowed_apis" : ["database_api", "network_broadcast_api", "history_api"]
         }
      ]
   ]
}

Note: the login API set is always accessible.

Passwords are stored in base64 as salted sha256 hashes. A simple Python script, saltpass.py is available to obtain hash and salt values from a password. A single asterisk "*" may be specified as username or password hash to accept any value.

With the above configuration, here is an example of how to call the add_node API from the network_node API set:

{"id":1, "method":"call", "params":[1,"login",["bytemaster", "supersecret"]]}
{"id":2, "method":"call", "params":[1,"network_node",[]]}
{"id":3, "method":"call", "params":[2,"add_node",["127.0.0.1:9090"]]}

Note, the call to network_node is necessary to obtain the correct API set ID for the network_node API set. It is not guaranteed that the API set ID for the network_node API set will always be 2.

The restricted API sets are accessible via HTTP too using basic access authentication. E.G.

$ curl --data '{"jsonrpc": "2.0", "method": "call", "params": ["network_node", "add_node", ["127.0.0.1:9090"]], "id": 1}' http://bytemaster:[email protected]:8090/

Our doxygen documentation contains the most up-to-date information about APIs for the node and the wallet.

FAQ

  • Is there a way to generate help with parameter names and method descriptions?

    Yes. Documentation of the code base, including APIs, can be generated using Doxygen. Simply run doxygen in this directory.

    If both Doxygen and perl are available in your build environment, the command-line wallet's help and gethelp commands will display help generated from the doxygen documentation.

    If your command-line wallet's help command displays descriptions without parameter names like signed_transaction transfer(string, string, string, string, string, bool) it means CMake was unable to find Doxygen or perl during configuration. If found, the output should look like this: signed_transaction transfer(string from, string to, string amount, string asset_symbol, string memo, bool broadcast)

  • Is there a way to allow external program to drive cli_wallet via websocket, JSONRPC, or HTTP?

    Yes. External programs may connect to the command-line wallet and make its calls over a websockets API. To do this, run the wallet in server mode, i.e. cli_wallet -H "127.0.0.1:9999" and then have the external program connect to it over the specified port (in this example, port 9999). Please check the "Using Built-In APIs" section for more info.

  • Is there a way to access methods which require login over HTTP?

    Yes. Most of the methods can be accessed by specifying the API name instead of an API ID. If an API is protected by a username and a password, it can be accessed by using basic access authentication. Please check the "Accessing restrictable node API sets" section for more info.

    However, HTTP is not really designed for "server push" notifications, and we would have to figure out a way to queue notifications for a polling client. Websockets solves this problem. If you need to access the stateful methods, use Websockets.

  • What is the meaning of a.b.c numbers?

    The first number specifies the space. Space 1 is for protocol objects, 2 is for implementation objects. Protocol space objects can appear on the wire, for example in the binary form of transactions. Implementation space objects cannot appear on the wire and solely exist for implementation purposes, such as optimization or internal bookkeeping.

    The second number specifies the type. The type of the object determines what fields it has. For a complete list of type IDs, see GRAPHENE_DEFINE_IDS(protocol, protocol_ids ...) in protocol/types.hpp and GRAPHENE_DEFINE_IDS(chain, implementation_ids ...) in chain/types.hpp.

    The third number specifies the instance. The instance of the object is different for each individual object.

  • The answer to the previous question was really confusing. Can you make it clearer?

    All account IDs are of the form 1.2.x. If you were the 9735th account to be registered, your account's ID will be 1.2.9735. Account 0 is special (it's the "committee account", which is controlled by the committee members and has a few abilities and restrictions other accounts do not).

    All asset IDs are of the form 1.3.x. If you were the 29th asset to be registered, your asset's ID will be 1.3.29. Asset 0 is special (it's BTS, which is considered the "core asset").

    The first and second number together identify the kind of thing you're talking about (1.2 for accounts, 1.3 for assets). The third number identifies the particular thing.

  • How do I get the network_add_nodes command to work? Why is it so complicated?

    You need to follow the instructions in the "Accessing restrictable node API sets" section to allow a username/password access to the network_node API set. Then you need to pass the username/password to the cli_wallet on the command line.

    It's set up this way so that the default configuration is secure even if the RPC port is publicly accessible. It's fine if your witness_node allows the general public to query the database or broadcast transactions (in fact, this is how the hosted web UI works). It's less fine if your witness_node allows the general public to control which p2p nodes it's connecting to. Therefore the API to add p2p connections needs to be set up with proper access controls.

License

BitShares Core is under the MIT license. See LICENSE for more information.

bitshares-core's People

Contributors

aautushka avatar abitmore avatar bytemaster avatar christophersanborn avatar chronoscrypto avatar cogutvalera avatar crypto-ape avatar cryptocifer avatar dev25519 avatar elmato avatar emfrias avatar iobanker avatar jmjatlanta avatar manikey123 avatar michelsantos avatar mvandeberg avatar nathanielhourt avatar openledgerapp avatar oxarbitrage avatar pmconrad avatar richardweiyang avatar ryanrfox avatar svk31 avatar syalon avatar takaaki7 avatar theoreticalbts avatar thetaconator avatar vikramrajkumar avatar wackou avatar xeroc 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  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

bitshares-core's Issues

Upstream secp256k1-zkp API has changed

From @clayop on August 7, 2015 21:55

Followed instruction in Readme.md

CMake Error in libraries/fc/CMakeLists.txt:
  Imported target "secp256k1" includes non-existent path

    "/home/clayop/graphene/libraries/fc/vendor/secp256k1-zkp/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

Copied from original issue: cryptonomex/graphene#226

witness_update operation needs tested

From @theoreticalbts on August 20, 2015 21:59

We need a witness_update_operation to be able to update block_signing_key and url field of a witness object.

Setting the block_signing_key to zero should not be allowed (this will be reserved for when/if we implement witness resignation). There should also be a memo field in the operation which contains the secret, encrypted to the new signing key. The memo field should be vector<char>.

Copied from original issue: cryptonomex/graphene#258

Implement unit test for witness budget running out

From @theoreticalbts on July 22, 2015 15:37

Make sure there is reasonable behavior if witness budget is equal to zero. This unit test may need to artificially change the block interval or witness budget variables by directly affecting the database, as this condition may not be possible in the real blockchain.

This may already be implemented somewhere...

Copied from original issue: cryptonomex/graphene#190

fork_database.hpp: fork_item::invalid is never used

From @bytemaster on August 18, 2015 19:32

The original purpose was to track blocks that get pushed and are then found to be invalid and then to prevent the fork database from accepting any additional blocks on top of that block.

Under BTS 0.x we had some issues where a block would get marked as invalid when it shouldn't have and then we would never be able to switch back to that fork. So there is some risk for marking things as invalid, but in theory the BTS 2 undo architecture shouldn't have the same issues.

Copied from original issue: cryptonomex/graphene#248

[Feature Suggestion] No Fee on User Side with Whitelisted UIA

From @clayop on December 6, 2016 0:15

If a UIA issuer has authority to allow or deny users with whitelisting, a possibility of spam attack can be significantly reduced and easily controlled out. In this case, a UIA issuer may want to remove transaction fees from users to facilitate UIA usage, while the issuer pays the fee through the fee pool.

There is a potential customer in Korea(a local government) and if this feature is implemented, we are going to push it more.

Copied from original issue: cryptonomex/graphene#667

Polish delayed node

From @nathanhourt on August 17, 2015 20:49

Following up on #237, there are some limitations of the initial implementation. Primarily, that the delayed node does not handle forking right now.

Optimally, the delayed node will check that the block ID's match for a given block number between its trusted node and itself, and, if they don't, pop blocks until they do. If it runs out of undo history, it needs to resync (this is currently hard to do without restarting the process, as it's impossible to clear the object graph from memory without destroying the database). Then it will resume syncing from the trusted node as usual.

Copied from original issue: cryptonomex/graphene#240

Review use of libsecp256k1 contexts

From @pmconrad on July 3, 2015 14:58

I stumbled across this bitcoin-core/secp256k1#254 (comment) :

That said, your question makes it clear that the intended use isn't clear. That should definitely be clarified in the header file and perhaps a README. I guess it should list this:

  • Do not create/destroy contexts for each call. Their creation is far slower than any library call, and part of their purpose is to reuse precomputed values across calls.
  • If you perform signing, you should call context_randomize after initialization of the context, and perhaps on a regularly basis (daily?).
  • When calling context_randomize pass in external entropy (perhaps from the operating system, perhaps from user input).
  • You are responsible for locking. After initialization, only context_randomize requires exclusive locked, but the caller is responsible for not calling any other functions that use the context during randomization.
  • If you do both validation and signing, you can either use a shared context for both, or separate contexts. One reason for using separate contexts if that for signing, calling context_randomize requires an exclusive lock on the context. If you need to do validation at the same time, it may be useful to separate them, so validation is not blocked by context randomization.

Apparently we need to call context_randomize regularly (for signing), with proper synchronization.

Copied from original issue: cryptonomex/graphene#131

Clean up plugin architecture

From @theoreticalbts on August 18, 2015 18:19

Currently our plugin architecture is not well encapsulated. Here are some problems I found:

  • We have code like this that manipulates operation_history_object in the core.
  • There is no reason to have most_recent_op in account_object as noted in the comment here.
  • The annotation subsystem is undocumented, unused and untested, but there are vestigial remnants of an early architecture where it was more widely used, such as meta_account_object.
  • The market_history and account_history plugins use the same space ID.
  • There is a comment in account_history_plugin.hpp noting that an object ID definition applies to the market history plugin!
  • The build scripts contain no provision for compile-time disabling of plugins. We should be able to build a witness_node binary with no account_history_plugin, and in fact should encourage active witnesses to run the stripped-down version without unnecessary indexes.
  • The CLI parameters contain no provision for run-time disabling of plugins. You should be able to specify which plugins you want in a config file, to enable/disable plugins without having to recompile.

Copied from original issue: cryptonomex/graphene#246

Intermittent connection failure in app_test

From @theoreticalbts on July 14, 2015 22:24

After fixing generally obsolete app_test in cfd9dd0 I notice that every few runs, I get the following error:

$ sudo -u graphene -H tests/app_test --log_level=message
Running 1 test case...
Creating temporary files
Creating and initializing app1
Creating and initializing app2
Starting app1 and waiting 500 ms
1209829ms th_a       application.cpp:190           operator()           ] Initializing database...
1209838ms th_a       application.cpp:63            create_example_genes ] Allocating all stake to 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
1209843ms th_a       thread.cpp:95                 thread               ] name:p2p tid:139731355076352
1209845ms th_a       application.cpp:118           reset_p2p_node       ] Configured p2p node to listen on 127.0.0.1:3939
Starting app2 and waiting 500 ms
1210345ms th_a       application.cpp:190           operator()           ] Initializing database...
1210345ms th_a       application.cpp:63            create_example_genes ] Allocating all stake to 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
1210349ms th_a       thread.cpp:95                 thread               ] name:p2p tid:139731255420672
1210350ms th_a       application.cpp:107           reset_p2p_node       ] Adding seed node 127.0.0.1:3939
1210351ms th_a       application.cpp:118           reset_p2p_node       ] Configured p2p node to listen on 127.0.0.1:4040
/home/cc/graphene/src/graphene/tests/app/main.cpp(74): fatal error in "two_node_network": critical check app1.p2p_node()->get_connection_count() == 1 failed [0 != 1]
1210852ms th_a       thread.cpp:115                ~thread              ] calling quit() on p2p
1210852ms th_a       thread.cpp:160                quit                 ] destroying boost thread 139731255420672
1210890ms th_a       thread.cpp:115                ~thread              ] calling quit() on p2p
1210890ms th_a       thread.cpp:160                quit                 ] destroying boost thread 139731355076352
1210890ms p2p        thread.cpp:246                exec                 ] thread canceled: 9 canceled_exception: Canceled
cancellation reason: [none given]
    {"reason":"[none given]"}
    p2p  thread_d.hpp:463 start_next_fiber

*** 1 failure detected in test suite "Test Application"

This does not happen on every run, but usually shows up after several runs, if you don't see it after ~10 runs then I would assume your environment is unable to reproduce it.

A similar bug in the past was cryptonomex/graphene#55

Copied from original issue: cryptonomex/graphene#159

database_fixture is ripe for refactoring

From @vikramrajkumar on June 9, 2015 17:44

Here are the problems with database_fixture:

  • Reliance on macros makes single stepping through tests difficult with GDB.
  • "trx" object being modified by macros makes it effectively a global variable. Functions / macros use trx for both input and output.
  • Many methods in .hpp could be moved to .cpp file, speed compiling, iterative development of new database_fixture method doesn't need to recompile every test .cpp file (as long as signature in header doesn't change)
  • Poor naming conventions in some places (e.g. genesis_account should be genesis_account_id)

Copied from original issue: cryptonomex/graphene#11

Implement unit test to change backing asset of MIA

From @theoreticalbts on July 22, 2015 15:25

MIA's can have their backing asset changed, but only when there is no supply. The unit test should verify:

  • Backing asset cannot be changed with nonzero supply
  • After the backing asset is changed, it can no longer be borrowed against the old backing
  • After the backing asset is changed, it can be borrowed against the new backing

Copied from original issue: cryptonomex/graphene#187

Audit charging of per-kilobyte fees

From @theoreticalbts on July 31, 2015 15:22

Any operation with potentially unbounded size needs to charge a size fee. Determining whether an operation is variable-size is non-trivial. An operation is variable size if it contains a vector, flat_set or other potentially variable-size element.

Note that this containment may be through any number of intermediate structs. For example, any operation which contains an authority has potentially unbounded size.

We should be able to audit this in a semi-automatic way with logic similar to js_operation_serializer which traverses all operations, and noting any variable-size types found (in any number of sub-structures), allowing us to flag each operation as variable-sized (or not). We will still have to manually specify whether any base type is variable-size or not.

Copied from original issue: cryptonomex/graphene#216

[Feature Suggestion] No Fee on User Side with Whitelisted UIA

If a UIA issuer has authority to allow or deny users with whitelisting, a possibility of spam attack can be significantly reduced and easily controlled out. In this case, a UIA issuer may want to remove transaction fees from users to facilitate UIA usage, while the issuer pays the fee through the fee pool.

There is a potential customer in Korea(a local government) and if this feature is implemented, we are going to push it more.

Note: The original issuance is here

Test renewal of annual membership

From @theoreticalbts on July 22, 2015 15:10

Create an annual membership, renew it before expiration, make sure the date is pushed back the proper amount regardless of when the renewal occurs.

Then try renewing a lapsed annual membership. Make sure fees have reasonable semantics in the gap between expiry and renewal.

Copied from original issue: cryptonomex/graphene#180

Peer is disconnecting us because ... attempting to push a block that is too old

From @abitmore on August 22, 2015 23:19

That's probably why it's hard to get into sync after got out of sync?

2015-08-22T22:20:33 p2p:message read_loop on_closing_connectio ] Peer 45.55.6.216:1776 is disconnecting us because of an error: You offered us a block that we reject as invalid, exception: {"code":10,"name":"assert_exception","message":"Assert Exception","stack":[{"context":{"level":"error","file":"fork_database.cpp","line":69,"method":"_push_block","hostname":"","thread_name":"th_a","timestamp":"2015-08-22T22:20:33"},"format":"item->num > std::max<int64_t>( 0, int64_t(_head->num) - (_max_size) ): attempting to push a block that is too old","data":{"item->num":174057,"head":174075,"max_size":10}},{"context":{"level":"warn","file":"db_block.cpp","line":176,"method":"_push_block","hostname":"","thread_name":"th_a","timestamp":"2015-08-22T22:20:33"},"format":"","data":{"new_block":{"previous":"0002a7e8b9613cd334a36aeccdb1d32460d8fa53","timestamp":"2015-08-22T22:20:14","witness":"1.6.4","next_secret_hash":"a6b9319cdc3465202c6ee6ba20f6fcfb4eb26211","previous_secret":"d879b9f9a141a1f9edc662fad77dcfa068e6562c","transaction_merkle_root":"0000000000000000000000000000000000000000","extensions":[],"witness_signature":"2055c39c86e1dd8acc632ea55d010ce56dd01601106c3367fa5ae6b3d08d35a5567a545a0a23a1bace2bf651c049a2559ba75f8ba87b0e597fe9ca88f113a2804e","transactions":[]}}},{"context":{"level":"warn","file":"application.cpp","line":379,"method":"handle_block","hostname":"","thread_name":"th_a","timestamp":"2015-08-22T22:20:33"},"format":"","data":{"blk_msg":{"block":{"previous":"0002a7e8b9613cd334a36aeccdb1d32460d8fa53","timestamp":"2015-08-22T22:20:14","witness":"1.6.4","next_secret_hash":"a6b9319cdc3465202c6ee6ba20f6fcfb4eb26211","previous_secret":"d879b9f9a141a1f9edc662fad77dcfa068e6562c","transaction_merkle_root":"0000000000000000000000000000000000000000","extensions":[],"witness_signature":"2055c39c86e1dd8acc632ea55d010ce56dd01601106c3367fa5ae6b3d08d35a5567a545a0a23a1bace2bf651c049a2559ba75f8ba87b0e597fe9ca88f113a2804e","transactions":[]},"block_id":"0002a7e934a552405ffc797448a046e0bbf916d9"},"sync_mode":true}}]}                     node.cpp:2666

Copied from original issue: cryptonomex/graphene#262

Localizable exceptions

From @valzav on July 6, 2015 18:19

It would be nice to have exceptions that we can translate to other languages in GUI.
In order to do this an exception may require to have some code or symbol and parameters, e.g. exception object might look like this:
{
error: "not-valid-address",
param1: "1EDJEW3508324LJDSF908342L",
eng: "Not valid address: %1",
message: "Not valid address: 1EDJEW3508324LJDSF908342L",
stack: ...
}

Copied from original issue: cryptonomex/graphene#135

Refactor API calls to be more future-proof

From @theoreticalbts on August 18, 2015 16:21

Implementation of cryptonomex/graphene#236 has revealed a general issue when extending API calls. When adding parameters to an API call, it has been noted that we should have a cycle of introducing a new call, deprecating the old call, waiting for web UI code to be updated, and then removing the old call.

The deprecation cycle is necessary because adding parameters to an API call breaks every API client that uses that call, even if the new parameters have default values, because the FC reflection API does not understand how to interact with default values due to underlying deficiencies in C++

In this ticket, I propose a solution to this problem: Most or all API calls should be rewritten to take a single struct, containing the values that were previously passed as separate arguments. Defaults can then be placed in the C++ struct definition, and if some fields do not occur in the JSON dictionary provided by the client, then those fields should not be assigned by the API framework and thus will have their default values.

I should test that the API framework does in fact give fields that do not exist in the JSON object their default values.

Copied from original issue: cryptonomex/graphene#245

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.