Giter VIP home page Giter VIP 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 a public node in the tangle network, but intercepts the attachToTangle command and performs the PoW locally.

Developers getting to know iota.lib.js in Node.js may 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 is a request to perform the PoW that is necessary when doing a transaction.

Most public full nodes in the IOTA network do not support the attachToTangle command.
By design it is expected that you do the PoW locally on your device, the network is not required to do this for you.

If you're looking an easy way to do PoW, then this proxy server might help.
Use this proxy server when you want to offload PoW.

Feel free to edit or fork!

If this does proxy server is not what you are looking for, then you can look at some of the methods provided by the IOTA foundation in their repository.
Some examples of solutions provided by the IOTA foundation:


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 --harmony 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
});

iotaproxy's People

Contributors

capaj avatar cyclux avatar timsamshuijzen avatar

Watchers

 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.