Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
guru
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
guru
Commits
fd568d9a
Commit
fd568d9a
authored
Oct 17, 2018
by
Clint Mourlevat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementing vanity process
parent
80bf3d50
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
14 deletions
+75
-14
HomeController.cs
Controllers/HomeController.cs
+1
-0
Vanity.cs
Models/Vanity.cs
+7
-0
VanityService.cs
Services/VanityService.cs
+23
-0
Vanity.cshtml
Views/Home/Vanity.cshtml
+34
-14
default.css
wwwroot/css/default.css
+10
-0
No files found.
Controllers/HomeController.cs
View file @
fd568d9a
...
...
@@ -66,6 +66,7 @@ namespace Stratis.Guru.Controllers
[
Route
(
"vanity"
)]
public
IActionResult
Vanity
(
Vanity
vanity
)
{
ViewBag
.
Succeed
=
true
;
return
View
();
}
...
...
Models/Vanity.cs
View file @
fd568d9a
using
System.ComponentModel.DataAnnotations
;
namespace
Stratis.Guru.Models
{
public
class
Vanity
{
[
Required
(
ErrorMessage
=
"The prefix is required."
)]
[
StringLength
(
4
,
MinimumLength
=
1
,
ErrorMessage
=
"You connat overflow the size."
)]
public
string
Prefix
{
get
;
set
;
}
[
Required
(
ErrorMessage
=
"The email address is required."
)]
[
EmailAddress
]
public
string
Email
{
get
;
set
;
}
}
}
\ No newline at end of file
Services/VanityService.cs
View file @
fd568d9a
using
System
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
Microsoft.Extensions.Caching.Memory
;
using
Microsoft.Extensions.Hosting
;
using
NBitcoin
;
using
Stratis.Guru.Modules
;
namespace
Stratis.Guru.Services
{
public
class
VanityService
:
IHostedService
,
IDisposable
{
private
IMemoryCache
_memoryCache
;
private
IAsk
_ask
;
public
VanityService
(
IMemoryCache
memoryCache
,
IAsk
ask
)
{
_memoryCache
=
memoryCache
;
_ask
=
ask
;
}
public
Task
StartAsync
(
CancellationToken
cancellationToken
)
{
/*while (true)
{
var stratisKey = new Key();
var stratisAddress = stratisKey.GetWif(Network.StratisMain).PubKey.GetAddress(Network.StratisMain).ToString();
if (stratisAddress.ToLower().StartsWith("stra"))
{
Console.WriteLine(stratisAddress);
}
//Thread.Sleep((int) TimeSpan.FromSeconds(10).TotalMilliseconds);
}*/
return
Task
.
CompletedTask
;
}
...
...
Views/Home/Vanity.cshtml
View file @
fd568d9a
...
...
@@ -10,25 +10,45 @@
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 align-self-center text-center">
<h1><strong>Vanity </strong>Address Generator</h1>
<p>Generate a vanity address with a prefix that you define, by example <span class="text-warning">STRAT</span>nhRnMqJNoeDiCFUnaug7TKHJocwDd</p>
<div class="row">
<div class="col-md-8 offset-2">
<div class="input-group mb-3 input-group-lg mt-4 pl-5 pr-5">
<input type="text" class="form-control bg-dark" asp-for="Prefix" placeholder="Enter prefix">
<div class="input-group-prepend">
<span class="input-group-text bg-dark text-white" id="basic-addon1">SR2ZXnhRnMqJNoeDiCFUnaug7TKHJocwDd</span>
@if (ViewBag.Succeed == null)
{
<div class="row">
<div class="col-md-8 offset-2">
<div class="form-group mt-4">
<label class="text-left extra small text-white">The actual process is unthreaded and will be update in some days.</label>
<div class="input-group mb-3 input-group-lg pl-5 pr-5">
<div class="input-group-prepend">
<span class="input-group-text bg-info text-white">Prefix</span>
</div>
<div class="input-group-prepend">
<span class="input-group-text bg-dark text-white">S</span>
</div>
<input type="text" class="form-control bg-dark" asp-for="Prefix" placeholder="Enter the first letters, without the begning 'S'" maxlength="4">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8 offset-2">
<div class="form-group mb-3 mt-4 pl-5 pr-5">
<label class="text-left text-white">You will receive the private key by email.</label>
<input type="text" class="form-control bg-dark" asp-for="Email" placeholder="Enter your email address"/>
<div class="row">
<div class="col-md-8 offset-2">
<div class="form-group mb-3 mt-4 pl-5 pr-5">
<label class="text-left extra small text-white">You will receive the private key by email.</label>
<div class="input-group input-group-lg">
<div class="input-group-prepend">
<span class="input-group-text bg-info text-white">Recipient</span>
</div>
<input type="text" class="form-control bg-dark" asp-for="Email" placeholder="Enter your email address to receive the key"/>
</div>
</div>
</div>
</div>
</div>
<button type="submit" href="https://github.com/clintnetwork/stratis-guru-v2" target="_blank" class="btn-secondary-box mt-4"><i class="fa fa-github"></i> Browse Source on Github</button>
<button type="submit" href="https://github.com/clintnetwork/stratis-guru-v2" target="_blank" class="btn-secondary-box mt-4"><i class="fa fa-play-circle"></i> Start Vanity Process</button>
}
else
{
<i class="fa fa-check text-success fa-5x"></i>
<h1>Process Started</h1>
<p>The process has been taken in hand by our vanity service !</p>
}
</div>
</div>
</div>
...
...
wwwroot/css/default.css
View file @
fd568d9a
...
...
@@ -3191,6 +3191,16 @@ h2
border-color
:
#1ae4ff
;
}
.text-success
{
color
:
#1ae4ff
!important
;
}
.input-group-text
{
border-color
:
transparent
!important
;
}
.input-group-text.bg-dark
{
background-color
:
#555555
!important
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment