Connect full node to mainnet
Running a full node with Docker
For connecting to the mainnet, firstly generate a peer_id file. The hathor-core project offers a simple tool for obtaining such a file:
docker run hathornetwork/hathor-core gen_peer_id > peer_id.json
The ID of your peer will be in the key id
inside the generated JSON (peer_id.json
), e.g., "id": "6357b155b0867790bd92d1afe3a9afe3f91312d1ea985f908cac0f64cbc9d5b2".
Then, you can use this id in any server or client through the --peer
parameter. Assuming this file has been moved to ~/hathor-data
directory, the following command runs the full node connecting to the mainnet and in a docker container:
docker run -ti -p 8080:8080 -v ~/hathor-data:/data:consistent hathornetwork/hathor-core run_node --cache --status 8080 --data /data --peer /data/peer_id.json
Before using the peer_id to connect to the mainnet, send the generated id to a team member. You can get in touch with us through our channels, preferrably Discord.
Running a full node from source code
For connecting to the mainnet, firstly clone the hathor-core project. All next commands must be run from the folder hathor-core
created by the clone operation. First, generate a peer_id
file:
poetry run hathor-cli gen_peer_id > peer_id.json
The ID of your peer will be in the key id
inside the generated JSON (peer_id.json
), e.g. "id": "6357b155b0867790bd92d1afe3a9afe3f91312d1ea985f908cac0f64cbc9d5b2"
.
Then, you can use this id in any server or client through the--peer
parameter. For instance:
poetry run hathor-cli run_node --listen tcp:8000 --peer peer_id.json --data /data
Before using the peer_id
to connect to the mainnet, send the generated id
to a team member. You can get in touch with us through our channels, preferrably Discord.