Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
BroProgramerWeb3 committed Dec 29, 2023
1 parent c8aecd2 commit 85bb70e
Show file tree
Hide file tree
Showing 19 changed files with 276 additions and 26 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added client/.DS_Store
Binary file not shown.
79 changes: 69 additions & 10 deletions client/dist/index.764980e3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/index.764980e3.js.map

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions client/dist/index.7f1e2dce.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/dist/index.7f1e2dce.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion client/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head><link rel="stylesheet" href="/index.7f1e2dce.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300&display=swap" rel="stylesheet">
</head>
<body>
<div id="root"></div>
Expand Down
Binary file added client/dist/logo.470e437a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/.DS_Store
Binary file not shown.
Binary file added client/src/asset/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions client/src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Component } from "react";
import Blocks from './Blocks';
import logo from '../asset/logo.png'

class App extends Component {
state = { walletInfo: {}};
Expand All @@ -15,9 +16,12 @@ class App extends Component {
const { address, balance } = this.state.walletInfo;
return (
<div>
<img className='logo' src={logo}></img>
<br />
<div>
Welcome to the blockchain...
</div>
<br />
<div>Address: {address}</div>
<div>Balance: {balance}</div>
<br />
Expand Down
13 changes: 13 additions & 0 deletions client/src/components/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
body {
background-color: #4444;
color: #fff;
text-align: center;
font-size: 20px;
font-family: 'Quicksand';
padding-top: 5%;
}

.logo {
width: 250px;
height: 250px;
}
5 changes: 5 additions & 0 deletions client/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300&display=swap" rel="stylesheet">
</head>
<body>
<div id="root"></div>
Expand Down
1 change: 1 addition & 0 deletions client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './components/App';
import './components/index.css';

// Using createRoot to create a root for rendering, passing the target root element
const root = createRoot(document.getElementById('root'));
Expand Down
39 changes: 39 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,45 @@ const syncWithRootState = () => {
});
};

const walletFoo = new Wallet();
const walletBar = new Wallet();

const generateWalletTransaction = ({ wallet, recipient, amount }) => {
const transaction = wallet.createTransaction({
recipient, amount, chain: blockchain.chain
});

transactionPool.setTransaction(transaction);
};

const walletAction = () => generateWalletTransaction({
wallet, recipient: walletFoo.publicKey, amount: 5
});

const walletFooAction = () => generateWalletTransaction({
wallet: walletFoo, recipient: walletBar.publicKey, amount: 10
});

const walletBarAction = () => generateWalletTransaction({
wallet: walletBar, recipient: wallet.publicKey, amount: 15
});

for (let i=0; i<10; i++) {
if (i%3 === 0) {
walletAction();
walletFooAction();
} else if (i%3 === 1) {
walletAction();
walletBarAction();
} else {
walletFooAction();
walletBarAction();
}

transactionMiner.mineTransactions();
}


let PEER_PORT;

if (process.env.GENERATE_PEER_PORT === 'true') {
Expand Down
Loading

0 comments on commit 85bb70e

Please sign in to comment.