-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrenderContract.js
More file actions
28 lines (23 loc) · 783 Bytes
/
renderContract.js
File metadata and controls
28 lines (23 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const contractAddress = require('./libs/contractAddress');
var Web3 = require('web3');
var web3 = new Web3();
const contractAbi = require('./libs/contractAbi');
const provider = require('./libs/provider');
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
// Set the provider you want from Web3.providers
web3 = new Web3(new Web3.providers.HttpProvider(provider));
}
var contract = web3.eth.contract(contractAbi).at(contractAddress);
function renderContract() {
contract.renderHeader(function(error,data){
console.log("error : " + error + ", data : " + data);
});
}
function setHeader() {
var headerVar = "";
contract.Header(headerVar, (function(error,hash){
console.log("error : " + error + ", hash : " + hash);
});
}