Code Monkey home page Code Monkey logo

eostracker-api's Introduction

๐Ÿ’Ž EOS Tracker API

EOS Tracker API is a PHP Backend based on Symfony3 that connects to a MySQL database.

๐Ÿ“Œ Requirements

๐Ÿ“Œ Installing Composer

Composer is the dependency manager used by modern PHP applications and it can also be used to create new applications.

Download the installer from getcomposer.org/download, execute it and follow the instructions.

๐Ÿ“Œ Installation

Execute this command to install the project:

$ git clone [email protected]:EOSEssentials/EOSTracker-API.git
$ cd EOSTracker-API
$ composer install

๐Ÿ“Œ Usage

There's no need to configure anything to run the application. Just execute this command to run the built-in web server and access the application in your browser at http://localhost:8000:

$ php bin/console server:run

Alternatively, you can configure a fully-featured web server like Nginx or Apache to run the application.

eostracker-api's People

Contributors

ghoti143 avatar kesar 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

eostracker-api's Issues

Timestamp as Unix timestamp

We currently store timestamps in local timezone instead of UTC. I understand it would be difficult to update all of them in UTC considering the amount of data we have. However, we can do some datetime transformation on the API, e.g., in the Entity to map out correct unix timestamp? Also, should we use unix timestamp instead of ISO 8601 format? If we use unix timestamp, it would be a loss transformation since EOS produce 2 blocks every second and unix timestamp is in second. It would be better to return ISO 8601 format like EOS chain API (they should have "Z" appended at the end, which I think is a bug on EOSIO plugin).

Contract verification

Allow to upload contract code + verify that code its the one stored in the blockchain.

How to set the current database

I edit parameters.yml to see support for 3 kinds of databases,
I want to use the mysql database and get the following data through the installation wizard
parameters:
secret: ThisTokenIsNotSoSecretChangeIt
env(DB_URL): 'mysql://root:password@localhost/eos'
env(MONGO_URL): 'mongodb://localhost:27017/EOS'
env(REDIS_URL): 'redis://root@localhost:423432'

But always use Redis configuration after running
image
How will I set mysql to the current database?

removed mongo_db_plugin

@kesar
Please allow me to ask that, the latest commit of the EOS source code on master branch cbf28a237f3f2605b4ac34c5bb0c98a4d931e99f has disabled the mongo_db_plugin.

So, how can still your EOSTracker tool work?

The sql_db_plugin is also disabled by default.

[QUESTION] How to implement /messages ?

Hello Kesar

May I ask how did you implement the /messages API?

I managed to set up a down 3.0 local testnet and your Tracker-API. I just find /actions interface but no /messages API as in you eostracker.io website.

I didn't find message table in mongo db either.

$ show collections
Accounts
ActionTraces
Actions
Blocks
Transactions

Thank you.

Support for MongoDB

@kesar
I'd very like to ask if you plan to add again support for MongoDB as the mongo_db_plugin has been re-enabled in EOSIO software.

Many thanks and cheers

Aggregate Block timestamp data with Transaction data

In the TransactionController, the transactionsAction should aggregate data from the Block collection to enable the timestamp from the transaction's containing block to be returned with the transaction data.

Here is an example mongo query that can be used as a starting point:

//this requires at least Mongo 3.2

db.Transactions.aggregate([
{$lookup: {
  from: "Blocks",
  localField: "block_id",
  foreignField: "block_id",
  as: "block_docs"
}},
{$unwind: '$block_docs'},
{$project: {
    timestamp: '$block_docs.timestamp',
    transaction_id: 1,
    sequence_num: 1,
    block_id: 1,
    ref_block_num: 1,
    ref_block_prefix: 1,
    expiration: 1,
    signatures: 1,
    actions: 1,
    createdAt: 1
}}
])

There's probably a more concise way to say "select the timestamp field from Block record and all of the fields from the Transaction record."

How about the env(REDIS_URL)

In the app/config/parameters.yml file, have the env(REDIS_URL) configuration. How about this config? Is this necessary?

Thanks.

how to set password to connect mysql

error:Driver->connect(array('url' => 'mysql://tic@localhost/tic@tic', 'driver' => 'pdo_mysql', 'charset' => 'UTF8', 'host' => 'localhost', 'port' => null, 'user' => 'tic', 'password' => null, 'driverOptions' => array(), 'serverVersion' => 5.7, 'defaultTableOptions' => array(), 'dbname' => 'tic'), 'tic', null, array())

password is null!where set password?

Please add a license

Please could you add a LICENSE file to this project to clarify the terms that this code may be used under. If you need to choose an appropriate open source license I recommend looking at https://choosealicense.com/.

Where do the data for mainnet come from?

I tried to parse blocks with Dawn4 testnet, but seems all DB plugins for Dawn4 are broken now, sql_db_plugin and mongo_plugin.

May I ask how to fetch data from mainnet? without that the API is not functional.

account_actions_to router can't retrieve data

In the ./src/AppBundle/Services/ActionService.php file, there is getToAccount function

    public function getToAccount(Account $account, int $page = 1, int $limit = 30)
    {
        return $this->getEntityManager()->createQuery(<<<DQL
SELECT a, aa, att, ac
FROM AppBundle\Entity\Action a
LEFT JOIN a.authorizations aa
JOIN a.transaction att
JOIN a.account ac
WHERE a.account = :ACCOUNT
ORDER BY a.id DESC
DQL
        )
            ->setParameter('ACCOUNT', $account)
            ->setFirstResult($limit * ($page - 1))
            ->setMaxResults($limit)
            ->getResult();
    }

The ./src/AppBundle/Controller/AccountController.php define a route:

  /**
     * @Route("/accounts/{name}/actions/to", name="account_actions_to")
     */

But post a request to http://xxx.xxx.xxx.xxx:8000/accounts/xxxxxx/actions/to get nothing.

In addition, both exists from and to transfer action.

Thanks.

SQL error and nodeos force exit, data need resync

Some sql error exists in the nodeos log, and the nodeos force quit. Yet I have to delete blocks file of EOS blockchain and eos database in MySQL to force resync, how to avoid and solve this problem?

Thanks.

Create Entities

No entities have been created, it would be great to have entities coming from mongodb

cannot access

localhost:8000 is not accessible according to the successful installation of the document.
f6506e2d794e7608d6af21162137721

Error refund request not found

I passed the following order
--sql_db-uri="mysql://db=eos user=root host=127.0.0.1 password=password" --data-dir /mnt/data/data --hard-replay-blockchain

But always the following error

1768468ms thread-0 wasm_interface.cpp:929 eosio_assert ] message: refund request not found
1768469ms thread-0 controller.cpp:612 push_scheduled_trans ] 3050003 eosio_assert_message_exception: eosio_assert_message assertion failure
assertion failure with message: refund request not found
{"s":"refund request not found"}
thread-0 wasm_interface.cpp:930 eosio_assert
pending console output:
{"console":""}
thread-0 apply_context.cpp:61 exec_one
1800227ms thread-0 controller.cpp:153 emit ] bad alloc
Segmentation fault

I am using the https://github.com/NebulaProtocol/eos.git sql_plugin branch

I originally wanted to copy NebulaProtocol/plugins/sql_plugin directly to the EOSIO project, compile directly, and open add_subdirectory(sql_db_plugin), but the plugin was not compiled correctly. And there are no errors.So directly use the sql_plugin branch of NebulaProtocol.

I have seen similar problems with EOSIO.
EOSIO/eos#4539
Do you suspect that you need to upgrade the version of eos?
So how do you use NebulaProtocol's sql_plugin in EOSIO?

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.