As Tapyrus is a federated network, multiple production networks overseen by one federation each would be online. Each network could be using Tapyrus to deploy a blockchain application for use in a different context. A network can be identified by looking at the network parameters namely the genesis block, aggregate public key and network magic bytes upto version v0.3.0. Before running a node double check the network parameters and make sure that the node connects to the right network.
Tapyrus network has different kinds of nodes, this is a minimal list at the time of release:
| Node type | How many? | Purpose |
|---|---|---|
| Tapyrus Signer | min 3, unbounded | A network of signers that collects Unapproved transactions from the Tapyrus network and creates a block. |
| Tapyrus Core | min 1, unbounded | Tapyrus full node implementation |
| Tapyrus Seeder | min 1, unbounded | DNS seeder for configuring Tapyrus network |
Following parameters are unique to each tapyrus network
Network Id This is a configurable number needed to start a federated Tapyrus network. It is recommended that every Tapyrus network uses a different Network Id for identification and to avoid collision of network traffic generated by different Tapyrus networks.
Network magic bytes Magic bytes are used as a way to identify the separate network messages sent between nodes on the Tapyrus network. The magic bytes are derived from Network Id as described in Network ID and Magic Bytes
Genesis block
In Tapyrus, genesis block is not embedded into the software. It is an external file generated using a utility provided by Tapyrus called Tapyrus-genesis and signed by the federation of Tapyrus-signers. Each Tapyrus network has a unique genesis block.
Aggregate public key
The genesis block contains the "aggregate public key" of the federation. It is generated by the Tapyrus-signer network at startup using verifiable secret sharing scheme. It is used by each Tapyrus-core node to validate the threshold signature in the block proof and accept the block.
- How to build tapyrus?
- How to get the pre-built binaries?
- How to start tapyrus in dev mode?
- How to start a node on tapyrus testnet?
- How to start a new tapyrus network?
- How to create a genesis block?
- How to get coins?
- How to upgrade tapyrus?
Tapyrus is currently supported on two platforms, Linux and Mac Os.
- To build tapyrus-core
Please follow the instructions in build-unix.md and build-osx.md to build tapyrus-core components - To build tapyrus-signer
Please follow the instructions in build tapyrus-signer to build tapyrus-signer
Pre-built Tapyrus binaries for the supported platforms namely Linux and Mac os are packaged from version 0.3.0 onwards.
You can download from here - v.0.3.0
- The package contains all the binaries needed to create a Tapyrus network.
- Binaries for older versions and other platforms need to be built from the source code. Please note that they have not been tested and are not guaranteed to work as expected.
One Tapyrus-core node can be started in dev mode for testing purposes.
- Create data directory. It is recommended to use a different data directory for each mode/network.
$ sudo mkdir /var/lib/tapyrus-dev
2 . Create a configuration file 'tapyrus.conf' with the following content
networkid=1905960821
dev=1
[dev]
server=1
keypool=1
discover=0
bind=127.0.0.1
-
Choose an elliptic curve private key and public key pair. These keys would serve as the 'aggregate public key' and 'aggregate private key' in dev mode.
-
Generate a new signed genesis block using tapyrus-genesis utility. Aggregate public key and its corresponsing private key are needed as command line options to generate a signed genesis block. Read Create new genesis block using tapyrus-genesis-utility section for more details.
./tapyrus-genesis -dev -time=1563342688 -address=mmtAurzUTURFq9MSizWyj5sAkWzgqR8PBn -signblockpubkey=03af80b90d25145da28c583359beb47b21796b2fe1a23c1511e443e7a64dfdb27d -signblockprivatekey=cUJN5RVzYWFoeY8rUztd47jzXCu1p57Ay8V7pqCzsBD3PEXN7Dd4
Tapyrus-genesis utility can generate a genesis block with a valid block proof. It is not recommended to use this feature in production mode. This feature should be used for testing only.
-
Start Tapyrus-core node with -dev option
/usr/local/bin/tapyrusd -dev -datadir=/var/lib/tapyrus-dev -conf=/etc/tapyrus/tapyrus.conf -
Import the private key into the wallet you plan to use for testing. Use 'importaddress' and 'importprivkey' RPCs to use the default wallet provided by Tapyrus-core.
-
Generate new blocks using 'generatetoaddress' RPC when using external wallet. 'generatetoaddress' or 'generate' RPC when using the default wallet. Tapyrus-core does not have the capability to generate blocks on its own. It relies on Tapyrus-signer network for block creation. In order to generate blocks in dev mode these RPCs need to be used.
tapyrus-cli -dev -networkid=1905960821 -datadir=/var/lib/tapyrus-dev -conf=/etc/tapyrus/tapyrus.conf -rpcport=17858 generatetoaddress 1 \"mmtAurzUTURFq9MSizWyj5sAkWzgqR8PBn\" \"cUJN5RVzYWFoeY8rUztd47jzXCu1p57Ay8V7pqCzsBD3PEXN7Dd4\"
generate and generatetoaddress RPCs can generate blocks with valid block proofs. Do not use these RPCs in production mode when the signer network is active as the node could diverge.
Block rewards can now be spent to create new transactions and proceed with testing.
👉 If you wish to start a new test network then follow the instructions in How to start a new tapyrus network?
Tapyrus software does not support a separate "testnet" mode. A new Tapyrus production, "prod" mode network with a different network Id can be created to be used as testnet.
In order to join the Chaintope's Tapyrus testnet with networkid 1939510133 it is enough to start a Tapyrus-core node (tapyrusd) on the host. Please follow the steps below:
-
Create data directory. It is recommended to use a different data directory for each network.
$ sudo mkdir /var/lib/tapyrus-testnet -
Create a configuration file 'tapyrus.conf' with the following content as
/etc/tapyrus/tapyrus.conf
networkid=1939510133
txindex=1
server=1
rest=1
rpcuser=user
rpcpassword=pass
rpcbind=0.0.0.0
rpcallowip=127.0.0.1
addseeder=static-seed.tapyrus.dev.chaintope.com
👉 As dns seeder is configurable in Tapyrus, addseeder=seed.tapyrus.dev.chaintope.com can be used to configure one or more seed nodes. seed.tapyrus.dev.chaintope.com is the dns seeder active on Tapyrus testnet. If no dns seeder is configured the node may not be able to identify other nodes in the network.
- Create 'genesis.' in data dir with the following content. This is the genesis block of the testnet
In this step, genesis. should be put as /var/lib/tapyrus-testnet/genesis.1939510133.
01000000000000000000000000000000000000000000000000000000000000000000000044cc181bd0e95c5b999a13d1fc0d193fa8223af97511ad2098217555a841b3518f18ec2536f0bb9d6d4834fcc712e9563840fe9f089db9e8fe890bffb82165849f52ba5e01210366262690cbdf648132ce0c088962c6361112582364ede120f3780ab73438fc4b402b1ed9996920f57a425f6f9797557c0e73d0c9fbafdebcaa796b136e0946ffa98d928f8130b6a572f83da39530b13784eeb7007465b673aa95091619e7ee208501010000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100f2052a010000002776a92231415132437447336a686f37385372457a4b6533766636647863456b4a74356e7a4188ac00000000
- Start 'tapyrusd' using the following command.
tapyrusd -daemon -datadir=/var/lib/tapyrus-testnet -conf=/etc/tapyrus/tapyrus.conf
- Call RPCs
tapyrus-cli -networkid=1939510133 -datadir=/var/lib/tapyrus-testnet -conf=/etc/tapyrus/tapyrus.conf getblockchaininfo
Verify the progress of initial block download in the new node using debug.log. The node is ready to accept transactions which would be written to the testnet blockchain. Please refer to how to get coins section to get testnet coins.
From Tapyrus version 0.4.0 onwards Tapyrus allows setting up new secure federated networks.
As Tapyrus is under active development it is recommended to use the network for testing and not as a commercial production deployment.
A minimum functional tapyrus network needs 3 Tapyrus-signers and 3 Tapyrus-core node for each signer. Following are the steps in launching a new Tapyrus-network:
- Define the federation members of the new Tapyrus network
- Choose a Network Id
- Generate Aggregate public key of Tapyrus-signer network
- Create a new genesis block using Tapyrus-genesis utility
- Generate genesis block proof using Tapyrus-signer network
- Start Tapyrus-core nodes
- Configure Tapyrus DNS seeder
- Start Tapyrus signer nodes
First, your federation should decide federation members. They are signer of each block and identified by a public key of their own. Next you should decide a threshold of agreements to propose block signature.
There are below restrictions:
- The federation consists minimum 3 signers. There is no maximum signers restriction, but it is not tested enough in case of more than 5 signers.
- The threshold must be more than two third of all signers.
Tapyrus network Ids are chosen such that the magic bytes generated from them do not occur in regular network traffic as Tapyrus relies on this to identify messages. The default network Id in production(prod) mode is 1 and development(dev) mode is 1905960821.
Follow the instructions in Generate Aggregate public key and Node secret share for Tapyrus-signer network - chaintope/tapyrus-signer.
Follow the instructions in Create new genesis block using tapyrus-genesis-utility
Recall that all blocks in Tapyrus are signed by the federation of Tapyrus-signers.
Follow the instructions in Generate genesis block proof - chaintope/tapyrus-signer
When the genesis block is ready, staring a Tapyrus-core node is straightforward.
-
Create data directory
$ sudo mkdir /var/lib/tapyrus -
Create a configuration file 'tapyrus.conf' with the following content
networkid=721
txindex=1
server=1
rest=1
rpcuser=user
rpcpassword=pass
rpcbind=0.0.0.0
rpcallowip=127.0.0.1
addseeder=seed.tapyrus.n721.chaintope.com
👉 seed.tapyrus.n721.chaintope.com is the dns seeder on Tapyrus network with networkid=721. It must be configured using the instructions in section Configure Tapyrus DNS seeder
-
Copy 'genesis.' i.e. 'genesis.721 into data dir
/var/lib/tapyrus -
Before running, it's recommended that you create an RPC configuration file.
echo -e "rpcuser=bitcoinrpc\nrpcpassword=$(xxd -l 16 -p /dev/urandom)" > "/Users/${USER}/Library/Application Support/Tapyrus/tapyrus.conf"
chmod 600 "/Users/${USER}/Library/Application Support/Tapyrus/tapyrus.conf"
- Start 'tapyrusd' using the following command.
/usr/local/bin/tapyrusd -daemon -datadir=/var/lib/tapyrus -conf=/etc/tapyrus/tapyrus.conf
-
Restart tapyrus-signer nodes if necessary so that they can connect to tapyrus-core.
-
Monitor the progress of the blockchain using 'getblockchaininfo' RPC
$ tapyrus-cli -networkid=721 -rpcconnect=54.65.133.45 -rpcuser=user -rpcpassword=pass getblockchaininfo
👉 Please note that in order to run a tapyrus-core node on multiple networks, a sub directory with the name - e.g is created for each one inside the configured data directory. There can be multiple genesis files in the data directory, genesis.721. Tapyrus can associate the genesis file with the corresponding network id and directory.
Tapyrus seeder is used to crawl a Tapyrus network and maintain a reliable list of nodes in the network for easy lookup. One DNS seeder can be used to service one/multiple Tapyrus networks. Follow the instructions in Tapyrus Seeder repository to build dnsseeder.
Start dnsseeder for the Tapyrus network with 'networkid=721' using the following command:
./dnsseed -i 721 -h seed.tapyrus.n721.chaintope.com -n n721.chaintope.com -s <initial_seed_node>
-s option is used to configure the initial_seed_node, a node to be used as the seed node when dnsseeder is started for the first time on the network. It may be a Tapyrus core node or another dnsseed node. It is optional after the first run.
Each federation member need to keep running tapyrus-signerd process on their environment to produce blocks constantly. Referring How To configure Tapyrus Signer Network, create configuration file for tapyrus-signerd and run it.
Tapyrus-genesis utility is packaged with tapyrus v.0.3.0. It can generate a basic unsigned genesis block. Time argument gives the block time. Aggregate public key of the Tapyrus-signer network can be given as an argument. Address is the tapyrus-address to which the block reward is paid. The output of this command is a block hex. Copy this into a file named 'genesis.'
Example:
tapyrus-genesis -time=1563342688 -address=mmtAurzUTURFq9MSizWyj5sAkWzgqR8PBn -signblockpubkey=03af80b90d25145da28c583359beb47b21796b2fe1a23c1511e443e7a64dfdb27d
If there is a need for a custom genesis block in your test, creating and using it is not restricted. As long as the custom genesis block is signed and satisfies Tapyrus consensus rules, the block is accepted and the blockchain would progress.
Tapyrus testnet faucet can be used to get testnet coins.
As of version 0.3.0, Tapyrus is a product under active development / testing. It is necessary to reset the network (including testnet) with each release until a network upgrade mechanism is made available in later versions.
Block proof is the threshold signature on every Tapyrus block. It is generated by the Tapyrus-signer network using Pedersen's verifiable secret sharing scheme.