Crypto Miner Softwares

Softwares to be used:

  1. Install windows on the crpto machine.
  2. Install remote monitoring software. Preferrably Team viewer or VNC server/Client.
  3. Create wallet on https://www.myetherwallet.com/ and save the private key.
  4. Create miner config on nanopool. Many pools are available. Nanopool has been my preferred option.
    Nanopool: https://nanopool.org/
  5. Use the config in Claymore’s dual miner.
    Claymore’s dual miner: https://github.com/nanopool/Claymore-Dual-Miner/releases
  6. Happy Mining !!

Unix Distro

Proprotiery OS can also be used for mining.
Ethos is specially designed for mining. It provided advanced tools for managing the rig.

Ethos: http://ethosdistro.com/

 

Crypto Miner Assemblage

Steps to assemble the crypto equipment

  1. Mount the motherboard on the aluminium case.
  2. Fit the processor and the fan provided with it. Take care of the cooling agent (Thermal paste) applied on the processor which connects to the fan.
  3. Connect the ram and ssd to the ram and sata ports.
  4. Connect the power supply to the motherboard and the peripherals.
  5. Connect the gpu’s to the risers and mount the risers on the aluminium case. Connect the risers to the motherboard and the power supply. Depending upon the power supply of the gpu this can vary.
  6. Connect screen, keyboard and mouse (peripherals to the) motherboard.
  7. Connect the power starter cord to the mentioned i/o power sockets on the motherboard. Refer to the circuit diagram of the motherboard for the same.
  8. Mount the fans on the aluminium case adjacent to the gpu’s for cooling.
  9. Start the device. Install windows in the ssd.

Crypto Miner Equipment – Ethereum

Requirements

  1. Aluminium frame
  2. 2″ * 3″ small table
  3. Motherboard: Asus Z270E Strix Gaming – LGA1151 – 7th Generation MotherBoard
  4. Processor: Intel Pentium G4400 Skylake Dual-Core 3.3GHz Desktop Processor
  5. SSD : WD Green 120GB Internal Solid State Drive (WDS120G1G0A)
  6. RAM: HyperX Fury 4GB 2400MHz DDR4 Non-ECC CL15 DIMM 4 DDR4 2400 MT/s (PC4-19200) (HX424C15FB/4)
  7. Graphic Card : Zotac GTX1060 Mini – PCI-Express Graphics Card (6GB GDDR5, CUDA cores 1280, 192-bit, Base: 1506 MHz Boost:1708 MHz, ICE Storm Cooling, VR Ready)
  8. NVIDIA GeForce GTX 1060 GP 106-100 6GB GDDR5 CRYPTOCURRENCY MINING GRAPHICS CARD
  9. Fans: Circle 120MM Silent Cabinet Cooling Fan 15 LED – 7 COLORS – 16X7C
  10. Power Supply: Corsair HX1000 – 1000 Watt 80 PLUS® Platinum Certified Fully Modular PSU
  11. Risers: 4 of Rrimin USB 3.0 PCI-E Express 1x To 16x Extender Riser Card Adapter Power Cable Mining 50CM (107793)
  12. PC Starter: Generic ATX PC Computer Motherboard Power Cable Switch On/Off/Reset w/ HDD LED Light

Aj007 SmartContract (Aj007 coin)

Ethereum based Aj007 Smart Contract


pragma solidity 0.4.24;

contract admined{
	address public admin;

	constructor() public {
		admin = msg.sender;
	}
	
	modifier onlyAdmin() { 
		if(msg.sender != admin) revert();
		_;
	}

	function transferAdminship (address newAdmin) onlyAdmin public{
		admin = newAdmin;
	}
}

contract Aj007Base{

	mapping (address => uint256) public balanceOf;
	// allowing others to execute transactions on your behalf
	mapping (address => mapping ( address => uint256)) public allowance;
	
	// balanceOf[address] = 5;
	string public standard = "Aj007 v1.0";
	string public name;
	string public symbol;
	uint8 public decimal; // 1.23 Number of decimal
	uint256 public totalSupply;
	//indexed address passsed will be stored in log memory and not contract data
	event Transfer(address indexed from, address indexed to, uint256 _value);

	constructor (uint256 initialSupply, string tokenName, string tokenSymbol, uint8 decimalUnits) public{
		balanceOf[msg.sender] = initialSupply;
		totalSupply = initialSupply;
		decimal = decimalUnits;
		name = tokenName;
		symbol = tokenSymbol;

	} 

	function transfer (address _to,uint256 _value) public{
		if(balanceOf[msg.sender] < _value) revert();
		//0-255 8 bit
		// 250,10 = 4 Buffer overflow
		if(balanceOf[_to] + _value < balanceOf [_to]) revert();
		// Any number of conditions can be added here
		balanceOf[msg.sender] -= _value;
		balanceOf[_to] += _value;
		// Can be used for debugging values of smart contract and also act as an event for other clients
		// Technically a logging method
		emit Transfer(msg.sender,_to,_value);
	}

	function approve (address _spender, uint256 _value) public returns(bool res){
		allowance[msg.sender][_spender] = _value;
		return true;
	}
	
	function transferFrom (address _from, address _to, uint256 _value) public returns(bool res){
		if(balanceOf[_from] < _value) revert();
		if(balanceOf[_to] + _value < balanceOf[_to]) revert();
		if(_value > allowance[_from][msg.sender]) revert();

		balanceOf[_from] -= _value;
		balanceOf[_to] += _value;

		allowance[_from][msg.sender] -= _value;

		emit Transfer(_from,_to, _value);
		return true;
	}
	
}

contract Aj007 is admined, Aj007Base{

	uint256 public minimumBalanceForAccounts = 5 finney;
	uint256 public sellPrice;
	uint256 public buyPrice;
	mapping (address => bool) public frozenAccount;

	event FrozenFund(address target, bool frozenStatus);
	

	constructor (uint256 initialSupply, string tokenName, string tokenSymbol, uint8 decimalUnits, address centralAdmin) Aj007Base(0,tokenName,tokenSymbol,decimalUnits) public{
		totalSupply = initialSupply;
		if(centralAdmin != 0)
			admin = centralAdmin;
		else
			admin = msg.sender;
		balanceOf[admin]=initialSupply;
		totalSupply = initialSupply;	
	}

	function mintToken (address target, uint256 mintedAmount) onlyAdmin public returns(bool res) {
		balanceOf[target]+= mintedAmount;
		totalSupply += mintedAmount;
		// Notify the total amount is increased
		emit Transfer(0, this, mintedAmount);
		// Notify that the token is added to the given account
		emit Transfer(this, target, mintedAmount);
		return true;
	}

	function freezeAccount (address target, bool freeze) onlyAdmin public{
		frozenAccount[target] = freeze;
		emit FrozenFund(target, freeze);
	}
	
	function transfer (address _to,uint256 _value) public{
		if(msg.sender.balance < minimumBalanceForAccounts){
			//Ensures minimum balance is maintained in account. 
			//If ether amount goes to 0 the transaction cannot be processed further.
			sell((minimumBalanceForAccounts - msg.sender.balance)/sellPrice);
		}
		if(frozenAccount[msg.sender]) revert();
		if(balanceOf[msg.sender] < _value) revert();
		//0-255 8 bit
		// 250,10 = 4 Buffer overflow
		if(balanceOf[_to] + _value < balanceOf [_to]) revert();
		// Any number of conditions can be added here
		balanceOf[msg.sender] -= _value;
		balanceOf[_to] += _value;
		// Can be used for debugging values of smart contract and also act as an event for other clients
		// Technically a logging method
		emit Transfer(msg.sender,_to,_value);
	}

	// Ensure admin frozen accounts wont be able to transfer any coins anywhere
	function transferFrom (address _from, address _to, uint256 _value) public returns(bool res){
		if(frozenAccount[_from]) revert();
		if(balanceOf[_from] < _value) revert();
		if(balanceOf[_to] + _value < balanceOf[_to]) revert();
		if(_value > allowance[_from][msg.sender]) revert();

		balanceOf[_from] -= _value;
		balanceOf[_to] += _value;

		allowance[_from][msg.sender] -= _value;

		emit Transfer(_from,_to, _value);
		return true;
	}

	function setPrices (uint256 newSellPrice, uint256 newBuyPrice) onlyAdmin public returns(bool res){
		sellPrice = newSellPrice;
		buyPrice = newBuyPrice;
		return true;
	}
	
	//Sent Ether's contract gives the buyer tokens (For messageSender who wants to get the token)
	function buy () public payable{
		// convert to wei
		uint256 amount = (msg.value/(1 ether)) / buyPrice;
		// check if smart contract itself has those any coins to transfer
		if(balanceOf[this] < amount) revert();
		balanceOf[msg.sender] += amount;
		balanceOf[this] -= amount;
		emit Transfer(this, msg.sender, amount);
	}
	
	function sell (uint256 amount) public{
		
		// Check if the sender himself has those many tokens
		if (balanceOf[msg.sender] < amount) revert();
		balanceOf[this] += amount;
		// change coin balance of sender
		balanceOf[msg.sender] -= amount;
		if(!msg.sender.send(amount * sellPrice * 1 ether)){
			// revert() will revert all the changes which have been done above
			revert();
		}
		else{
			// Aj007 coin function to receive the coins back to the contract
			emit Transfer(msg.sender, this, amount);			
		}
	}
	
	// Function to have block rewards for mining
	function giveBlockreward () private {
		balanceOf[block.coinbase] += 1;
	}

	// Add the currentChallenge and set difficulty for the blockChain
	bytes32 public currentChallenge;
	uint public timeOfLastProof;
	uint public difficulty = 10**32;

	function proofOfWork (uint nonce) public{
		bytes32 n = keccak256(abi.encodePacked(nonce, currentChallenge));

		// revert() Exception as difficulty alsways has to be greater than the previous 
		if(n < bytes8(difficulty)) revert();

		uint timeSinceLastBlock = (now - timeOfLastProof);
		if(timeSinceLastBlock < 5 seconds) revert();

		// Reward given for every 1 minute here
		balanceOf[msg.sender] += timeSinceLastBlock / 60 seconds;

		//Ensures average mining time is 10 minutes
		difficulty = difficulty * 10 minutes / timeOfLastProof * 1;
		timeOfLastProof = now;

		currentChallenge = keccak256(abi.encodePacked(nonce, currentChallenge,blockhash(block.number-1)));
	}	
}

Ethereum Token/Coin (Aj007)

Ethereum Coin Aj007

Solidity Smart Contract


pragma solidity 0.4.8;
contract Aj007{

	mapping (address => uint256) public balanceOf;
	// allowing others to execute transactions on your behalf
	mapping (address => mapping (address => uint256)) public allowance;
	
	// balanceOf[address] = 5;
	string public standard = "Aj007 v1.0";
	string public name;
	string public symbol;
	uint8 public decimal; // 1.23 Number of decimal
	uint256 public totalSupply;
	//indexed address passsed will be stored in log memory and not contract data
	event Transfer(address indexed from, address indexed to, uint256 _value);

	function  Aj007 (uint256 initialSupply, string tokenName, string tokenSymbol, uint8 decimalUnits){
		balanceOf[msg.sender] = initialSupply;
		totalSupply = initialSupply;
		decimal = decimalUnits;
		name = tokenName;
		symbol = tokenSymbol;

	} 

	function transfer (address _to,uint256 _value){
		if(balanceOf[msg.sender] < _value) throw;
		//0-255 8 bit
		// 250,10 = 4 Buffer overflow
		if(balanceOf[_to] + _value < balanceOf [_to]) throw;
		// Any number of conditions can be added here
		balanceOf[msg.sender] -= _value;
		balanceOf[_to] += _value;
		// Can be used for debugging values of smart contract and also act as an event for other clients
		// Technically a logging method
		Transfer(msg.sender,_to,_value);
	}

	function approve (address _spender, uint256 _value) returns(bool res){
		allowance[msg.sender][_spender] = _value;
		return true;
	}
	
	function transferFrom (address _from, address _to, uint256 _value) returns(bool res){
		if(balanceOf[_from] < _value) throw;
		if(balanceOf[_to] + _value < balanceOf[_to]) throw; if(_value > allowance[_from][msg.sender]) throw;

		balanceOf[_from] -= _value;
		balanceOf[_to] += _value;

		allowance[_from][msg.sender] -= _value;

		Transfer(_from,_to, _value);
		return true;
	}
	
}

Minimum Viable Token (MVT)

Creation of Smart Contract Token on Ethereum Network.

Minimum Viable Token


pragma solidity 0.4.8;
contract Aj007{

mapping (address => uint256) public balanceOf;
// balanceOf[address] = 5;
string public standard = "Aj007 v1.0";
string public name;
string public symbol;
uint8 public decimal;

function Aj007 (uint256 initialSupply){
balanceOf[msg.sender] = initialSupply;
}

function transfer (address _to,uint256 _value){
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
}

}

Deploy Smart Contract in Ethereum Consortium

This can be done in many ways.

One of the ways is to use the Ethereum Remix IDE

Ethereum Remix IDE: https://remix.ethereum.org/

Remix will auto compile the code if you have selected “Auto Compile” else click on  to compile you code. Now we will deploy this smart contract in Ethereum Consortium Blockchain, which we had created.

Deploy smart contracts on azure ethereum consortium blockchain

To deploy smart contract, we will use Remix only. In remix browser click on “Run” tab, which is located on top right side of screen

From “Environment” drop down select “Web3 Provider”. It will show a pop up like shown below.

Click on OK. Now you need to provide “Web3 Provider Endpoint” for you Ethereum blockchain network. It is the “ethereum-rpc-endpoint”  value which we had saved from Azure portal as part of step1. Paste this value in popup window and click on “OK”.

Now It will show you some values in “Account” dropdown, which was earlier blank. Now we have connected remix IDE with in Ethereum Consortium Blockchain. Lets deploy smart contract. Click on “Create”


Ethereum or Mist Wallet

You can also make use of the Ethereum or mist wallet from your local system and connect to the transactionn node on the remote azure consortium deployment.

Command:

./ethereumwallet --rpc --rpcapi="db,eth,net,web3,personal,web3" ethereum admin side from Consortium deployment

./mist --rpc --rpcapi="db,eth,net,web3,personal,web3" ethereum admin side from Consortium deployment

Eg:./ethereumwallet --rpc --rpcapi="db,eth,net,web3,personal,web3" http://a3uc7l-dns-reg1.eastus.cloudapp.azure.com:8545

The Ethereum/Mist wallet would provide with more convinient UI and access to the remote Transaction node and would facilitate easy deployment of the Smart Contract.

Reference: https://blogs.msdn.microsoft.com/reenusaluja/2018/03/12/deploy-your-first-smart-contract-on-azure-ethereum-consortium-blockchain/

Ethereum Consortium

Proceed with the deployment as stated in the official reference document.

Reference Docs : https://docs.microsoft.com/en-us/azure/blockchain-workbench/ethereum-deployment-guide

#Some usefull commands to access the rpc from remote terminals:

geth --dev --rpc --rpcaddr "0.0.0.0"
geth -rpc --rpcapi="db,eth,net,web3,personal,web3"
geth --dev --rpc --rpcaddr "0.0.0.0" --rpcapi "eth,net,web3,admin,personal" [...]

#You can multiple instance of the Geth on different ports using --port flag and just run all Geth instance with --ipcdisable flag


geth [...] --rpc --rpcport 8546 --rpcaddr "0.0.0.0" --rpcapi "eth,net,web3,admin,personal" [...] --dev

./ethereumwallet --rpc --rpcapi="db,eth,net,web3,personal,web3" http://a3uc7l-dns-reg1.eastus.cloudapp.azure.com:8545

Wallets

Ethereum Wallet: https://github.com/ethereum/mist/releases

Mist: https://github.com/ethereum/mist/releases

MetaMask: https://metamask.io/

ENS (Ethereum Name Service)

ENS offers a secure and decentralised way to address resources both on and off the blockchain using simple, human-readable names.

Long addresses pruned

ENS eliminates the need to copy – and worse, type – long hexadecimal addresses. With ENS, you’ll be able to send money to your friend at ‘ajinkya007.eth’ instead of ‘0x4cbe58c50480…’, interact with your favorite contract at ‘mycontract.eth’.

Security

ENS is built on smart contracts on the Ethereum blockchain, meaning it doesn’t suffer from the insecurity of the DNS system. You can be confident names you enter work the way their owner intended.

Truly Distributed

ENS operates in a distributed fashion for both its infrastructure and governance. Anyone can register a .eth domain name for themselves by participating in an auction process, mediated by the blockchain.

How to get your own ENS :

ens.domains, gitcoin.co

Gitcoin

While exploring projects on github, I came across the project Gitcoin.

Github Project: https://github.com/gitcoinco

Project Website: https://gitcoin.co/

Project Summary:  The Mission statement is to grow open source.
The idea of the project is to solve the incentive problems for oopen source developers. OPen sourcce developers create a lot of intellectual and economic value and are never properly incentivized for the same. This project tries to solve the problem by providing a decentralized platform where  project repo mainteners can post in their funded issues and open source developers can work on the same.

BitcoinTalk: https://bitcointalk.org/index.php?topic=2206663

Gitcoin provides the feature to create your own ENS. Have a look at their blog on the same.

Blog: https://medium.com/gitcoin/personalize-your-own-gitcoin-ens-name-f8e5d7438e3e