Git Product home page Git Product logo

ethtx_ce's Introduction

EthTx Community Edition


Community version of EthTx transaction decoder
https://ethtx.info

Python Black OpenSource Apache


Description

This project represents usage of EthTx decoding library in form of a website. If you are looking for implementation of the said decoding functionalities, please refer to EthTx repository.

Local environment

Here is a list of steps to recreate local environment on Ubuntu distribution.

  1. Install needed packages using apt:

    apt install docker-compose python3-pip python3-dev pipenv make
    apt install libxml2-dev libxslt1-dev gcc
  2. Run:

    pipenv install
  3. Copy .env_sample to .env and fill required field according to description

      # Proper nodes are required to run ethtx, provide connection strings for chains which will be used.
      MAINNET_NODE_URL=https://geth-erigon-node:8545
      # KOVAN_NODE_URL=
      # RINKEBY_NODE_URL=
    
      # EthTx supports multiple nodes, if one is unavailable, it will use others. You only need to specify them with a comma
      # Example: MAINNET_NODE_URL=https://geth-erigon-node:8545,https://geth1-erigon-node:8545
    
    
      # Etherscan API is used to get contract source code, required for decoding process
      # You can get free key here https://etherscan.io/apis
      ETHERSCAN_KEY=
    
      # Optional. Those represent data required for connecting to mongoDB. It's used for caching semantics
      # used in decoding process. But, it's not neccessary for running, If you don't want to use permanent
      # db or setup mongo, leave those values, mongomock package is used to simulate in-memory mongo.
      MONGO_CONNECTION_STRING=mongomock://localhost/ethtx
    
      # Optional. Credentials for accessing semantics editor page, available under '/semantics/<str:address>'
      ETHTX_ADMIN_USERNAME=admin
      ETHTX_ADMIN_PASSWORD=admin
    
      # Optional. Api key used for exposing
      API_KEY=
    
      # Optional. Valid values are ['production', 'staging', 'development']. Those mainly
      # dictate what options are used for flask debugging and logging
      ENV=development
    
  4. Run

    PYTHONPATH=./ethtx_ce FLASK_APP=ethtx_ce/app/wsgi.py pipenv run flask run --host=0.0.0.0 --port 5000

    or

    make run-local

    This will setup new server on host 0.0.0.0 port 5000.

  5. Now ethtx_ce should be accessible through link http://localhost:5000

Use can also provided docker-compose for running this locally:

docker-compose up

Note, this also need proper .env file to function properly.

.env file

For proper functioning, .env file is required containing all database and 3rd party providers configuration. .env_sample file is provided in repository with example values.

Parameters [CHAIN_ID]_NODE_URL should hold valid urls to ethereum nodes; Parameter ETHERSCAN_KEY should be equal to Etherscan API key assigned to user.

API

The EthTx APIs are provided as a community service and without warranty, so please use what you need and no more. We support GET requests.

  • Decode transaction

    Returns decoded EthTx transaction, based on chain_id and transaction hash tx_hash

    • URL
      /api/transactions/CHAIN_ID/TX_HASH
    • Method GET
    • Authorization
      • Required: header: x-api-key=[string] OR query parameter: api_key=[string]
    • URL Params
      • Required: chain_id=[string],tx_hash=[string]
    • Example
      curl --location --request GET 'http://0.0.0.0:5000/api/transactions/dsad/asd' \
      --header 'x-api-key: 05a2212d-9985-48d2-b54f-0fbc5ba28766'
  • Get Raw Semantic

    Returns raw semantic based on chain_id and sender/receiver address

    • URL
      /api/semantics/CHAIN_ID/ADDRESS
    • Method GET
    • Authorization
      • Required: header: x-api-key=[string] OR query parameter: api_key=[string]
    • URL Params
      • Required:chain_id=[string],address=[string]
    • Example
      curl --location --request GET 'http://0.0.0.0:5000/api/semantics/dsad/asd' \
      --header 'x-api-key: 05a2212d-9985-48d2-b54f-0fbc5ba28766'
  • Info

    Returns information about the EthTx

    • URL
      /api/info
    • Method GET
    • Authorization
      • Required: header: x-api-key=[string] OR query parameter: api_key=[string]
    • URL Params
      • None
    • Example
      curl --location --request GET 'http://0.0.0.0:5000/api/info' \
      --header 'x-api-key: 05a2212d-9985-48d2-b54f-0fbc5ba28766'

ethtx_ce's People

Contributors

dudzicz avatar feld avatar kchojn avatar piotr-rudnik avatar tmierzwa avatar wolololol avatar zdumitru 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

ethtx_ce's Issues

Dependencies error

Getting some dependencies error.

image

I proceed with --skip-lock but then getting dependencies error while building docker image

image

Hello,

I'm running this code on my lunix server, trying to add support for bsc and polygon, but it reports an error: ModuleNotFoundError: No module named 'ethtx'. Can you tell me what to do? Do I have to install a copy of ethtx by pip install ethts?

Cannot connect to node

I'm not entirely sure why as my ethtx_ce instance was working fine in the past, but now it fails to connect to my node.

2022-10-20 20:06:23.361 WARNING  [web3_provider.py:139 - _get_node_connection 8/MainProcess]     Connection failed to: <Chain: mainnet, Node: "REDACTED", Poa: False>

The node I have it pointed to at the moment is a hosted instance by Chainstack. I've updated to the latest ethtx_ce (0.3.17), and I've ruled out it being a problem with their TLS cert by making a local proxy that strips TLS and trying to use that.

Token transfers and Execution trace sections shows wrong transfer amount

Bug Description
The transfer amount shown in the token transfer and execution section is wrong. For this rinkeby transaction, the amount transferred is amount 100 WBTC, But https://ethtx.info/ Token transfers sections say 0.0000 tokens got transferred and Execution trace section says erc20 transfer from amount=1e-08 instead of 100. But in etherscan state logs, I can see that 100 is transferred. And yes the end balance of BalanceSheet is increased by 100.
https://rinkeby.etherscan.io/tx/0xa8ebcb18b2c2a349e084c3b26d534e9ccaaee39365c477806573cd639f3cac49
image
image

Expected Behavior
The token transfer and execution section should show the correct transfer value of WBTC.

"About this implementation" customization

Can you make it easier to inject info about who is hosting this instance of ethtx_ce so we don't have to fork+modify ethtx_ce/frontend/templates/index.html ?

Thanks

API key?

Hey

That's some nice job you guys did here.
Where can I create an API key to use it?

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.