Skip to content

Commit 109d8ad

Browse files
author
Roman Liukshyn
committed
swarmcoin blockchain prototype
1 parent e1d9d04 commit 109d8ad

66 files changed

Lines changed: 23727 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Xavier Decuyper
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<p align="center">
2+
<a href="" rel="noopener">
3+
<img width=450px height=200px src="https://savjee.github.io/savjeecoin-frontend/assets/img/github-project-logo.png" alt="Project logo"></a>
4+
</p>
5+
6+
<h3 align="center">SavjeeCoin Frontend</h3>
7+
8+
<div align="center">
9+
10+
[![Build Status](https://travis-ci.org/Savjee/savjeecoin-frontend.svg?branch=master)](https://travis-ci.org/Savjee/savjeecoin-frontend)
11+
[![GitHub Issues](https://img.shields.io/github/issues/Savjee/savjeecoin-frontend.svg)](https://github.com/Savjee/bearclaw/issues)
12+
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/Savjee/savjeecoin-frontend.svg)](https://github.com/Savjee/bearclaw/pulls)
13+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
14+
15+
</div>
16+
17+
---
18+
19+
20+
Angular application that allows you to interact with a blockchain. You can see the blocks on chain, see transaction within them and even create new transactions and mine blocks.
21+
22+
Built on top of [SavjeeCoin](https://github.com/Savjee/SavjeeCoin) (simply Blockchain implementation in Javascript).
23+
24+
## 👀 Live demo
25+
**[Check it out here.](https://savjee.github.io/savjeecoin-frontend/)** You can create transactions, mine blocks and explore your own blockchain.
26+
27+
## 🏁 Getting Started <a name = "getting_started"></a>
28+
Get a copy of the SavjeeCoin front-end running on your local machine (for playing around, testing or development).
29+
30+
```
31+
git clone https://github.com/Savjee/savjeecoin-frontend.git
32+
```
33+
34+
Install the dependencies:
35+
```
36+
cd savjeecoin-frontend
37+
npm install
38+
```
39+
40+
Run the application:
41+
```
42+
npm start
43+
```
44+
45+
At this point the application should be running on your machine on [http://localhost:4200](http://localhost:4200)
46+
47+
48+
## 📸 Screenshots
49+
50+
**Home page:** Seeing blocks on the chain & exploring transactions in each block.
51+
![](https://savjee.github.io/savjeecoin-frontend/assets/screenshots/blockchain-overview.png)
52+
53+
**Creating new transactions:** You can create new transactions to any wallet for any amount (no validation). New transactions will be added to the "pending transactions", ready to be included in the next block.
54+
![](https://savjee.github.io/savjeecoin-frontend/assets/screenshots/create-new-transactions.png)
55+
56+
**Pending transactinos:** List of all pending transactions. These will be included in the next block when the mining process starts.
57+
![](https://savjee.github.io/savjeecoin-frontend/assets/screenshots/pending-transactions.png)
58+
59+
**Wallet details:** You can click on any wallet address and see an overview of that wallet: its current balance and all transaction to/from that wallet.
60+
![](https://savjee.github.io/savjeecoin-frontend/assets/screenshots/wallet-details.png)
61+
62+
*⚠️This is for educational purposes only. This is by no means a complete blockchain implementation (nor does it aim to be one). Use it to learn how blockchains operate.*

angular.json

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"savjeecoin-frontend": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"styleext": "scss"
14+
}
15+
},
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/savjeecoin-frontend",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "src/tsconfig.app.json",
25+
"assets": [
26+
"src/favicon.ico",
27+
"src/assets"
28+
],
29+
"styles": [
30+
"src/styles.scss"
31+
],
32+
"scripts": []
33+
},
34+
"configurations": {
35+
"production": {
36+
"fileReplacements": [
37+
{
38+
"replace": "src/environments/environment.ts",
39+
"with": "src/environments/environment.prod.ts"
40+
}
41+
],
42+
"optimization": true,
43+
"outputHashing": "all",
44+
"sourceMap": false,
45+
"extractCss": true,
46+
"namedChunks": false,
47+
"aot": true,
48+
"extractLicenses": true,
49+
"vendorChunk": false,
50+
"buildOptimizer": true,
51+
"budgets": [
52+
{
53+
"type": "initial",
54+
"maximumWarning": "2mb",
55+
"maximumError": "5mb"
56+
}
57+
]
58+
}
59+
}
60+
},
61+
"serve": {
62+
"builder": "@angular-devkit/build-angular:dev-server",
63+
"options": {
64+
"browserTarget": "savjeecoin-frontend:build"
65+
},
66+
"configurations": {
67+
"production": {
68+
"browserTarget": "savjeecoin-frontend:build:production"
69+
}
70+
}
71+
},
72+
"extract-i18n": {
73+
"builder": "@angular-devkit/build-angular:extract-i18n",
74+
"options": {
75+
"browserTarget": "savjeecoin-frontend:build"
76+
}
77+
},
78+
"test": {
79+
"builder": "@angular-devkit/build-angular:karma",
80+
"options": {
81+
"main": "src/test.ts",
82+
"polyfills": "src/polyfills.ts",
83+
"tsConfig": "src/tsconfig.spec.json",
84+
"karmaConfig": "src/karma.conf.js",
85+
"styles": [
86+
"src/styles.scss"
87+
],
88+
"scripts": [],
89+
"assets": [
90+
"src/favicon.ico",
91+
"src/assets"
92+
]
93+
}
94+
},
95+
"lint": {
96+
"builder": "@angular-devkit/build-angular:tslint",
97+
"options": {
98+
"tsConfig": [
99+
"src/tsconfig.app.json",
100+
"src/tsconfig.spec.json"
101+
],
102+
"exclude": [
103+
"**/node_modules/**"
104+
]
105+
}
106+
}
107+
}
108+
},
109+
"savjeecoin-frontend-e2e": {
110+
"root": "e2e/",
111+
"projectType": "application",
112+
"prefix": "",
113+
"architect": {
114+
"e2e": {
115+
"builder": "@angular-devkit/build-angular:protractor",
116+
"options": {
117+
"protractorConfig": "e2e/protractor.conf.js",
118+
"devServerTarget": "savjeecoin-frontend:serve"
119+
},
120+
"configurations": {
121+
"production": {
122+
"devServerTarget": "savjeecoin-frontend:serve:production"
123+
}
124+
}
125+
},
126+
"lint": {
127+
"builder": "@angular-devkit/build-angular:tslint",
128+
"options": {
129+
"tsConfig": "e2e/tsconfig.e2e.json",
130+
"exclude": [
131+
"**/node_modules/**"
132+
]
133+
}
134+
}
135+
}
136+
}
137+
},
138+
"defaultProject": "savjeecoin-frontend"
139+
}

e2e/protractor.conf.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Protractor configuration file, see link for more information
2+
// https://github.com/angular/protractor/blob/master/lib/config.ts
3+
4+
const { SpecReporter } = require('jasmine-spec-reporter');
5+
6+
exports.config = {
7+
allScriptsTimeout: 11000,
8+
specs: [
9+
'./src/**/*.e2e-spec.ts'
10+
],
11+
capabilities: {
12+
'browserName': 'chrome'
13+
},
14+
directConnect: true,
15+
baseUrl: 'http://localhost:4200/',
16+
framework: 'jasmine',
17+
jasmineNodeOpts: {
18+
showColors: true,
19+
defaultTimeoutInterval: 30000,
20+
print: function() {}
21+
},
22+
onPrepare() {
23+
require('ts-node').register({
24+
project: require('path').join(__dirname, './tsconfig.e2e.json')
25+
});
26+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27+
}
28+
};

e2e/src/app.e2e-spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { AppPage } from './app.po';
2+
3+
describe('workspace-project App', () => {
4+
let page: AppPage;
5+
6+
beforeEach(() => {
7+
page = new AppPage();
8+
});
9+
10+
it('should display welcome message', () => {
11+
page.navigateTo();
12+
expect(page.getTitleText()).toEqual('Welcome to savjeecoin-frontend!');
13+
});
14+
});

e2e/src/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get('/');
6+
}
7+
8+
getTitleText() {
9+
return element(by.css('app-root h1')).getText();
10+
}
11+
}

e2e/tsconfig.e2e.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/app",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}

0 commit comments

Comments
 (0)