Created
June 30, 2018 09:16
-
-
Save huhn511/a34162559ce802f7a0f9a0899c0ae4cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import SendButton from './components/SendButton' | |
import IOTA from 'iota.lib.js' | |
class App extends Component { | |
constructor(props) { | |
super(props) | |
// Create IOTA instance directly with provider | |
var iota = new IOTA({ | |
'provider': 'https://nodes.devnet.thetangle.org:443' | |
}); | |
console.log("iota", iota) | |
this.state = {iota: iota} | |
iota.api.getNodeInfo(function(error, success) { | |
if (error) { | |
console.error(error); | |
} else { | |
console.log(success); | |
} | |
}); | |
} | |
render() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<h1 className="App-title">Welcome to React</h1> | |
</header> | |
<SendButton iota={this.state.iota}/> | |
</div> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment