If you are in Windows 7-10, open "My Documents" and the same way you would type in like "
www.facebook.com" or something on an internet browser, go to the My Documents address bar and type "Powershell". And it will open a Windows Command line.
This link has a thing that you can Copy and Paste into the Command line (called a Script) that creates a Calculator that you can use. If you put in various things you can make apps that do different things.
https://gallery.technet.microsoft.com/scriptcenter/7e08cb64-f621-44b2-810b-dab3827755ceHere are some older posts about Bitcoin and Powershell.
Hello All,
I am a hobbyist .Net developer and had been trying (unsuccessfully) to use the "Bitnet" project (
http://sourceforge.net/projects/bitnet/) for a while. I finally got fed up and decided to start from scratch, below you will find the "first-pass"/"proof of concept" implementation of some of the "more commonly" used bitcoind rpc calls. Most of the work is in the string formatting, and you will still have to handle the json string that gets returned, but its a start, and hopefully someone will find it useful.
It makes use of Invoke-WebRequest command available in Powershell 4.0
Any input would be appreciated! Feel free to use/distribute to your hearts content, I simply ask that any improvements or extensions make their way back to this thread.
Enjoy:
copy the following text into a new file and save it as PowerCoin.ps1
H07ZmHjToR9k3L6+FtInvboy3TQktffyrVKph2hRnhHmZwOu1zomf9kgVBThEaCLbo0Kb5VfSpesiTvmsCnNBiE= (Signed with my Tip Address)
##Title: PowerCoin
##Version: 0.01
##Date: 6/7/2014
##Author: jagallout
##Usage: It works best to dot source the .ps1 file (e.g. PS C:\[path to PowerCoin.ps1]> . .\PowerCoin.ps1 )
##This will prompt you for a username/password and for the Uri for the rpc server, then you can just call the methods by name (e.g. getinfo)
##Question: jagallout on bitcointalk.org
##Tips: 1GqrY1LSRD4N99LQn4ULhSSoJ79B7rtC6W
$cred = Get-Credential
$Uri = Read-Host "Specify RPC Server"
$p_jsonrpc = "`"jsonrpc`":2.0"
$p_id = "`"id`":1"
function execute
{
param
(
$json
);
$result = Invoke-WebRequest -Uri $Uri -Method Post -ContentType "application/json-rpc" -Credential $cred -Body $json
return $result.Content
}
function getInfo
{
$json =
@"
{"method":"getinfo",$p_id, $p_jsonrpc}
"@
return execute($json)
}
function getblockcount
{
$json =
@"
{"method":"getblockcount",$p_id, $p_jsonrpc}
"@
return execute($json)
}
function getbestblockhash
{
$json =
@"
{"method":"",$p_id, $p_jsonrpc}
"@
return execute($json)
}
function getdifficulty
{
$json =
@"
{"method":"getdifficulty",$p_id, $p_jsonrpc}
"@
return execute($json)
}
function getreceivedbyaddress
{
Param
(
[string]$address,
[int]$confirmations
);
$params = "[`"$address`",$confirmations]"
$json =
@"
{"method":"getreceivedbyaddress","params":$($params.ToString()), $p_id, $p_jsonrpc}
"@
return execute($json)
}
function signmessage
{
Param
(
[parameter(mandatory=$true)][string]$address,
[parameter(mandatory=$true)][string]$message
);
$params = "[`"$address`",`"$message`"]"
$json =
@"
"@
return execute($json)
}
function verifymessage
{
Param
(
[parameter(mandatory=$true)][string]$address,
[parameter(mandatory=$true)][string]$signature,
[parameter(mandatory=$true)][string]$message
);
$params = "[`"$address`",`"$signature`",`"$message`"]"
$json =
@"
{"method":"verifymessage","params":$($params.ToString()), $p_id, $p_jsonrpc}
"@
return execute($json)
}
function getbalance
{
Param
(
[string]$account,
[int]$confirmations
);
if (!$account) {$account = ""}
if (!$confirmations) {$confirmations = 6}
$params = "[`"$account`", $confirmations]"
$json =
@"
{"method":"getbalance","params":$($params.ToString()), $p_id, $p_jsonrpc}
"@
return execute($json)
}
function getaccount
{
Param
(
[string]$account
);
$params = "[`"$account`"]"
$json =
@"
{"method":"getaccount","params":$($params.ToString()), $p_id, $p_jsonrpc}
"@
return execute($json)
}
function getaccountaddress
{
Param
(
[string]$account
);
$params = "[`"$account`"]"
$json =
@"
{"method":"getaccountaddress","params":$($params.ToString()), $p_id, $p_jsonrpc}
"@
return execute($json)
}
function dumpprivkey
{
Param
(
[parameter(mandatory=$true)][string]$address
);
$params = "[`"$address`"]"
$json =
@"
{"method":"dumpprivkey","params":$($params.ToString()), $p_id, $p_jsonrpc}
"@
return execute($json)
}
function getnewaddress
{
Param
(
[string]$account
);
$params = "[`"$account`"]"
$json =
@"
{"method":"getnewaddress","params":$($params.ToString()), $p_id, $p_jsonrpc}
"@
return execute($json)
}
function gettransaction
{
Param
(
[parameter(mandatory=$true)][string]$txid
);
$params = "[`"$txid`"]"
$json =
@"
{"method":"gettransaction","params":$($params.ToString()), $p_id, $p_jsonrpc}
"@
return execute($json)
}
Hey Guy, i wrote a script to monitor my mining rig by netcat latest log to Seashell because i am too tired to watch every via Teamviewer.
This is also script for auto relaunch Mining ClayMore. It may work with other Miner like ccminer, but i havent tested yet, so feel free to try. All script i wrote is batch, powershell and bash. Everything is clear code. You can check on your own.
Requirement:
- Powershell
- Windows 10 with SubSystem Linux included. ( You can try cygwin)
Why:
- Batch is good, but it is limited. Powershell can reach System Process Level Monitor.
- Windows Pipe is stupid. Command must finish before pipe to other. Linux is line by line pipe.
Step by Step Guide:
1. Install SubSystem Linux by following online guide:
https://msdn.microsoft.com/en-us/commandline/wsl/install-win10TLD'R:
- Run in Powershell:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Enable Developer Mode:
https://www.ghacks.net/2015/06/13/how-to-enable-developer-mode-in-windows-10-to-sideload-apps/- Run cmd and type "bash" (without quotes)
2. Copy all to your claymore directory. Make sure start-eth-edited.bat is same directory with file *Miner.exe
3. Edit file auto.txt. Change your email, Bot_email ,your *Miner.exe and Worker value. ( I use Gmail so if you use anything else, please edit mail config yourself)
4. Create shortcut start-eth-edited.bat to Startup Directory to run with Windows startup.
!!!! Windows file like .txt and .bat is free to edit. but .BASH (or any thing run inside BASH) must be edited by vim inside bash. If you edit .bash file inside windows, please contact me to fix. Linux file cant contain /r charater.
After success, you will receive mail like this. It contains link of seashells.io link.
http://prntscr.com/hii7reSeashells.io will monitor your rig like this.
http://prntscr.com/hii8ayFlow:
Start-eth-edited ---Loop---> auto.bat
auto.txt --variable--> auto.bat
auto.bat --call--> script/FindProcessMining.ps1 ; find top 15 process with Highest CPU
auto.bat --excute--> MiningProcess ; excute Mining Process if top process doesnt have Mining Process
auto.bat --call --> script/seashell-mail.bash ; Setup seashell and send to your email. After that, script seashell sleep forever to prevent bash close.
If you need any support or have any feed back, comment or email me:
sangvohoang@vnoss.orgTODO Next:
- Fix all remain bug.
- Move from Mail to Messenger Facebook Bot. I am writing a Bot on Facebook Messenger but I dont have enough money to buy a vps contain data.
- Messenger Bot will have lot lot more feature than this. Include manage your own rigs on Messenger.
!!! Script is Free to use. But i need your help to improve the script. Please donate me at ETH Address: 0x0A7721Bef04B491F07cCd02102622E1CdcD84a76
Link:
https://drive.google.com/file/d/14pGlf_1Cy-Ilhy4zLrH5Gk0IdICIMtGK/view?usp=sharingIt really is a pain to identify which GPU needs attention based on information available in Windows.
The closest I have come to identifying a GPU index to its PCI slot is demonstrated in the below Powershell script. But even then, each Windows install is different so this procedure can't really be reproduced. I am posting this in case someone has come across a better method or can expand on this script.
The idea behind this script is to identify all PCI devices and their children in Windows. Then, one has to unplug GPU by GPU and correlate the PCI device to a physical PCI slot. Once you have this cross reference, you can disable the GPUs you need in order to identify them. The disabled GPUs will output a ProblemCode other than zero in the script.
Required DeviceManagement Cmdlets:
https://gallery.technet.microsoft.com/Device-Management-7fad2388Powershell Script:
https://pastebin.com/x3zzzgruPowershell Output:
/c