Giter Club home page Giter Club logo

iotaproxy's Introduction

IOTA Proxy

A simple proxy server for the IOTA tangle network, supporting the attachToTangle command (PoW). This light weight server will proxy/relay all incoming requests to public nodes in the tangle network, but intercepts the attachToTangle commands and performs the PoW locally.

Many developers getting to know iota.lib.js in Node, will have experienced the "COMMAND attachToTangle is not available on this node" response after calling iota.api.sendTransfer(). Some others may have experienced the same error message when calling the REST API attachToTangle command. The attachToTangle command performs the PoW that is necessary when doing a transaction.

Most public full nodes in the IOTA network do not support the attachToTangle command. It is expected that you do the PoW locally on your device, the network is not required to do this for you. The most common solution is to install and run your own full IOTA node, configured to grant you access to the attachToTangle command. Alternatively, the IOTA foundation have provided several other solutions for doing PoW locally in their repository. For example, there is a solution to do PoW in WebGL2-enabled browsers. There is also a solution to do it in Node.js, but requires you to combines solutions from ccurl.interface.js and ccurl, and requires you to override the iota.api.attachToTangle method in iota.lib.js.

The purpose of this proxy server is to help you get a quick start with performing transactions using iota.lib.js in Node.js, without having to install a full node or having to figure out how to do the PoW in your project. Another use for this proxy server is when you want to offload PoW from low power devices or machines that need to send transactions to the IOTA tangle.


This repository contains code and precompiled libraries from iotaledger/wallet.
Licence: GNU General Public License v3.0


Prerequisites

Download and install Node.js

Instructions

  1. Clone this repository:
git clone https://github.com/TimSamshuijzen/iotaproxy
  1. Enter the "iotaproxy" directory:
cd iotaproxy
  1. Install dependencies:
npm install
  1. Edit index.js to set preferred connection settings. For example:
var iotaProxy = require('./lib/iotaproxy.js');
iotaProxy.start(
  {
    host: 'http://iota.bitfinex.com', 
    port: 80, 
    localPort: 14265,
    overrideAttachToTangle: true
  }
);
  1. Run the proxy server:
node index.js
  1. Proxy server is now ready to use. It will start off displaying this in the console:
IOTA proxy server started
Listing on port 14265
Relaying requests to iota.bitfinex.com:80  
  1. Now, in your iota.lib.js project you can simply connect to this local proxy server, which in turn connects with the tangle:
var IOTA = require('iota.lib.js');

var iota = new IOTA({
  'host': 'http://localhost',
  'port': 14265
});

Donate
FGKKWEDSCIVCU9PZJXYBIWKCEFWLMRXSFKYMTBXFDCTUDV9SVKTNKUFNYCZUQEVDMBL9PPFRYUPFDNGY9DIIAIHKKA

iotaproxy's People

Contributors

timsamshuijzen avatar

Watchers

James Cloos avatar Jiri Spac 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.