GithubHelp home page GithubHelp logo

paulperegud / ethtxd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kendricktan/ethtxd

0.0 2.0 0.0 78 KB

Ethereum Tx Decoder

License: MIT License

Makefile 1.01% Nix 30.82% Haskell 66.83% Dockerfile 1.34%

ethtxd's Introduction

ethtxd

build GitHub tag (latest SemVer pre-release)

Lightweight Ethereum Tx Decoder with a built in REST API.

Whats this?

A simple tool with an API to extract out Ethereum call traces.

Install from Source

Unfortunately due to some low-level functions in glibc, this can't be compiled into a static binary. It requires to be built from source for the time being.

sh <(curl -L https://nixos.org/nix/install) --daemon

make build

cp dist-newstyle/<...>/ethtxd ~/.local/bin/ethtxd

Usage

# Terminal 1
ethtxd -p 3000 -r https://mainnet.infura.io/v3/<PROJECT_ID>

# Terminal 2
curl localhost:3000/tx/<TX_HASH>

Example Return

Note that you can compose this tool with 4byte.directory or abi-decoder to decode the function signatures and event topics.

{
  "tag": "SuccessResponse",
  "txHash": "0xc7963f40f6e62de89ca32e4b39d4a26e354ed743e0e922ad1917e3d90b6bbc2e",
  "traces": [
    {
      "tag": "TxCall",
      "callTarget": "0x95c4b6c7cff608c0ca048df8b81a484aa377172b",
      "callSigBytes": "0xa9059cbb",
      "callData": "0x0000000000000000000000009389e143dff86096766cd9ff82198857745a8d7b00000000000000000000000000000000000000000000000863a750c3291ed23b",
      "callTrace": [
        {
          "tag": "TxEvent",
          "eventBytes": "0x00000000000000000000000000000000000000000000000863a750c3291ed23b",
          "eventTopics": [
            "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
            "0x3a22df48d84957f907e67f4313e3d43179040d6e",
            "0x9389e143dff86096766cd9ff82198857745a8d7b"
          ]
        },
        {
          "tag": "TxReturn",
          "returnData": "0x0000000000000000000000000000000000000000000000000000000000000001"
        }
      ]
    },
    {
      "tag": "TxEvent",
      "eventBytes": "0x00000000000000000000000000000000000000000000000863a750c3291ed23b",
      "eventTopics": [
        "0x7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5",
        "0x9389e143dff86096766cd9ff82198857745a8d7b"
      ]
    }
  ]
}

Build

# Install Nix
sh <(curl -L https://nixos.org/nix/install) --daemon

# Get Cachix
nix-env -iA cachix -f https://cachix.org/api/v1/install

# Use cachis
cachix use dapp

make build

Development

We're using VSCode with the vscode-haskell plugin. The supplied nix-shell should have all the dependencies installed by default.

git clone [email protected]:kendricktan/ethtxd.git
cd ethtxd
nix-shell
code .
# Alternatively
make repl # For a ghci repl

Upgrading Packages

To upgrade packages, use niv.

rm nix/sources.*

niv init # To update nix pkgs
niv drop nixpkgs
niv drop niv
niv add nixos/nixpkgs
niv add dapptools/dapptools
make build

ethtxd's People

Contributors

kendricktan avatar

Watchers

James Cloos 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.