core init deployment
This commit is contained in:
parent
c0c2038e6c
commit
65fc561b17
|
@ -2,7 +2,7 @@
|
|||
"name": "oracles-dapps-validators",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"homepage": "https://rstormsf.github.io/oracles-dapps-validators",
|
||||
"homepage": "https://oraclesorg.github.io/poa-dapps-validators",
|
||||
"dependencies": {
|
||||
"clipboard": "^1.7.1",
|
||||
"gh-pages": "^1.1.0",
|
||||
|
@ -22,7 +22,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"predeploy": "npm run build",
|
||||
"deploy": "gh-pages -d build -o rstorm",
|
||||
"deploy": "gh-pages -d build -o origin",
|
||||
"build-css": "node-sass-chokidar src/index/index.scss -o src/index",
|
||||
"watch-css": "npm run build-css && node-sass-chokidar src/index/index.scss -o src/index --watch --recursive",
|
||||
"start-js": "react-scripts start",
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import KeysManagerAbi from './keysManager.abi.json'
|
||||
import Web3 from 'web3';
|
||||
import {KEYS_MANAGER_ADDRESS} from './addresses';
|
||||
|
||||
console.log('Keys Manager', KEYS_MANAGER_ADDRESS);
|
||||
|
||||
const KEYS_MANAGER_ADDRESS = '0xfc90125492e58dbfe80c0bfb6a2a759c4f703ca8';
|
||||
export default class KeysManager {
|
||||
constructor(){
|
||||
if(window.web3.currentProvider){
|
||||
|
|
|
@ -2,6 +2,7 @@ import PoaConsensus from './PoaConsensus.contract'
|
|||
import MetadataAbi from './metadata.abi.json'
|
||||
import Web3 from 'web3';
|
||||
import moment from 'moment';
|
||||
import {METADATA_ADDRESS} from './addresses';
|
||||
var toAscii = function(hex) {
|
||||
var str = '',
|
||||
i = 0,
|
||||
|
@ -17,7 +18,7 @@ var toAscii = function(hex) {
|
|||
return str;
|
||||
};
|
||||
|
||||
const METADATA_ADDRESS = '0xa1b344ee240564f61117f2dbf999547ad4b871ed';
|
||||
console.log('Metadata contract:', METADATA_ADDRESS)
|
||||
export default class Metadata {
|
||||
constructor(){
|
||||
if(window.web3.currentProvider){
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import poaConsensusAbi from './poaConsensus.abi.json'
|
||||
import Web3 from 'web3';
|
||||
import {POA_ADDRESS} from './addresses';
|
||||
|
||||
const KEYS_MANAGER_ADDRESS = '0x8bf38d4764929064f2d4d3a56520a76ab3df415b';
|
||||
console.log('POA Address ' , POA_ADDRESS)
|
||||
export default class POAConsensus {
|
||||
constructor(){
|
||||
if(window.web3.currentProvider){
|
||||
let web3_10 = new Web3(window.web3.currentProvider);
|
||||
this.poaInstance = new web3_10.eth.Contract(poaConsensusAbi, KEYS_MANAGER_ADDRESS);
|
||||
this.poaInstance = new web3_10.eth.Contract(poaConsensusAbi, POA_ADDRESS);
|
||||
}
|
||||
}
|
||||
async getValidators(){
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
METADATA_ADDRESS: '0xa1b344ee240564f61117f2dbf999547ad4b871ed',
|
||||
KEYS_MANAGER_ADDRESS: '0xfc90125492e58dbfe80c0bfb6a2a759c4f703ca8',
|
||||
POA_ADDRESS: '0x8bf38d4764929064f2d4d3a56520a76ab3df415b'
|
||||
}
|
|
@ -16,17 +16,22 @@ let getWeb3 = () => {
|
|||
web3 = new window.Web3(web3.currentProvider)
|
||||
web3.version.getNetwork((err, netId) => {
|
||||
let netIdName;
|
||||
console.log('netId', netId);
|
||||
switch (netId) {
|
||||
case "12648430":
|
||||
netIdName = 'Oracles'
|
||||
console.log('This is oracles')
|
||||
case "99":
|
||||
netIdName = 'Core'
|
||||
console.log('This is Core', netId)
|
||||
break;
|
||||
case "77":
|
||||
netIdName = 'Sokol'
|
||||
console.log('This is Sokol', netId)
|
||||
break;
|
||||
default:
|
||||
netIdName = 'ERROR'
|
||||
errorMsg = `You aren't connected to POA Network.
|
||||
Please, switch on POA plugin and refresh the page.
|
||||
Check POA Network <a href='https://github.com/oraclesorg/oracles-wiki' target='blank'>wiki</a> for more info.`
|
||||
console.log('This is an unknown network.')
|
||||
console.log('This is an unknown network.', netId)
|
||||
}
|
||||
var defaultAccount = web3.eth.defaultAccount || null;
|
||||
if(defaultAccount === null){
|
||||
|
|
|
@ -30,7 +30,7 @@ function generateElement(msg){
|
|||
class AppMainRouter extends Component {
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.rootPath = '/oracles-dapps-validators'
|
||||
this.rootPath = '/poa-dapps-validators'
|
||||
history.listen(this.onRouteChange.bind(this));
|
||||
this.onSetRender = this.onSetRender.bind(this);
|
||||
this.onPendingChangesRender = this.onPendingChangesRender.bind(this);
|
||||
|
@ -134,7 +134,7 @@ class AppMainRouter extends Component {
|
|||
this.setState({searchTerm: term.target.value.toLowerCase()})
|
||||
}
|
||||
render(){
|
||||
console.log('v2.03')
|
||||
console.log('v2.04')
|
||||
const search = this.state.showSearch ? <input type="search" className="search-input" onChange={this.onSearch}/> : ''
|
||||
const loading = this.state.loading ? <Loading /> : ''
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue