|
| 1 | += Passive Node |
| 2 | + |
| 3 | +The passive Node is the most common type of node on the network, it doesn't create blocks and is mostly used for wallets, explorers or relays. |
| 4 | + |
| 5 | +In order to start the node, you first need to gather the blockchain information you need to connect to. |
| 6 | + |
| 7 | +1. the *hash* of the *genesis block* of the blockchain, this will be the source |
| 8 | + of truth of the blockchain. It is 64 hexadecimal characters. |
| 9 | +2. the *trusted peers* identifiers and access points. |
| 10 | +
|
| 11 | +The above information can be found at link:/luceo[luceo connection information]. |
| 12 | + |
| 13 | +This information is essential for the correct starting of your node. |
| 14 | + |
| 15 | +The *genesis block* is the first block of a blockchain. It contains |
| 16 | +static initialization parameters such as the initial funds. Your node |
| 17 | +will utilise the *hash* to retrieve the *genesis block* from the other peers. Once obtained |
| 18 | +the *hash* is used to verify the integrity of the downloaded *genesis block*. |
| 19 | + |
| 20 | +*Trusted peers* are public nodes in the network your node will |
| 21 | +trust in order to initialise participate in the Peer To Peer network. More details to come. |
| 22 | + |
| 23 | +== The node configuration |
| 24 | + |
| 25 | +Your node configuration file may look like the following: |
| 26 | + |
| 27 | +**Note** |
| 28 | + |
| 29 | +This config shouldn't work as it is, the ip address and port for the trusted peer should be those of an already running node. |
| 30 | +Also, the public_address ('u.x.v.t') should be a valid address (you can use an internal one, eg: 127.0.0.1). |
| 31 | +Furthermore, you need to have permission to write in the path specified by the storage config. |
| 32 | + |
| 33 | +[source, yaml] |
| 34 | +---- |
| 35 | +storage: "/mnt/luceo/storage" |
| 36 | +
|
| 37 | +rest: |
| 38 | + listen: "127.0.0.1:8443" |
| 39 | + prefix: "api" |
| 40 | +
|
| 41 | +peer_2_peer: |
| 42 | + trusted_peers: |
| 43 | + - id: 1 |
| 44 | + address: "/ip4/104.24.28.11/tcp/8299" |
| 45 | + public_access: "/ip4/u.v.x.y/tcp/8299" |
| 46 | + topics_of_interests: |
| 47 | + messages: low |
| 48 | + blocks: normal |
| 49 | +---- |
| 50 | + |
| 51 | +Field definitions: |
| 52 | + |
| 53 | +* *storage*: (optional) path to the storage. If omitted, the blockchain is stored in memory only. |
| 54 | +* *logger*: (optional) logger configuration, |
| 55 | + ** *verbosity*: 0 - warning, 1 - info, 2 -debug, 3 and above - trace |
| 56 | + ** *format*: log output format - plain or json. |
| 57 | + ** *output*: log output - stderr, syslog (unix only) or journald (linux with systemd only, must be enabled during compilation) |
| 58 | +* *rest*: (optional) configuration of the rest endpoint. |
| 59 | + ** *listen*: listen address |
| 60 | + ** *pkcs12*: certificate file (optional) |
| 61 | + ** *prefix*: (optional) api prefix |
| 62 | +* *peer_2_peer*: the P2P network settings |
| 63 | + ** *trusted_peers*: (optional) the list of nodes to connect to in order to bootstrap the p2p topology (and bootstrap our local blockchain); |
| 64 | + ** *public_id*: (optional) the public identifier send to the other nodes in the p2p network. If not set it will be randomly generated. |
| 65 | + ** *public_access*: the address to listen from and accept connection from. This is the public address that will be distributed to other peers of the network that may find interest into participating to the blockchain dissemination with the node; |
| 66 | + ** *topics_of_interests*: the different topics we are interested to hear about: |
| 67 | + *** *messages*: notify other peers this node is interested about transactions typical setting for a non mining node: `"low"`. For a stakepool: `"high"`; |
| 68 | + *** *blocks*: notify other peers this node is interested about new blocks. typical settings for a non mining node: `"normal"`. For a stakepool: `"high"`; |
| 69 | + |
| 70 | +== Starting the node |
| 71 | + |
| 72 | +[source, bash] |
| 73 | +---- |
| 74 | +jormungandr --config config.yaml --genesis-block-hash 'abcdef987654321....' |
| 75 | +---- |
| 76 | + |
| 77 | +The 'abcdef987654321....' part refers to the hash of the genesis, that should be given to you from one of the peers in the network you are connecting to. |
| 78 | + |
| 79 | +In case you have the genesis file (for example, because you are creating the network) you can get this hash with jcli. |
| 80 | + |
| 81 | +[source, bash] |
| 82 | +---- |
| 83 | +cat block-0 | jcli genesis hash |
| 84 | +---- |
| 85 | + |
| 86 | +or, in case you only have the yaml file |
| 87 | + |
| 88 | +[source, bash] |
| 89 | +---- |
| 90 | +cat genesis.yaml | jcli genesis encode | jcli genesis hash |
| 91 | +---- |
0 commit comments