-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f3dd09
commit 395de20
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
defmodule Command.DropChain do | ||
def run do | ||
sure? = | ||
"\nAre you sure? \e[31mThis can not be undone.\e[0m [Ny] " | ||
|> IO.gets() | ||
|> String.trim() | ||
|
||
if sure? == "Y" || sure? == "y" || sure? == "yes" do | ||
IO.puts("Deleting all chain data...") | ||
|
||
Exleveldb.destroy(".chaindata") | ||
Exleveldb.destroy(".utxo") | ||
|
||
IO.puts "Done." | ||
|
||
else | ||
IO.puts "Not dropping chain." | ||
end | ||
|
||
IO.puts "" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
defmodule Command.GenKeypair do | ||
def run do | ||
{pub, priv} = Elixium.KeyPair.create_keypair() | ||
|
||
address = Elixium.KeyPair.address_from_pubkey(pub) | ||
|
||
base16priv = Base.encode16(priv) | ||
|
||
IO.puts(" | ||
Generated Address: \e[34m#{address}\e[0m | ||
Private Key: \e[34m#{base16priv}\e[0m | ||
\e[31m\e[1mIMPORTANT\e[21m: Never share or lose your private key. Losing | ||
the key means losing access to all funds associated with the key. | ||
\e[0m\n | ||
") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
defmodule Command.Usage do | ||
|
||
def run do | ||
IO.puts " | ||
USAGE | ||
elixium_miner <command> --option value | ||
COMMANDS | ||
foreground Runs miner with console output in the foreground | ||
start Runs miner in background | ||
stop Stops miner started by calling start | ||
remote_console Opens a remote console in the context of a running miner | ||
dropchain Delete all block and utxo data | ||
genkey Generate a new Elixium address keypair | ||
OPTIONS | ||
--address Specifies which Elixium address to credit with rewards and block fees | ||
--port What port to use when connecting to the network (defaults to 31013) | ||
--rpc Enable RPC JSON commands | ||
--rpcPort Use specific port for RPC (defaults to 32123) | ||
--maxHandlers Specify the maximum amount of inbound & outbound connections | ||
" | ||
end | ||
|
||
end |