I made changes on the ready blockchain network. I am using the following code to start the system
python3 full_node.py --port=8001 --node=127.0.0.1:8000 --mine=1
but whenever I enter this code the wallet address changes every time I open and close the terminal. I added a place called wall in addition to the codes. The code was like this.
import argparse
parser = argparse.ArgumentParser(description='Blockchain full node.')
parser.add_argument('--node', type=str, help='Address of node to connect. If not will init fist node.')
parser.add_argument('--port', required=True, type=int, help='Port on which run the node.')
parser.add_argument('--mine', required=False, type=bool, help='Port on which run the node.')
parser.add_argument('--diff', required=False, type=int, help='Difficulty')
parser.add_argument('--wall', required=False, type=str, help='wallet address')
args = parser.parse_args()
_DB = DB()
_DB.config['difficulty']
_W = Wallet.create()
_BC = Blockchain(_DB, _W)
_API = API(_BC)
logger.info(' ####### Server Address: %s ########' %_W.address)
app.config['db'] = _DB
app.config['wallet'] = args.wall
app.config['bc'] = _BC
app.config['api'] = _API
app.config['port'] = args.port
app.config['host'] = '127.0.0.1'
app.config['nodes'] = set([args.node]) if args.node else set(['127.0.0.1:%s' % args.port])
app.config['sync_running'] = False
app.config['mine'] = args.mine
before i changed the code it was like this
import argparse
parser = argparse.ArgumentParser(description='Blockchain full node.')
parser.add_argument('--node', type=str, help='Address of node to connect. If not will init fist node.')
parser.add_argument('--port', required=True, type=int, help='Port on which run the node.')
parser.add_argument('--mine', required=False, type=bool, help='Port on which run the node.')
parser.add_argument('--diff', required=False, type=int, help='Difficulty')
args = parser.parse_args()
_DB = DB()
_DB.config['difficulty']
_W = Wallet.create()
_BC = Blockchain(_DB, _W)
_API = API(_BC)
logger.info(' ####### Sunucu Adresi: %s ########' %_W.address)
app.config['db'] = _DB
app.config['wallet'] = _W
app.config['bc'] = _BC
app.config['api'] = _API
app.config['port'] = args.port
app.config['host'] = '127.0.0.1'
app.config['nodes'] = set([args.node]) if args.node else set(['127.0.0.1:%s' % args.port])
app.config['sync_running'] = False
app.config['mine'] = args.mine
I want to be able to place a single wallet address in the code I want. sticking to only 1 wallet every time I start the terminal. The error is either in this code above or here.
@classmethod
def create(cls):
inst = cls(b'',b'')
_pub, _priv = rsa.newkeys(512)
inst._pub = Address(_pub)
inst._priv = _priv
return inst
thanks to everyone who helped in advance.