This file contains hidden or 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
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false |
This file contains hidden or 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 org.example.keypair; | |
import org.bitcoinj.core.Base58; | |
import org.bouncycastle.jce.provider.BouncyCastleProvider; | |
import org.bouncycastle.util.encoders.Hex; | |
import org.bouncycastle.util.io.pem.PemObject; | |
import org.bouncycastle.util.io.pem.PemReader; | |
import org.bouncycastle.util.io.pem.PemWriter; | |
import java.io.File; |
This file contains hidden or 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
""" | |
A simple Blockchain in Python | |
""" | |
import hashlib | |
class GeekCoinBlock: | |
def __init__(self, previous_block_hash, transaction_list): |
This file contains hidden or 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 socket | |
import threading | |
class ThreadedServer(object): | |
def __init__(self, host, port): | |
self.host = host | |
self.port = port | |
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
self.sock.bind((self.host, self.port)) |
This file contains hidden or 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 hashlib,binascii,codecs,base58,ecdsa | |
class Wallet(object): | |
def __init__(self): | |
""" | |
private key | |
public key | |
address | |
https://github.com/burakcanekici/BitcoinAddressGenerator | |
https://medium.com/coinmonks/bitcoin-address-generation-on-python-e267df5ff3a3 |
OlderNewer