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