Coder Social home page Coder Social logo

xbersoy / ethgate Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 157 KB

An ethereum gateway service application for fetching transactions, creating ethereum wallets, creating and broadcasting ethereum blockchain transactions on Goerli Testnet.

JavaScript 98.25% Dockerfile 1.08% Shell 0.67%
ethereum gateway web3 ethereumjs-tx

ethgate's Introduction

Etheretum Gateway

An ethereum gateway service application for fetching transactions, creating ethereum wallets, creating and broadcasting ethereum blockchain transactions on Goerli Testnet.

Installation

  • Clone repository or download it manually

    git clone https://github.com/xbersoy/ethgate
  • Install dependencies

    npm install
  • Start the application

    npm start

    or with nodemon

    npm run watch

    That's all! Application should be running on localhost:3005.

    To run tests

    npm test

Install with docker

docker container run 
  -p <desired_port>:3005 burakersoy/ethgatev1 

Swagger

You can test see and test all endpoints with swagger ui.
http://ec2-3-141-198-45.us-east-2.compute.amazonaws.com:3030/api-docs



AWS

Application has been deployed to aws and the container runs on a ec2 instance. You can use the link below. http://ec2-3-141-198-45.us-east-2.compute.amazonaws.com:3030/


Test Result


More tests can be added

Endpoints

GET /wallet/create

Returns private key and public address of generated wallet.


Sample Response

Success

{
    "success": true,
    "data": {
        "privateKey": "0xecf508229eb793cb1591572bbc8836d4aa96040c9373a66d144265c229859880",
        "address": "0x0d338D4006F70BE9C9fD8a2466C115945a0F402F"
    }
}

POST /transaction/createAndSend

This endpoint creates transaction object with given parameters. Signs and sends tx to the Network (Goerli Testnet)

Request Body

{
    "senderKey": "0xf0612c2b8950ecbf5bb34661dab5c2579c974fdf62422d0a045dc5a19b58c371",
    "address": "0x9D9dcE4cb5B796Dc6E3d00457D276Abe81c8491c",
    "amount": 2
}

Sample Response

Success

{
    "success": true,
    "data": {
        "txHash": "0xf132a9bf86631e692c17b1c2d0dee65631eae8238a3d9b247b01f4cbd5787d1c"
    }
}

GET /transaction/getTransactionsBetweenTwoBlocks

Returns transaction objects between given blocks.

Sample Query Parameters (/transaction/getTransactionsBetweenTwoBlocks?startBlock=4613300&endBlock=4613333)

startBlock=4613300 (required) endBlock=4613333 (optional)

/transaction/getTransactionsBetweenTwoBlocks?startBlock=4613300&endBlock=4613333


Sample Response

Success

{
    "success": true,
    "data": [
        {
            "from": "0x1D4c8636dF248D2c585a56e948E4fF805aC227c5",
            "to": "0x9202584Ac2A5081C6d1F27d637d1DD1Fb2AEc6B7",
            "amount": "0.298223694011240155",
            "token": "ETH",
            "timestamp": 1618337461,
            "blockNumber": 4613300
        },
        {
            "from": "0x7b5956CA58fF0941eFbf89dFE0B56ED8576Cd332",
            "to": "0x9202584Ac2A5081C6d1F27d637d1DD1Fb2AEc6B7",
            "amount": "0.297679132164570337",
            "token": "ETH",
            "timestamp": 1618337461,
            "blockNumber": 4613300
        }]
}

ethgate's People

Contributors

xbersoy avatar

Watchers

 avatar  avatar

Forkers

lambdamonkey

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.