Skip to content

Commit cfaa2c5

Browse files
authored
Merge pull request #1896 from rllola/zeroname-namecoin-version
Zeroname plugin improvement
2 parents 819c2b0 + 02e2080 commit cfaa2c5

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

plugins/Zeroname/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# ZeroName
2+
3+
Zeroname plugin to connect Namecoin and register all the .bit domain name.
4+
5+
## Start
6+
7+
You can create your own Zeroname.
8+
9+
### Namecoin node
10+
11+
You need to run a namecoin node.
12+
13+
[Namecoin](https://namecoin.org/download/)
14+
15+
You will need to start it as a RPC server.
16+
17+
Example of `~/.namecoin/namecoin.conf` minimal setup:
18+
```
19+
daemon=1
20+
rpcuser=your-name
21+
rpcpassword=your-password
22+
rpcport=8336
23+
server=1
24+
txindex=1
25+
```
26+
27+
Don't forget to change the `rpcuser` value and `rpcpassword` value!
28+
29+
You can start your node : `./namecoind`
30+
31+
### Create a Zeroname site
32+
33+
You will also need to create a site `python zeronet.py createSite` and regitser the info.
34+
35+
In the site you will need to create a file `./data/<your-site>/data/names.json` with this is it:
36+
```
37+
{}
38+
```
39+
40+
### `zeroname_config.json` file
41+
42+
In `~/.namecoin/zeroname_config.json`
43+
```
44+
{
45+
"lastprocessed": 223910,
46+
"zeronet_path": "/root/ZeroNet", # Update with your path
47+
"privatekey": "", # Update with your private key of your site
48+
"site": "" # Update with the address of your site
49+
}
50+
```
51+
52+
### Run updater
53+
54+
You can now run the script : `updater/zeroname_updater.py` and wait until it is fully sync (it might take a while).

plugins/Zeroname/updater/zeroname_updater.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,15 @@ def initRpc(config):
169169
rpc_auth, rpc_timeout = initRpc(namecoin_location + "namecoin.conf")
170170
rpc = AuthServiceProxy(rpc_auth, timeout=rpc_timeout)
171171

172+
node_version = rpc.getnetworkinfo()['version']
173+
172174
while 1:
173175
try:
174176
time.sleep(1)
175-
last_block = int(rpc.getinfo()["blocks"])
177+
if node_version < 160000 :
178+
last_block = int(rpc.getinfo()["blocks"])
179+
else:
180+
last_block = int(rpc.getblockchaininfo()["blocks"])
176181
break # Connection succeeded
177182
except socket.timeout: # Timeout
178183
print ".",
@@ -192,6 +197,7 @@ def initRpc(config):
192197
assert not processBlock(236824, test=True) # Utf8 domain name (invalid should skip)
193198
assert not processBlock(236752, test=True) # Uppercase domain (invalid should skip)
194199
assert processBlock(236870, test=True) # Encoded domain (should pass)
200+
assert processBlock(438317, test=True) # Testing namecoin standard artifaxradio.bit (should pass)
195201
# sys.exit(0)
196202

197203
print "- Parsing skipped blocks..."

0 commit comments

Comments
 (0)