Coder Social home page Coder Social logo

geth-wrapper's Introduction

Geth-wrapper

Go application that provides access to the Ethereum transaction system using the Geth node (go-ethereum).

The application uses the PostgresSQL database, which stores the following data:

  • Information on existing wallets on Geth node with the current balance.
  • Information on all withdrawal transactions with information about the purse from which the transfer was made.
  • Information about all transactions related to wallets on a Geth node, with the actual number of confirmations.

Geth

Method unlockAccount not implemented. Tested with the following settings Geth.

geth --rinkeby --gcmode=archive --rpc --rpcapi "eth,net,personal" --unlock 0xd1dffc3c0537d46cd65b10019d4216f9dcd7e114

Database preparation

psql -U postgres -f $GOPATH/src/github.com/dzeckelev/geth-wrapper/data/prepare.sql
psql -U postgres -d unionbase -f $GOPATH/src/github.com/dzeckelev/geth-wrapper/data/migrate.sql

Build

Dependencies are already in the repository.

cd $GOPATH/src/github.com/dzeckelev
git clone https://github.com/dzeckelev/geth-wrapper.git
cd geth-wrapper
go get -u -v gopkg.in/reform.v1/reform
go generate ./...
go install

Run

geth-wrapper -config config.json

API methods

Get Last Transactions

Returns information about the latest receipts for wallets. The latter are considered receipts that have not yet been requested by this method, or have <3 confirmation at the time of a request.

Arguments:

  • Limit: limits the number of transactions in a response.

Example:

curl -X POST -H "Content-Type: application/json" --data '{"method": "api_getLast", "params": [100], "id": 100}' http://localhost:8081/http

SendETH

Sends ETH from one of a unlocked wallet to the specified address.

Arguments:

  • From: sender address.
  • To: recipient address.
  • Amount: The amount of Wei sent with this transaction. (1 ETH = 10^18 Wei)
curl -X POST -H "Content-Type: application/json" --data '{"method": "api_sendETH", "params": ["0xd1dffc3c0537d46cd65b10019d4216f9dcd7e114", "0xd6d39cd7672841789dc3afb97525984b6d31f796", "1000000000000"], "id": 100}' http://localhost:8081/http

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.