Coder Social home page Coder Social logo

eadwin / gxb-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gxchain/gxb-core

0.0 2.0 0.0 330.82 MB

GXB-Core

Home Page: https://www.gxb.io/

License: GNU General Public License v3.0

CMake 0.88% C++ 97.87% Perl 0.14% Python 1.04% Shell 0.07%

gxb-core's Introduction

GXB-Core


GXB-Core is the GXB blockchain implementation and command-line interface. Current binary version of the GXB-Core software for ubuntu 14.04 LTS, see here. Visit gxb.io to learn about GXB.

API Document

APIs are separated into two categories, namely

  • the Blockchain API which is used to query blockchain data (account, assets, trading history, etc.) and
  • the Wallet API which has your private keys loaded and is required when interacting with the blockchain with new transactions.

Wallet API.

Blockchain API.

Document For Exchange

Document For Exchange(δΈ­ζ–‡)

Document For Exchange(en)

Get Account History With Wallet API

The method get_irreversible_account_historys returns irreversible account history with txID. In order to interface with the wallet, you need to run the CLI Wallet. Use cli_wallet command:

unlocked >>> get_irreversible_account_historys <ACCOUNT> [<operation id>] <start> <limit>

Using an HTTP client such as curl:

$ curl -d '{"jsonrpc": "2.0", "method": "get_irreversible_account_historys", "params": ["1.2.17",[],1,100], "id": 1}' http://127.0.0.1:8091/rpc

Getting Started


Dependencies

A decent C++11 compiler (GNU GCC 5.4.1+ on ubuntu, or Apple LLVM version 8.1.0 (clang-802.0.42) on MacOS). CMake version 2.8+. Boost version 1.57.0. The repository contains the install scripts for gcc5 and boost 1.57.0, see here.

# dependencies for OS X, macOS Sierra 10.12.6 recommended
brew install wget cmake git openssl autoconf automake doxygen libtool

# dependencies for ubuntu 14.04 LTS
sudo apt-get install wget cmake make python-dev libbz2-dev libdb++-dev libdb-dev libssl-dev openssl libreadline-dev autoconf libtool git ntp

NOTE: GXB-Core requires an OpenSSL version in the 1.0.x series. If your system OpenSSL version is newer, then you will need to manually provide an older version of OpenSSL and specify it to CMake using -DOPENSSL_INCLUDE_DIR, -DOPENSSL_SSL_LIBRARY, and -DOPENSSL_CRYPTO_LIBRARY.

cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -DCMAKE_BUILD_TYPE=Release ..

Building

To build after all dependencies are installed:

git clone https://github.com/gxchain/gxb-core.git
cd gxb-core
git submodule update --init --recursive
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

Alternate Boost versions can be specified using the DBOOST_ROOT CMake argument.

Running

After building, the witness node can be launched with:

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

The node will automatically create a data directory including a config file. It may take several minutes to fully synchronize the blockchain.

After starting the witness node, in a separate terminal you can run cli_wallet:

    ./programs/cli_wallet/cli_wallet -s ws://127.0.0.1:8090

Set your inital password:

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

To import your wif_key(active key):

    unlocked >>> import_key <ACCOUNT NAME> [<WIF_KEY>] true

Import balances:

    unlocked >>> import_balance <ACCOUNT NAME> [<WIF_KEY>] true

Transferring Currency:

    unlocked >>> transfer <FROM ACCOUNT> <TO ACCOUNT> 100 GXC "" true

If you send private keys over this connection, rpc-endpoint should be bound to localhost for security.

Use help to see all available wallet commands.

Need Help ?


Report bugs, issues using GitHub issues.

License


GXB-Core is under the GNU General Public License v3. See LICENSE.

gxb-core's People

Contributors

tututt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.