Git Product home page Git Product logo

javascript-iota-workshop's Introduction

IOTA Workshop

Simple examples to help a developer work through interacting with the IOTA network and the iota.js library.

⚠️ Attention ⚠️

The workshops currently uses the iota.js library with the chrysalis branch. This is an experimental library for the testing phase.

You should use the higher level node bindings in the future. The higher level node bindings will be much more abstract and easier to work with.

Getting started

To start playing with these examples run the following commands in your terminal:

git clone https://github.com/iota-community/iota-workshop.git
cd iota-workshop
npm install # or yarn install
node code/1-hello-world.js

You should receive a message including the statistics of an IOTA node. This means you can explore and run the other examples.

Examples included

Here are the examples included:

  • 1-hello-world
  • 2-send-hello
  • 3-fetch-hello
  • 4-create-address
  • 5-check-balance
  • 6-send-tokens
  • 7-mqtt-client

Contribution

PRs are welcome on main


🍻 Lewi

javascript-iota-workshop's People

Contributors

7h7 avatar dependabot[bot] avatar fijter avatar huhn511 avatar l3wi avatar nelsonpython avatar stowoxla avatar thoralf-m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javascript-iota-workshop's Issues

Issue with 7.2-mam-public-fetch.js

Got the below error message while running the 7.2-mam-public-fetch.js

thread '' panicked at 'called Option::unwrap() on a None value', libcore/option.rs:335:21
note: Run with RUST_BACKTRACE=1 for a backtrace.
failed to parse: 5273152

I want to contribute but I don't have permissions

error:

Pushing to https://github.com/iota-community/iota-workshop.git
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/iota-community/iota-workshop.git/'

1-hello-world.js works only with testnet

Running 1-hello-world on the test net works fine but I get the following error when working on the main net.
{ FetchError: request to https://node.tangle.works:443/ failed, reason: read ECONNRESET
at ClientRequest. (/home/pi/iota/iota-workshop/node_modules/node-fetch/lib/index.js:1393:11)
at ClientRequest.emit (events.js:182:13)
at TLSSocket.socketErrorListener (_http_client.js:382:9)
at TLSSocket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
message:
'request to https://node.tangle.works:443/ failed, reason: read ECONNRESET',
type: 'system',
errno: 'ECONNRESET',
code: 'ECONNRESET' }

The following show the nodes I have tried.
Am I doing something wrong?
Thanks

///////////////////////////////
// Environment Check
///////////////////////////////

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

const iota = iotaLibrary.composeAPI({
//provider: 'https://nodes.devnet.thetangle.org:443'
//provider: 'https://node.tangle.works:443'
//provider: 'https://n1.iota.nu:443'
provider: 'https://iota.thathost.net:443'
})

iota
.getNodeInfo()
.then(response => console.log(response))
.catch(err => {
console.error(err)
})

1-hello-world.js connect ECONNREFUSED

When I launch the 1-hello-world.js I get this following error. Should I have to set something before in order to make it work?

FetchError: request to https://api.lb-0.testnet.chrysalis2.com/api/v1/info failed, reason: connect ECONNREFUSED 168.119.63.84:443
at ClientRequest. (/Users/mattia/iota-workshop/node_modules/@iota/iota.js/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:481:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED'
}

Error: Invalid trytes length. Expected trytes of even length.. fetching data example 5-2

Hey I just run the program 5.1 to send data and it work correctly then 5.2 to fetch data. But it gave me this error

Error: Invalid trytes length. Expected trytes of even length.
    at Object.exports.trytesToAscii (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/node_modules/@iota/converter/out/converter/src/ascii.js:76:15)
    at iota.findTransactionObjects.then.response (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/code/5.2-fetch-data.js:27:28)
    at tryCatcher (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/node_modules/bluebird/js/release/promise.js:517:31)
    at Promise._settlePromise (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/node_modules/bluebird/js/release/promise.js:574:18)
    at Promise._settlePromise0 (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/node_modules/bluebird/js/release/promise.js:619:10)
    at Promise._settlePromises (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/node_modules/bluebird/js/release/promise.js:699:18)
    at _drainQueueStep (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/yehia/Documents/Projects/IOTA/javascript-iota-workshop/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

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.