* Change of hard coded peer servers for Feathercoin
The domain of the peer server hard coded in coins.py for Feathercoin has expired.
Two new peers added.
* Rename NamecoinBlockProcessor.
For Xaya, we will use the same kind of logic for keeping track of an
index of names in addition to the index of addresses. Thus it makes
sense to call it by some more generic name. Here, we rename it to
NameIndexBlockProcessor.
* Create NameIndexMixin from Namecoin.
This factors out some code from Namecoin to a new NameIndexMixin. This
code is what we need to keep track of a name index in addition to the
address index, as done by the NameIndexBlockProcessor.
With the code factored out, the Coin itself only needs to define the
set of possible name operations it allows (and where they have the name
by which the index will be built).
For now, this is only used by Namecoin. But in the future, we will use
it for Xaya as well.
* Add name indexing to Xaya.
Change the Xaya definition so that it handles name scripts correctly:
We want to strip them off the "real" address for indexing by address,
and we want to keep a separate index on names like Namecoin does.
* Split out deserialisation of CAuxPow.
The current DeserializerAuxPow has code for reading a block header
including (potentially) an auxpow. In this change, we split out the
logic for reading the actual CAuxPow instance to its own function.
This makes the code easier to read, as the different steps are more
clearly separated. It will also be useful for working with CAuxPow
instances that are part of a different serialisation format (e.g.
for the Xaya blockchain).
* Add Xaya coin with deserialiser.
This defines a new coin for Xaya (https://github.com/xaya/xaya), with
the appropriate deserialiser methods. Xaya is based on Namecoin, but
uses its own special twist on auxpow for the PoW, so we need to handle
that properly in block-header deserialisation.
Xaya also has names like Namecoin (but with slightly changed semantics),
but handling for them (i.e. building a name index in addition to the
address index) will be added later on.
* Keep more data in truncated Xaya headers.
When Xaya headers are truncated (because they are checkpointed), we still
need to send the algorithm and bits with them. That is needed for the
difficulty retargeting of Xaya to work correctly.
* Define peers for Xaya.
We will run ElectrumX instances on the seeder VPSes. Set those in PEERS
for mainnet (there are no peers for testnet).
Namecoin and Emercoin both have special treatment for name prefixes on
scripts. Through the NameMixin, they were already sharing some code for
that. There was, however, still a lot of duplicated logic.
This refactors the code so that more logic is shared in the common
NameMixin. In particular, there is now a general function for matching
a potential name prefix against the allowed structures of name operations.
Thus, the coin-specific code only has to define the valid structures of
name operations in the coin and handle coin-specific extra work (like
building the normalised script that is used for indexing names in
Namecoin).
JSON errors indicate an erroneous request in some sense; HTTP errors
generally indicate refusal to provide service. These should be handled
differently - the latter with retries (and logging so an admin can fix it);
the former should terminate the request.
WorkQueueFullError was a special case; generalise to ServiceRefusedError.
Fixes#866
This extends the "query" RPC command so that it also allows querying
for the name index in Namecoin (and potential future coins that support
a name index as well).
Previously, that was not possible even when passing the normalised
script itself: In that case, hashX_from_script would strip off the name
prefix again, and thus the query would only be for OP_RETURN. (Thanks to
JeremyRand for analysing this bug!)