Skip to content
Launch a private test tangle including compass with a single command
Branch: master
Clone or download
Pull request Compare This branch is 24 commits ahead of fijter:master.
fijter Merge pull request #6 from mtrabelsi/master
Allow IRI nodes to have all operation available
Latest commit 0e5b73a May 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
layers initial commit Apr 23, 2019
LICENSE Create LICENSE May 22, 2019
README.md Update README.md May 21, 2019
cli.gif Add files via upload May 21, 2019
docker-compose.yml Allow IRI nodes to have all operation available May 24, 2019
light-wallet-node-configuration.png Add files via upload May 21, 2019
light-wallet-test-tangle.png
snapshot.txt initial commit Apr 23, 2019

README.md

One-command private test Tangle

This application allows you to set up your own IOTA network by using a single Docker command. When you run this command, you'll have your own IOTA test network and 2.7Pi (the maximum amount) of test IOTA tokens to use. These tokens will be stored on the first address of this seed: SEED99999999999999999999999999999999999999999999999999999999999999999999999999999.

IOTA wallet for the test network

You can use this network to test your ideas and applications without risking any monetary value.

The test network consists of one IRI node and an instance of a Compass. The IRI node receives transactions, validates them, and keeps an up-to-date record of users' balances. At regular intervals, Compass sends the IRI node zero-value transactions called milestones that reference other transactions. Any transaction that's referenced by a milestone is considered confirmed. At this point, the node updates any balances that were affected by the confirmed transaction.

Compass uses a pre-built Merkle tree (in the layers directory) with a depth of 20. This Merkle tree is large enough for Compass to send milestones for over a year at 30-second intervals.

Warning: The purpose of this application is to allow you to quickly set up a test IOTA network. To do so, this application uses a pre-calculated Merkle tree. As a result, you should use this application only for testing. Do not expose this network to the Internet!

Dependencies

Docker and Docker Compose.

1. Run the application

You need at least 4GB RAM to run this application.

  1. Clone this repository
  2. In the one-command-tangle directory, execute the docker-compose up command. If you're using a Linux operating system, you may need to add sudo before this command.

In the console, you should see that the IRI node is running and receiving milestones from Compass.

Compass and IRI node logs

Note: If you want to stop Compass and start it again, press Ctrl + C, and remove the -bootstrap flag from the docker-compose.yml file before running the command again.

2. Interact with the network

When the application is running, you can interact with the network through the IRI node's API port at the following address http://localhost:14265.

For a list of API endpoints see the IOTA documentation.

GetBalances

For example, using the JavaScript client library with Node.js, you can call the getBalances endpoint to get the total balance of the SEED99999999999999999999999999999999999999999999999999999999999999999999999999999 seed. If you've never used the IOTA client libraries before, we recommend completing this tutorial.

var request = require('request');

const iota = require('@iota/core');

Iota = iota.composeAPI({
    provider: 'http://localhost:14265'
});

var address = iota.generateAddress('SEED99999999999999999999999999999999999999999999999999999999999999999999999999999',0);

getBalance(address);

function getBalance(address) {

    var command = {
    'command': 'getBalances',
    'addresses': [
    address
    ],
    'threshold':100
    }

    var options = {
    url: 'http://localhost:14265',
    method: 'POST',
    headers: {
    'Content-Type': 'application/json',
    'X-IOTA-API-Version': '1',
    'Content-Length': Buffer.byteLength(JSON.stringify(command))
    },
    json: command
    };

    request(options, function (error, response, data) {
        if (!error && response.statusCode == 200) {
        console.log(JSON.stringify(data,null,1));
        }
    });
}

Response

{
"balances": [
 "2779530283277761"
],
"references": [
 "BDZPAONKWQTVCXFFO9GBTJ9GGWPRLITXZ9BMYALTCVWNOLFYPNHFJHPDWICRPGCZWUNDQHV9UDEXGW999"
],
"milestoneIndex": 7,
"duration": 1
}

If you want to send and receive transactions on the network through a user interface, you can configure the IOTA Light Wallet to connect to your node at http://localhost:14265 and log in with your seed: SEED99999999999999999999999999999999999999999999999999999999999999999999999999999.

To connect to your node, go to Tools > Edit Node Configuration, and enter the URL of your node (http://localhost:14265).

IOTA wallet configuration

Note: When you first log into the IOTA Light Wallet, go to RECEIVE > ATTACH TO TANGLE to see your full balance.

Outstanding tasks

  • Run a private tangle with a single docker-compose up command
  • Implement a way to prevent having to manually remove the -bootstrap flag after re-launch
  • Use the latest Docker image of Compass instead of a fixed release
  • Optional: build a nice wrapper around it with Docker/Docker-Compose included for even easier setup
  • Optional: include additional tools like a tangle explorer/visualizer/monitor
You can’t perform that action at this time.