-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
20 lines (12 loc) · 650 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const {Blockchain, Transaction} = require("./blockchain") ;
const EC = require("elliptic").ec ;
const ec = new EC("secp256k1");
const myKey = ec.keyFromPrivate("d8f51526397e0185c9b614aed2f166803fb2fcbe867d76ae05ae28e683fd7e8d")
const myWalletAddress = myKey.getPublic("hex");
const shreyCoin = new Blockchain();
const tx1= new Transaction(myWalletAddress,'public key goes here',10);
tx1.signTransaction(myKey);
shreyCoin.addTransaction(tx1);
console.log("\n starting miner");
shreyCoin.minePendingTransactions(myWalletAddress);
console.log("\n balance of aarya is ", shreyCoin.getBalanceOfAddress(myWalletAddress));