code: public static Long calculateChainId(EthereumTransaction eTrans) {
  	Long result=null;
  		long rawResult=EthereumUtil.convertVarNumberToLong(new RLPElement(new byte[0],eTrans.getSig_v()));
  		if (!((rawResult == EthereumUtil.LOWER_REAL_V) || (rawResult== (LOWER_REAL_V+1)))) {
  			result = (rawResult-EthereumUtil.CHAIN_ID_INC)/2;
  	}
  	return result;
  }
docs: Calculates the chain Id
  
  @param eTrans Ethereum Transaction of which the chain id should be calculated
  @return chainId: 0, Ethereum testnet (aka Olympic); 1: Ethereum mainet (aka Frontier, Homestead, Metropolis) - also Classic (from fork) -also Expanse (alternative Ethereum implementation), 2 Morden (Ethereum testnet, now Ethereum classic testnet), 3 Ropsten public cross-client Ethereum testnet, 4: Rinkeby Geth Ethereum testnet, 42 Kovan, public Parity Ethereum testnet, 7762959 Musicoin, music blockchain