forked from zmitton/eth-proof
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
executable file
·33 lines (27 loc) · 798 Bytes
/
cli.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
#! /usr/bin/env node
var Web3 = require('web3');
var EP = require('./index')
// var chainDataPath = '/Users/zacharymitton/Library/Ethereum/geth/chaindata'
// var recentBlockHash = 'c7b427ed2e0fcc24474437e676625186abefb4328d0807c2c36edb78c2d54082'
var eP = new EP(
new Web3.providers.HttpProvider("https://gmainnet.infura.io"),
// recentBlockHash,
// chainDataPath
)
var userArgs = process.argv.slice(2);
var command = userArgs[0];
console.log('COMMAND', command);
switch(command){
case "getTransactionProof":
var txHash = userArgs[1]
eP.getTransactionProof(txHash).then((result)=>{
console.log(result)
})
break;
case "getReceiptProof":
var txHash = userArgs[1]
eP.getReceiptProof(txHash).then((result)=>{
console.log(result)
})
break;
}