GithubHelp home page GithubHelp logo

aureus-trading / tn-eth-gateway Goto Github PK

View Code? Open in Web Editor NEW

This project forked from turtlenetwork/tn-eth-gateway

0.0 1.0 0.0 1.35 MB

TurtleNetwork / Ethereum(-based) gateway

License: MIT License

Python 72.67% JavaScript 2.12% CSS 6.56% HTML 18.65%

tn-eth-gateway's Introduction

TN <-> ETH Platform Gateway Framework

Inspired by Hawky's Waves-ERC20 Gateway: https://github.com/PyWaves/Waves-ERC20-Gateway But rewritten to be published under FOSS license.

This framework allows to easily establish a gateway between any ETH chain and the TN Platform.

Installation

Clone this repository and edit the config.json file according to your needs. Install the following dependencies:

pycwaves
fastapi[all]
jinja2
aiofiles

via pip and run the gateway by

python start.py

Configuration of the config file

The config.json file includes all necessary settings that need to be connfigured in order to run a proper gateway:

{
    "main": {
        "port": <portnumber to run the webinterface on>,
        "name": "Tokenname",
        "company": "Gateways Ltd",
        "contact-email": "[email protected]",
        "contact-telegram": "https://t.me/TurtleNetwork",
        "recovery_amount": <minimum recovery amount>,
        "recovery_fee": <recovery fee in %>,
        "admin-username": "admin",
        "admin-password": "admin",
        "disclaimer": "link to disclaimer file",
        "min": <minimum amount>,
        "max": <maximum amount>
    },
    "erc20": {
        "node": "<the eth node you want to connect to>",
        "chainid": <chainid of the ETH chain this is>,
        "gatewayAddress": "<Waves address of the gateway>",
        "decimals": <number of decimals of the token>,
        "privateKey": "<privatekey of the above devined address>",
        "seedenvname" : "<the ENV name to store your private key instead of the field above>",
        "fee": <the total fee you want to collect on the gateway, calculated in the proxy token, e.g., 0.1>,
        "gateway_fee": <the gatewway part of the fee calculated in the proxy token, e.g., 0.1>,
        "network_fee": <the tx part of the fee calculated in the proxy token, e.g., 0.1>,
        "gas": <the amount of gas used for each transaction on the ETH network>,
        "gasprice" : <the gasprice in gwei or set to 0 for automatic gasprice determination>,
        "timeInBetweenChecks": <seconds in between a check for a new block>,
        "confirmations": <number of confirmations necessary in order to accept a transaction>
    },
    "tn": {
        "gatewayAddress": "<TN address of the gateway>",
        "gatewaySeed": "<seed of the above devined address>",
        "seedenvname": "<the ENV name to store your seed instead of the field above>",
        "fee": <the fee you want to collect on the gateway, calculated in the proxy token, e.g., 0.1>,
        "gateway_fee": <the gatewway part of the fee calculated in the proxy token, e.g., 0.1>,
        "network_fee": <the tx part of the fee calculated in the proxy token, e.g., 0.1>,
        "assetId": "<the asset id of the proxy token on the TN platform>",
        "decimals": <number of decimals of the token>,
        "network": "<Waves network you want to connect to (testnet|mainnet)>",
        "node": "<the TN node you want to connect to>",
        "timeInBetweenChecks": <seconds in between a check for a new block>,
        "confirmations": <number of confirmations necessary in order to accept a transaction>
    }
}

Running the gateway

After starting the gateway, it will provide a webpage on the port set in config.json.

Usage of the gateway

This is a simple gateway for TN tokens to the ETH Platform and vice versa. For sending tokens from the Etherium Platform to the TN blockchain, fill in your source ETH wallet address and the receiving Turtle Network wallet to create a tunnel. Then send the tokens to the Ethereum address of the gateway.

For sending tokens from the TN Platform to the Etherium blockchain, just add the Etherium address that should receive the tokens as the description of the transfer and send the tokens to the TN address of the gateway.

Management interface

After starting the gateway, there are also a couple of management interfaces which are secured by the admin-username and admin-password fields in the config.json:

    /errors: This will show an overview of detected errors during processing of blocks or transferring funds
    /executed: This will show an overview of executed transactions through the gateway

Disclaimer

USE THIS FRAMEWORK AT YOUR OWN RISK!!! FULL RESPONSIBILITY FOR THE SECURITY AND RELIABILITY OF THE FUNDS TRANSFERRED IS WITH THE OWNER OF THE GATEWAY!!!

tn-eth-gateway's People

Contributors

iammortimer avatar blackturtle123 avatar

Watchers

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