|
1 | 1 | # FAIRNode |
2 | 2 |
|
3 | | -This repository contains the Docker setup for running a FairCoin node. FairCoin is a cryptocurrency that focuses on fairness and sustainability. |
| 3 | +Docker image for running a FairCoin v3.0.0 full node. |
4 | 4 |
|
5 | | -## Prerequisites |
| 5 | +Builds faircoind from source and runs it in a minimal Debian 12 container. |
| 6 | + |
| 7 | +## Requirements |
6 | 8 |
|
7 | 9 | - Docker |
8 | | -- Docker Compose (optional, for managing multi-container Docker applications) |
9 | 10 |
|
10 | | -## Getting Started |
| 11 | +## Quick Start |
11 | 12 |
|
12 | | -### Clone the Repository |
| 13 | +### Build the image |
13 | 14 |
|
14 | | -```sh |
15 | | -git clone https://github.com/FairCoinOfficial/FAIRNode.git |
16 | | -cd FAIRNode |
17 | | -``` |
| 15 | + git clone https://github.com/FairCoinOfficial/FAIRNode.git |
| 16 | + cd FAIRNode |
| 17 | + docker build -t faircoin-node . |
18 | 18 |
|
19 | | -### Build the Docker Image |
| 19 | +### Run the node |
20 | 20 |
|
21 | | -```sh |
22 | | -docker build -t faircoin-node . |
23 | | -``` |
| 21 | + docker run -d \ |
| 22 | + --name faircoin-node \ |
| 23 | + --restart unless-stopped \ |
| 24 | + -p 46372:46372 \ |
| 25 | + -v faircoin-data:/home/faircoin/.faircoin \ |
| 26 | + faircoin-node |
24 | 27 |
|
25 | | -### Create Configuration File |
| 28 | +On first run, the entrypoint generates a faircoin.conf with a random RPC password |
| 29 | +and prints it to the logs: |
26 | 30 |
|
27 | | -Create a configuration file for the FairCoin node with the necessary RPC credentials and settings: |
| 31 | + docker logs faircoin-node | head |
28 | 32 |
|
29 | | -```sh |
30 | | -mkdir -p ~/.faircoin |
31 | | -echo "rpcuser=faircoinrpc" > ~/.faircoin/faircoin.conf |
32 | | -echo "rpcpassword=your_secure_password" >> ~/.faircoin/faircoin.conf |
33 | | -echo "server=1" >> ~/.faircoin/faircoin.conf |
34 | | -``` |
| 33 | +### Verify the node is running |
35 | 34 |
|
36 | | -Replace `your_secure_password` with a strong, unique password. |
| 35 | + docker exec -it faircoin-node faircoin-cli getinfo |
37 | 36 |
|
38 | | -### Run the Docker Container |
| 37 | +## Configuration |
39 | 38 |
|
40 | | -```sh |
41 | | -docker run -d -p 53472:53472 -v ~/.faircoin:/root/.faircoin --name faircoin-node faircoin-node |
42 | | -``` |
| 39 | +### Use your own faircoin.conf |
43 | 40 |
|
44 | | -This command will run the FairCoin node in a Docker container with the necessary ports exposed and configuration mounted. |
| 41 | +Mount a custom config file: |
45 | 42 |
|
46 | | -### Verify Node is Running |
| 43 | + docker run -d \ |
| 44 | + --name faircoin-node \ |
| 45 | + -p 46372:46372 \ |
| 46 | + -v /path/to/your/faircoin.conf:/home/faircoin/.faircoin/faircoin.conf \ |
| 47 | + -v faircoin-data:/home/faircoin/.faircoin \ |
| 48 | + faircoin-node |
47 | 49 |
|
48 | | -You can verify that the node is running by checking the container logs: |
| 50 | +### Expose the RPC port |
49 | 51 |
|
50 | | -```sh |
51 | | -docker logs -f faircoin-node |
52 | | -``` |
| 52 | +By default only the P2P port (46372) is exposed. To allow RPC access from outside |
| 53 | +the container, add -p 127.0.0.1:46373:46373 (bind to localhost only for security). |
53 | 54 |
|
54 | | -## Configuration |
| 55 | +## Network Parameters |
55 | 56 |
|
56 | | -The configuration file `faircoin.conf` should be located in the `~/.faircoin` directory. You can customize this file with additional settings as needed. The default configuration includes: |
| 57 | +| | | |
| 58 | +|---|---| |
| 59 | +| Mainnet P2P port | 46372 | |
| 60 | +| Mainnet RPC port | 46373 | |
| 61 | +| Testnet P2P port | 46374 | |
| 62 | +| Testnet RPC port | 46375 | |
57 | 63 |
|
58 | | -```ini |
59 | | -rpcuser=faircoinrpc |
60 | | -rpcpassword=your_secure_password |
61 | | -server=1 |
62 | | -``` |
| 64 | +## Commands |
63 | 65 |
|
64 | | -## Troubleshooting |
| 66 | + # View logs |
| 67 | + docker logs -f faircoin-node |
65 | 68 |
|
66 | | -If you encounter any issues, please check the logs of the Docker container: |
| 69 | + # Run CLI commands |
| 70 | + docker exec -it faircoin-node faircoin-cli getinfo |
| 71 | + docker exec -it faircoin-node faircoin-cli getblockcount |
67 | 72 |
|
68 | | -```sh |
69 | | -docker logs faircoin-node |
70 | | -``` |
| 73 | + # Stop / start |
| 74 | + docker stop faircoin-node |
| 75 | + docker start faircoin-node |
71 | 76 |
|
72 | | -## Contributing |
| 77 | + # Remove (keeps data volume) |
| 78 | + docker rm -f faircoin-node |
73 | 79 |
|
74 | | -Contributions are welcome! Please open an issue or submit a pull request with any improvements or fixes. |
| 80 | +## Data Persistence |
75 | 81 |
|
76 | | -## License |
| 82 | +Blockchain data is stored in the faircoin-data Docker volume. To back it up: |
77 | 83 |
|
78 | | -This project is licensed under the MIT License. See the LICENSE file for details. |
| 84 | + docker run --rm \ |
| 85 | + -v faircoin-data:/data \ |
| 86 | + -v $(pwd):/backup \ |
| 87 | + alpine tar czf /backup/faircoin-backup.tar.gz -C /data . |
79 | 88 |
|
80 | | -## Acknowledgments |
| 89 | +## Links |
81 | 90 |
|
82 | | -- [FairCoin Official Repository](https://github.com/FairCoinOfficial/FairCoin) |
83 | | -- Docker |
| 91 | +- [FairCoin main repository](https://github.com/FairCoinOfficial/FairCoin) |
| 92 | +- [FairCoin Explorer](https://github.com/FairCoinOfficial/Explorer) |
| 93 | +- [Website](https://fairco.in) |
| 94 | + |
| 95 | +## License |
| 96 | + |
| 97 | +MIT |
0 commit comments