All Projects → OracleChain → EosProxyServer

OracleChain / EosProxyServer

Licence: LGPL-3.0 license
A full-functional backend server of EOS wallet.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to EosProxyServer

Anchor
EOSIO Desktop Wallet and Authenticator
Stars: ✭ 381 (+958.33%)
Mutual labels:  wallet, eos
wallet-eos
wallet-eos EOS钱包 助记词 私钥 转账
Stars: ✭ 28 (-22.22%)
Mutual labels:  wallet, eos
Simpleos
EOSIO Blockchain Interface & Wallet
Stars: ✭ 157 (+336.11%)
Mutual labels:  wallet, eos
EOSWallet
🔐EOS Wallet: Manage your EOS accounts with steroids :)
Stars: ✭ 36 (+0%)
Mutual labels:  wallet, eos
Blockchain
区块链技术
Stars: ✭ 28 (-22.22%)
Mutual labels:  wallet, eos
Tiny.scatter
Scatter compatible eos injection library
Stars: ✭ 31 (-13.89%)
Mutual labels:  wallet, eos
Blockchainwallet Crypto
比特币、以太坊公私钥生成以及签名,长时间不维护可移步 https://github.com/QuincySx/ChainWallet
Stars: ✭ 183 (+408.33%)
Mutual labels:  wallet, eos
conceal-desktop
Conceal Desktop (GUI)
Stars: ✭ 65 (+80.56%)
Mutual labels:  wallet
piWallet
No description or website provided.
Stars: ✭ 17 (-52.78%)
Mutual labels:  wallet
simple-mpesa
A simple example of how MPESA works. Works with all 3 types of customers i.e. Agents, Merchants and Subscribers. Allows you to configure a tariff and apply it to transactions. The project follows DDD principles.
Stars: ✭ 31 (-13.89%)
Mutual labels:  wallet
BitBlocks old
BitBlocks Project_OLD
Stars: ✭ 12 (-66.67%)
Mutual labels:  wallet
PassEncoder
Simple PassKit (Apple Wallet) encoding and signing in Swift.
Stars: ✭ 28 (-22.22%)
Mutual labels:  wallet
json-fake-server
Simple way to create http server (node js) https://www.npmjs.com/package/test-fake-server
Stars: ✭ 15 (-58.33%)
Mutual labels:  backend-server
eosgo-client
A simple Go wrapper of EOS (eosio) RPC API, and more!
Stars: ✭ 29 (-19.44%)
Mutual labels:  eos
thor-sync.electron
A browser that empowers DApps on VeChain
Stars: ✭ 52 (+44.44%)
Mutual labels:  wallet
hd-address
An extensible HD Wallet Address management utility
Stars: ✭ 22 (-38.89%)
Mutual labels:  wallet
albedo
Security-centric, developer-friendly, easy-to-use delegated signer and keystore for Stellar Network
Stars: ✭ 57 (+58.33%)
Mutual labels:  wallet
RaiBlocksPHP
A bunch of PHP methods to build and sign transactions
Stars: ✭ 20 (-44.44%)
Mutual labels:  wallet
alias-wallet
Official Alias source code repository
Stars: ✭ 5 (-86.11%)
Mutual labels:  wallet
alcor-ui
Alcor Exchange | First self-listing onchain DEX for eosio tokens;
Stars: ✭ 103 (+186.11%)
Mutual labels:  eos

中文版

About

EosProxyServer is the FULL-FUNCTIONAL backend server of PocketEOS, which is developed by OracleChain.io.


Menu


Overview

This project is the full-funcional backend server for PocketEos-Android/PocketEos-IOS.

What does this project provide:

1.Realtime market rates: Our token rates are sourced from coinmarketcap and newdex.

2.We provide a general EOS error code SPEC without importing EOSIO code base(EOSJS/EOS C++): The standard error code could make better user experience, and make users have a better understanding of what really happened when something's wrong.

3.Use our JAVA server to create new accounts.We provide two ways to make free new account.

4.Use our JAVA server to sign server side transactions, such as: transferring for airdrops, or calling a complex contract.


ENVIRONMENT

Compile EosProxyServer from source code:

  1. prepare a redis server for data cache of token rates

  2. install IntelliJ IDEA + jdk1.8 + maven 4.0.0

  3. clone our git repository.

git clone https://github.com/OracleChain/EosProxyServer.git

  1. import the project with IntelliJ IDEA

  2. edit redis server configuration in src/main/resources/application.yml.

host: redis_server_ip

port: redis_server_port

password: redis_passwd

  1. edit server transaction parameters in src/main/java/com/oraclechain/eosio/constants/Variables.java.

public static final String eosAccount = "tx_account_name";

public static final String eosPrivateKey = "tx_private_key";

public static final String eosAccountVip = "tx_account_name";

public static final String eosPrivateKeyVip = "tx_private_key";

We use eosAccount/eosPrivateKey to create free account(fixed Ram/Bandwidth) or push action, as long as the account have tokens to do it.

Meanwhile, the eosAccountVip/eosPrivateKeyVip would have sufficent EOS to create vip accounts(with flexible Ram/Bandwidth), but it have to be verified in RPC call with an invite code or server ticket(key-value in redis in this case).

  1. Run it.

  2. Make a request on Browser/Postman for testing


API Introduction


Exception Handling

We provide client a more stable environment, smooth version upgrading, universal error exceptions with resolving all EOS exceptions into one standard.

With the univeral error exceptions, you can make more internationalized error tips for users.

In EOS code base, the exceptions were handled in three layers.

1.the FC layer, handling the graphene tool exceptions.

2.the CHAIN layer, handling EOS chain logic exceptions.

3.In the CONTRACT layer, you can standardize a general error code specification in your contract code. Then you can catch the contract error code with a parser in CODE.

4.What's more, there is internationalization project keeping track of the error code specification in EOS code EOSIO API ERROR CODE SPECIFICATION.If you are interested in this project, you can join us on telegram.

FC Layer Exceptions

EOS is based on grephene framework, which defines the error code of FC layer in FC expceptions file.

We unified the error code with a offset of 3990000.

Chain Layer Exceptions

When dealing with EOS blockchain rpc service, most of the exceptions were CHAIN exceptions, and we using it directly with some self defined code here.


Add Your Token Asset

How to add your own token

Let's take OracleChainToken contract for example, the contract address is "octtothemoon", with our symbol "OCT"

1.modify dto/AccountAssetInfo.java entity, which defines the response of assets query:

private String oct_balance;
private String oct_balance_usd;
private String oct_balance_cny;
private String oct_price_usd;
private String oct_price_cny;
private String oct_price_change_in_24h;
private String oct_market_cap_usd;
private String oct_market_cap_cny;

2.modify controller/QueryTabController.java, the get_account_asset interface, to make adaptions to new tokens:

//get token balance for the user "octgenerator"
BigDecimal oct_balance = blockServiceEos.getBalance(
    Variables.eosChainUrl,
    "octtothemoon",
    "OCT",
    "octgenerator");

//resolve third party token rates with fiat currency, and we store the rate in redis(the way of cache is pretty simple, which should be improved in production env.)
redis_key = Variables.redisKeyPrefixBlockchain+ Variables.redisKeyEosCoinmarketcapMid+ "oraclechain";
CoinMarketTicker coinMarketTicker_oct = redisService.get(redis_key, CoinMarketTicker.class);
if(coinMarketTicker_oct == null){
    try{
        req_url.append(Variables.COINMARKETCAP_TICKER).append("oraclechain").append("?convert=CNY");
        result = HttpClientUtils.get(req_url.toString(), "UTF-8");
        coinMarketTicker_oct  = JSON.parseArray(result, CoinMarketTicker.class).get(0);
        redisService.set(redis_key, coinMarketTicker_oct, Variables.redisCacheTimeout);
    }
    catch (Exception e)
    {
        throw new ExceptionsChain(ErrorCodeEnumChain.unknown_market_id_exception);
    }
}

//finally we send the token info with AccountAssetInfo entity
AccountAssetInfo asset_info= new AccountAssetInfo();
BigDecimal oct_usd_price = new BigDecimal(coinMarketTicker.getPrice_usd());
BigDecimal oct_cny_price = new BigDecimal(coinMarketTicker.getPrice_cny());
double oct_price_change_in_24h = Double.valueOf(coinMarketTicker.getPercent_change_24h());//.doubleValue();
asset_info.setOct_balance(oct_balance.setScale(Variables.precision, RoundingMode.DOWN).toPlainString());
asset_info.setOct_balance_usd(oct_balance.multiply(oct_usd_price).setScale(Variables.precision, RoundingMode.DOWN).toPlainString());
asset_info.setOct_balance_cny(oct_balance.multiply(oct_cny_price).setScale(Variables.precision, RoundingMode.DOWN).toPlainString());
asset_info.setOct_price_usd(oct_usd_price.toString());
asset_info.setOct_price_cny(oct_cny_price.toString());
asset_info.setOct_price_change_in_24h(Double.toString(oct_price_change_in_24h));
asset_info.setOct_market_cap_usd(coinMarketTicker.getMarket_cap_usd());
asset_info.setOct_market_cap_cny(coinMarketTicker.getMarket_cap_cny());

Create Server Side Transactions

You can provide a server side transaction by define a peer of operation account and private key in src/main/java/com/oraclechain/eosio/constants/Variables.java.

Then, using push_action/create_account/create_vip_account RPC interface(in TransactionController) to handle the trx request.


About OracleChain

As the world’s first application built on an EOS ecosphere, OracleChain needs to meet the demands of the Oracle (oracle machine) ecosystem by efficiently linking blockchain technology services with various real-life scenarios, thereby delving into this immense tens of billions of dollars valuation market.

As a decentralized Oracle technology platform based on the EOS platform, the autonomous Proof-of-Reputation & Deposit mechanism is adopted and used as a fundamental service for other blockchain applications.In addition to Oracle services that provide real-world data to the blockchain, Oracle services that provide cross-chain data are also offered. Given that OracleChain can accomplish the functions of several prediction market applications, such as Augur and Gnosis, OracleChain can also support smart contract businesses that require high-frequency access to outside data in certain scenarios, such as Robo-Advisor.

OracleChain will nurture and serve those blockchain applications that change the real world. Our mission is to “Link Data, Link World,” with the aim of becoming the infrastructure linking the real world with the blockchain world.

By achieving intra-chain and extra-chain data connectivity, we aspire to create a service provisioning platform that can most efficiently gain access to extra-chain data in the future blockchain world.

LICENSE

Released under GNU/LGPL Version 3

THANKS

ECDSA and chain utility are based on the source code of EOSCommander,thx for the contribution of PLAYERONE.ID team!

If you found this project useful, vote us(oraclegogogo) and have fun with EOS.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].