Commit 4efff746 authored by Clint Mourlevat's avatar Clint Mourlevat

Creating Generator (bug with stratis network)

parent 1d3c4232
......@@ -8,9 +8,9 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using NBitcoin;
using QRCoder;
using UnityEngine;
using Color = System.Drawing.Color;
using Stratis.Bitcoin.Networks;
namespace Stratis.Guru.Controllers
{
......@@ -36,7 +36,12 @@ namespace Stratis.Guru.Controllers
[Route("generator")]
public IActionResult Generator()
{
return View();
var stratisAddress = new Key();
return View(new StratisAddressPayload
{
PrivateKey = stratisAddress.GetWif(Stratis.Bitcoin.Networks.StratisMain.Main).ToString(),
PublicKey = stratisAddress.PubKey.GetAddress(Stratis.Bitcoin.Networks.StratisMain.Main).ToString()
});
}
[Route("qr/{value}")]
......@@ -50,4 +55,10 @@ namespace Stratis.Guru.Controllers
return File(memoryStream.ToArray(), "image/png");
}
}
public class StratisAddressPayload
{
public string PrivateKey { get; set; }
public string PublicKey { get; set; }
}
}
\ No newline at end of file
......@@ -7,8 +7,12 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
<PackageReference Include="NBitcoin" Version="4.1.1.54" />
<PackageReference Include="NStratis" Version="4.0.0.66" />
<PackageReference Include="QRCoder" Version="1.3.3" />
<PackageReference Include="RestSharp" Version="106.5.4" />
<PackageReference Include="Stratis.Bitcoin" Version="1.0.0" />
<PackageReference Include="Stratis.Bitcoin.Networks" Version="1.2.2-beta" />
</ItemGroup>
</Project>
......@@ -7,7 +7,7 @@
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pb-4 align-self-center text-center">
<h1><i class="fa fa-envelope-o"></i> Contact Me</h1>
<p>If you need to contact me, don't hesitate to send me a mail at clint.mourlevat@gmail.com</p>
<p>If you need to contact me, don't hesitate to send me a mail at <a href="mailto:stratis-guru@volto.io">stratis-guru@volto.io</a>.</p>
</div>
</div>
</div>
......
@model Stratis.Guru.Controllers.StratisAddressPayload
@{
ViewBag.Title = "Stratis Address Generator";
Layout = "_Layout";
}
<section class="welcome-area" id="welcome-1">
<div class="header-token">
<div class="header-token mt-3">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12 align-self-center text-center">
<h1>ARDA Decentralized Blockchain Platform</h1>
<p>Arda makes it easy creation and deployment of decentralized applications, that can be downloaded by end-users from the application store.</p>
<a href="#" class="btn-secondary-box">Download Whitepaper</a>
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12 pt-5 align-self-center text-center">
<h2>Stratis Public Key</h2>
<img src="@Url.Action("Qr", new {value = Model.PublicKey})" class="qr"/>
<div class="input-group mb-3 input-group-lg mt-4 pl-5 pr-5">
<div class="input-group-prepend">
<span class="input-group-text bg-dark text-white" id="basic-addon1">PUB</span>
</div>
<input type="text" class="form-control bg-dark" value="@Model.PublicKey">
<div class="input-group-append">
<button class="btn btn-success" type="button"><i class="fa fa-copy"></i> Copy</button>
</div>
</div>
</div>
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12 align-self-center text-center">
<h1>ARDA Decentralized Blockchain Platform</h1>
<p>Arda makes it easy creation and deployment of decentralized applications, that can be downloaded by end-users from the application store.</p>
<a href="#" class="btn-secondary-box">Download Whitepaper</a>
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12 pt-5 align-self-center text-center">
<h2>Stratis Private Address</h2>
<img src="@Url.Action("Qr", new {value = Model.PrivateKey})" class="qr"/>
<div class="input-group mb-3 input-group-lg mt-4 pl-5 pr-5">
<div class="input-group-prepend">
<span class="input-group-text bg-dark text-white" id="basic-addon1">WIF</span>
</div>
<input type="text" class="form-control bg-dark" value="@Model.PrivateKey">
<div class="input-group-append">
<button class="btn btn-success" type="button"><i class="fa fa-copy"></i> Copy</button>
</div>
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-md-12 text-center">
<a asp-controller="Home" asp-action="Generator" asp-route-timestamp="@DateTime.Now.Ticks" class="btn-secondary-box"><i class="fa fa-refresh"></i> Generate New Address</a>
@*<p class="small extra mt-5">Disclaimer: We does not store the generated addresses but by security please don't for big amounts.</p>*@
</div>
</div>
</div>
......
......@@ -21,11 +21,11 @@
<div class="col-12">
<nav class="main-nav">
<a asp-controller="Home" asp-action="Index" class="logo ">
<img src="~/images/logo.png" class="light-logo" alt="Stratis.guru"/> <span class="text-white">Stratis</span><span class="text-muted">.guru</span>
<img src="~/images/logo.png" class="light-logo" alt="Stratis.guru"/> <span class="text-white">Stratis</span><span class="text-muted">.guru</span> <span class="text-info text-hide">v2</span>
<img src="~/images/logos/white-logo-dark.svg" class="dark-logo" alt="Arda ICO"/>
</a>
<ul class="nav">
<li><a asp-action="Index" asp-controller="Home"><i class="fa fa-home"></i> HOME</a></li>
<li><a asp-action="About" asp-controller="Home"><i class="fa fa-info-circle"></i> ABOUT</a></li>
<li><a asp-action="Explorer" asp-controller="Home"><i class="fa fa-book"></i> BLOCK EXPLORER</a></li>
<li><a asp-action="Generator" asp-controller="Home"><i class="fa fa-qrcode"></i> ADDRESS GENERATOR</a></li>
<li><a asp-action="Contact" asp-controller="Home"><i class="fa fa-envelope"></i> CONTACT</a></li>-code
......@@ -40,7 +40,7 @@
</header>
@RenderBody()
<div id="crafted" class="pb-4">
<p class="text-center small">Proudly Crafted with 💖 by <a href="https://twitter.com/clint_network" target="_blank">Clint.Network</a> — Help me to maintain by sending $STRAT at SdKPovau8L1ViuioiYcgJauwRMPAxfbDG6</p>
<p class="text-center small">Proudly Crafted with 💖 by <a href="https://twitter.com/clint_network" target="_blank">Clint.Network</a> — Help me to maintain by sending $STRAT at SR2ZXnhRnMqJNoeDiCFUnaug7TKHJocwDd.</p>
</div>
<script src="~/js/jquery-2.1.0.min.js"></script>
<script src="~/js/popper.js"></script>
......
......@@ -3133,3 +3133,59 @@ header a:not(.logo):hover::after {
transform: scaleX(1);
transform-origin: bottom left;
}
.qr
{
border: 10px solid white;
width: 250px;
margin-bottom: 20px;
}
h2
{
color: white;
margin-bottom: 20px;
}
.extra.small
{
font-size: 9pt !important;
color: #AAAAAA;
}
.form-control,
.form-control:focus
{
color: #FFFFFF;
border: 1px solid #343a40 !important;
}
.input-group-lg .form-control
{
font-size: 12pt;
}
.input-group-lg .btn-success
{
font-size: 14pt !important;
}
.btn-success
{
background: #12abab;
border-color: #12abab;
}
.btn-success:hover,
.btn-success:active,
.btn-success:focus
{
background: #1ae4ff;
border-color: #1ae4ff;
}
.input-group-text.bg-dark
{
background-color: #555555 !important;
border: 0;
font-size: 12pt !important;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment