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
#!/bin/sh | |
# Sources: | |
# http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html | |
# http://askubuntu.com/questions/272314/setup-and-install-intellij-with-jdk | |
# https://gist.github.com/tahl/1658401 | |
# guide on setting up IntelliJ from Tony Owen | |
# http://droidapp.co.uk/2012/12/29/switching-to-intellij-installation-and-setup/ | |
# I have amended for my own purposes please refer to considerations in the Ask Ubuntu post | |
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
import org.ethereum.core.Block; | |
import org.ethereum.core.Genesis; | |
import org.ethereum.core.Transaction; | |
import org.ethereum.core.TransactionReceipt; | |
import org.ethereum.crypto.ECKey; | |
import org.ethereum.crypto.HashUtil; | |
import org.ethereum.facade.Ethereum; | |
import org.ethereum.facade.EthereumFactory; | |
import org.ethereum.listener.EthereumListenerAdapter; | |
import org.ethereum.net.p2p.HelloMessage; |
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
private static byte[] decrypt(byte[] data, byte[] key) | |
{ | |
// 16 bytes is the IV size for AES256 | |
try | |
{ | |
PaddedBufferedBlockCipher cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine())); | |
byte[] ivBytes = new byte[16]; | |
System.arraycopy(data, 0, ivBytes, 0, ivBytes.length); // Get iv from data | |
byte[] dataonly = new byte[data.length - ivBytes.length]; | |
System.arraycopy(data, ivBytes.length, dataonly, 0, data.length - ivBytes.length); |
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
package test.ethereum.dht; | |
import org.ethereum.net.dht.Bucket; | |
import org.ethereum.net.dht.Peer; | |
import org.junit.Test; | |
import org.spongycastle.util.encoders.Hex; | |
import java.util.List; | |
import static org.ethereum.net.dht.DHTUtils.getAllLeafs; |