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
Show 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
...
@@ -66,6 +66,7 @@ namespace Stratis.Guru.Controllers
[
Route
(
"vanity"
)]
[
Route
(
"vanity"
)]
public
IActionResult
Vanity
(
Vanity
vanity
)
public
IActionResult
Vanity
(
Vanity
vanity
)
{
{
ViewBag
.
Succeed
=
true
;
return
View
();
return
View
();
}
}
...
...
Models/Vanity.cs
View file @
fd568d9a
using
System.ComponentModel.DataAnnotations
;
namespace
Stratis.Guru.Models
namespace
Stratis.Guru.Models
{
{
public
class
Vanity
public
class
Vanity
{
{
[
Required
(
ErrorMessage
=
"The prefix is required."
)]
[
StringLength
(
4
,
MinimumLength
=
1
,
ErrorMessage
=
"You connat overflow the size."
)]
public
string
Prefix
{
get
;
set
;
}
public
string
Prefix
{
get
;
set
;
}
[
Required
(
ErrorMessage
=
"The email address is required."
)]
[
EmailAddress
]
public
string
Email
{
get
;
set
;
}
public
string
Email
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Services/VanityService.cs
View file @
fd568d9a
using
System
;
using
System
;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Microsoft.Extensions.Caching.Memory
;
using
Microsoft.Extensions.Hosting
;
using
Microsoft.Extensions.Hosting
;
using
NBitcoin
;
using
Stratis.Guru.Modules
;
namespace
Stratis.Guru.Services
namespace
Stratis.Guru.Services
{
{
public
class
VanityService
:
IHostedService
,
IDisposable
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
)
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
;
return
Task
.
CompletedTask
;
}
}
...
...
Views/Home/Vanity.cshtml
View file @
fd568d9a
...
@@ -10,12 +10,20 @@
...
@@ -10,12 +10,20 @@
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 align-self-center text-center">
<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>
<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>
<p>Generate a vanity address with a prefix that you define, by example <span class="text-warning">STRAT</span>nhRnMqJNoeDiCFUnaug7TKHJocwDd</p>
@if (ViewBag.Succeed == null)
{
<div class="row">
<div class="row">
<div class="col-md-8 offset-2">
<div class="col-md-8 offset-2">
<div class="input-group mb-3 input-group-lg mt-4 pl-5 pr-5">
<div class="form-group mt-4">
<input type="text" class="form-control bg-dark" asp-for="Prefix" placeholder="Enter prefix">
<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">
<div class="input-group-prepend">
<span class="input-group-text bg-dark text-white" id="basic-addon1">SR2ZXnhRnMqJNoeDiCFUnaug7TKHJocwDd</span>
<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>
...
@@ -23,12 +31,24 @@
...
@@ -23,12 +31,24 @@
<div class="row">
<div class="row">
<div class="col-md-8 offset-2">
<div class="col-md-8 offset-2">
<div class="form-group mb-3 mt-4 pl-5 pr-5">
<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>
<label class="text-left extra small 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="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>
</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>
</div>
</div>
</div>
...
...
wwwroot/css/default.css
View file @
fd568d9a
...
@@ -3191,6 +3191,16 @@ h2
...
@@ -3191,6 +3191,16 @@ h2
border-color
:
#1ae4ff
;
border-color
:
#1ae4ff
;
}
}
.text-success
{
color
:
#1ae4ff
!important
;
}
.input-group-text
{
border-color
:
transparent
!important
;
}
.input-group-text.bg-dark
.input-group-text.bg-dark
{
{
background-color
:
#555555
!important
;
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