From c00601743c50c99930a20d91ac8b42baa9b9ad77 Mon Sep 17 00:00:00 2001 From: rllola Date: Tue, 12 Feb 2019 22:09:47 +0100 Subject: [PATCH 1/2] Added README for zeroname plugin with instructions --- plugins/Zeroname/README.md | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 plugins/Zeroname/README.md diff --git a/plugins/Zeroname/README.md b/plugins/Zeroname/README.md new file mode 100644 index 00000000..7f663686 --- /dev/null +++ b/plugins/Zeroname/README.md @@ -0,0 +1,61 @@ +# ZeroName + +Zeroname plugin to connect Namecoin and register all the .bit domain name. + +## Start + +You can create your own Zeroname. + +### Namecoin node + +You need to run a namecoin node. + +[Namecoin](https://namecoin.org/download/) + +You will need to start it as a RPC server. + +Example of `~/.namecoin/namecoin.conf` minimal setup: +``` +daemon=1 +rpcuser=your-name +rpcpassword=your-password +rpcport=8336 +server=1 +txindex=1 +``` + +Don't forget to change the `rpcuser` value and `rpcpassword` value! + +You can start your node : `./namecoind` + +### Update `updater/zeroname_updater.py` + + +You need update lines 117-118 with the correct `rpcuser` and `rpcpassword`. +``` + 'user': 'PLACEHOLDER', + 'password': 'PLACEHOLDER', +``` + +You will also need to create a site `python zeronet.py createSite` and regitser the info. + +In the site you will need to create a file `./data//data/names.json` with this is it: +``` +{} +``` + +### `zeroname_config.json` file + +In `~/.namecoin/zeroname_config.json` +``` +{ + "lastprocessed": 223910, + "zeronet_path": "/root/ZeroNet", # Update with your path + "privatekey": "", # Update with your private key of your site + "site": "" # Update with the address of your site +} +``` + +### Run updater + +You can now run the script : `updater/zeroname_updater.py` and wait until it is fully sync (it might take a while). From 02e2080ce22ab92e553efc46904f73f024fa247c Mon Sep 17 00:00:00 2001 From: rllola Date: Tue, 12 Feb 2019 23:06:21 +0100 Subject: [PATCH 2/2] Added test for new standard; Check version for compatibility with namecoin newer version; update README --- plugins/Zeroname/README.md | 9 +-------- plugins/Zeroname/updater/zeroname_updater.py | 8 +++++++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/plugins/Zeroname/README.md b/plugins/Zeroname/README.md index 7f663686..8a306789 100644 --- a/plugins/Zeroname/README.md +++ b/plugins/Zeroname/README.md @@ -28,14 +28,7 @@ Don't forget to change the `rpcuser` value and `rpcpassword` value! You can start your node : `./namecoind` -### Update `updater/zeroname_updater.py` - - -You need update lines 117-118 with the correct `rpcuser` and `rpcpassword`. -``` - 'user': 'PLACEHOLDER', - 'password': 'PLACEHOLDER', -``` +### Create a Zeroname site You will also need to create a site `python zeronet.py createSite` and regitser the info. diff --git a/plugins/Zeroname/updater/zeroname_updater.py b/plugins/Zeroname/updater/zeroname_updater.py index 5e3b78bd..6edb8d12 100644 --- a/plugins/Zeroname/updater/zeroname_updater.py +++ b/plugins/Zeroname/updater/zeroname_updater.py @@ -169,10 +169,15 @@ if sys.platform == 'win32': rpc_auth, rpc_timeout = initRpc(namecoin_location + "namecoin.conf") rpc = AuthServiceProxy(rpc_auth, timeout=rpc_timeout) +node_version = rpc.getnetworkinfo()['version'] + while 1: try: time.sleep(1) - last_block = int(rpc.getinfo()["blocks"]) + if node_version < 160000 : + last_block = int(rpc.getinfo()["blocks"]) + else: + last_block = int(rpc.getblockchaininfo()["blocks"]) break # Connection succeeded except socket.timeout: # Timeout print ".", @@ -192,6 +197,7 @@ assert processBlock(227052, test=True) # Testing brainwallets.bit assert not processBlock(236824, test=True) # Utf8 domain name (invalid should skip) assert not processBlock(236752, test=True) # Uppercase domain (invalid should skip) assert processBlock(236870, test=True) # Encoded domain (should pass) +assert processBlock(438317, test=True) # Testing namecoin standard artifaxradio.bit (should pass) # sys.exit(0) print "- Parsing skipped blocks..."