forked from AugurProject/augur.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv.js
34 lines (32 loc) · 1.32 KB
/
env.js
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
29
30
31
32
33
34
#!/usr/bin/env node
global.chalk = require("chalk");
global.constants = require("./src/constants");
global.Augur = require("./src");
(global.reload = function () {
global.branch = constants.DEFAULT_BRANCH_ID;
global.augur = new Augur();
augur.rpc.setDebugOptions({ connect: true, broadcast: false });
augur.connect({
http: "http://127.0.0.1:8545",
ws: "ws://127.0.0.1:8546"
}, function (vitals) {
global.rpc = vitals.rpc;
console.log(chalk.cyan("Network"), chalk.green(rpc.getNetworkID()));
var account = augur.rpc.getCoinbase();
// augur.api.Cash.balanceOf({ address: account }, function (err, cashBalance) {
// augur.api.Reporting.getRepBalance({ branch: global.branch, address: account }, function (err, repBalance) {
// augur.rpc.eth.getBalance([account, "latest"], function (ethBalance) {
// global.balances = {
// cash: cashBalance,
// reputation: repBalance,
// ether: speedomatic.unfix(ethBalance, "string")
// };
// console.log(chalk.cyan("Balances:"));
// console.log("Cash: " + chalk.green(balances.cash));
// console.log("Reputation: " + chalk.green(balances.reputation));
// console.log("Ether: " + chalk.green(balances.ether));
// });
// });
// });
});
})();