From 62ac124054fe02c74666decba74af0cda7345e59 Mon Sep 17 00:00:00 2001 From: Barry Botha Date: Fri, 10 May 2024 16:56:55 +0300 Subject: [PATCH] major update after tests --- lite-node/README.md | 11 +++--- lite-node/docker-compose.yml | 4 +- ..._settings_user.toml => node_settings.toml} | 0 miner-node/docker-compose.yml | 24 +++--------- ...settings_miner.toml => node_settings.toml} | 2 +- miner-node/node_settings_user.toml | 11 ------ miner-nodes/docker-compose.yml | 32 +++++++++++++++ .../node_settings_miner_0.toml | 10 ++--- miner-nodes/node_settings_miner_1.toml | 17 ++++++++ miner-with-lite-node/README.md | 6 --- miner-with-lite-node/docker-compose.yml | 39 ------------------- 11 files changed, 68 insertions(+), 88 deletions(-) rename lite-node/{node_settings_user.toml => node_settings.toml} (100%) rename miner-node/{node_settings_miner.toml => node_settings.toml} (88%) delete mode 100644 miner-node/node_settings_user.toml create mode 100644 miner-nodes/docker-compose.yml rename miner-with-lite-node/node_settings.toml => miner-nodes/node_settings_miner_0.toml (52%) create mode 100644 miner-nodes/node_settings_miner_1.toml delete mode 100644 miner-with-lite-node/README.md delete mode 100644 miner-with-lite-node/docker-compose.yml diff --git a/lite-node/README.md b/lite-node/README.md index 85fddd8..79a045e 100644 --- a/lite-node/README.md +++ b/lite-node/README.md @@ -2,6 +2,7 @@ > Running docker on your machine will get you up and running quickly but should not be considered production level. > This requires a lot more orchestration that is not in scope of this document. +> This doc is still under development! There are docker images available at: * `ghcr.io/aiblockofficial/network/node-user:latest` @@ -18,9 +19,9 @@ AIBlock nodes use a `node_settings.toml` file for configuration. This is located in `/etc/node_settings.toml` and has to be mounted as the container starts. The sample settings file for a lite node can be found here: -* [user](node_settings_user.toml) +* [user](node_settings.toml) -They are currently referencing `testnet` +They are currently referencing `testnet`. ### Running docker directly @@ -29,14 +30,12 @@ docker run -d -p --name aiblock-user 3000:3000 \ -v /tmp/user:/src \ -v ./node_settings_user.toml:/etc/node_settings_user.toml \ -e ADDRESS="127.0.0.1:12340" \ --e WITH_USER_ADDRESS="127.0.0.1:12350" \ -ghcr.io/aiblockofficial/network/node-miner:latest user +ghcr.io/aiblockofficial/node-user:latest user ``` -* `-p 3000:3000` sets ports used for the miner's REST API. +* `-p 3000:3000` sets ports used for the lite node's REST API. * `-v /tmp/wallet:/src` mounts your local filesystem so the miner's wallet may be persisted. * `-e ADDRESS` sets the ip:port of the node. If more than one node will be running from the same IP address, the port number has to be different for each node. -* `-e WITH_USER_ADDRESS` also starts a user node with a wallet to hold the tokens. You might also need to run with `--user` on some Linux systems for mounting permission purposes. diff --git a/lite-node/docker-compose.yml b/lite-node/docker-compose.yml index c72fa25..446c549 100644 --- a/lite-node/docker-compose.yml +++ b/lite-node/docker-compose.yml @@ -6,8 +6,8 @@ services: - '12350:12350' - '3001:3001' volumes: - - /tmp/wallet:/src - - ./node_settings_user.toml:/etc/node_settings.toml + - /tmp/user-0:/src + - ./node_settings.toml:/etc/node_settings.toml command: user environment: - RUST_LOG = info,debug diff --git a/lite-node/node_settings_user.toml b/lite-node/node_settings.toml similarity index 100% rename from lite-node/node_settings_user.toml rename to lite-node/node_settings.toml diff --git a/miner-node/docker-compose.yml b/miner-node/docker-compose.yml index c5c91f1..a70d07a 100644 --- a/miner-node/docker-compose.yml +++ b/miner-node/docker-compose.yml @@ -4,26 +4,14 @@ services: image: ghcr.io/aiblockofficial/node-miner:latest ports: - '12340:12340' + - '12350:12350' - '3000:3000' volumes: - - /tmp/wallet:/src - - ./node_settings_miner.toml:/etc/node_settings.toml + - /tmp/miner-0:/src + - ./node_settings.toml:/etc/node_settings.toml command: miner environment: - - WITH_USER_ADDRESS = "127.0.0.1:12350" - - RUST_LOG = info,debug - ### uncomment for Linux - user: "${UID}:${GID}" - user-0: - image: ghcr.io/aiblockofficial/node-user:latest - ports: - - '12350:12350' - - '3001:3001' - volumes: - - /tmp/wallet:/src - - ./node_settings_user.toml:/etc/node_settings.toml - command: user - environment: - - RUST_LOG = info,debug + - WITH_USER_INDEX=0 + - RUST_LOG=info,debug ### uncomment for Linux - user: "${UID}:${GID}" \ No newline at end of file + #user: "${UID}:${GID}" \ No newline at end of file diff --git a/miner-node/node_settings_miner.toml b/miner-node/node_settings.toml similarity index 88% rename from miner-node/node_settings_miner.toml rename to miner-node/node_settings.toml index 60c6fc1..9915198 100644 --- a/miner-node/node_settings_miner.toml +++ b/miner-node/node_settings.toml @@ -8,7 +8,7 @@ address = "34.65.95.17:8116" # address = "34.65.95.17:8333" [[miner_nodes]] -address = "127.0.0.1:12360" +address = "127.0.0.1:12340" [[user_nodes]] address = "127.0.0.1:12350" \ No newline at end of file diff --git a/miner-node/node_settings_user.toml b/miner-node/node_settings_user.toml deleted file mode 100644 index 3942ad3..0000000 --- a/miner-node/node_settings_user.toml +++ /dev/null @@ -1,11 +0,0 @@ -user_db_mode = { Live = 0 } -user_api_port = 3001 - -[[mempool_nodes]] -# testnet -address = "34.65.95.17:9116" -# mainnet -# address = "34.65.95.17:9333" - -[[user_nodes]] -address = "127.0.0.1:12350" diff --git a/miner-nodes/docker-compose.yml b/miner-nodes/docker-compose.yml new file mode 100644 index 0000000..cbd2917 --- /dev/null +++ b/miner-nodes/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' +services: + miner-0: + image: ghcr.io/aiblockofficial/node-miner:latest + ports: + # - '12340:12340' + # - '12350:12350' + - '3000:3000' + volumes: + - /tmp/miner-0:/src + - ./node_settings_miner_0.toml:/etc/node_settings.toml + command: miner + environment: + - WITH_USER_INDEX=0 + - RUST_LOG=info,debug + ### uncomment for Linux + #user: "${UID}:${GID}" + miner-1: + image: ghcr.io/aiblockofficial/node-miner:latest + ports: + # - '12341:12341' + # - '12351:12351' + - '3001:3001' + volumes: + - /tmp/miner-1:/src + - ./node_settings_miner_1.toml:/etc/node_settings.toml + command: miner + environment: + - WITH_USER_INDEX=0 + - RUST_LOG=info,debug + ### uncomment for Linux + #user: "${UID}:${GID}" diff --git a/miner-with-lite-node/node_settings.toml b/miner-nodes/node_settings_miner_0.toml similarity index 52% rename from miner-with-lite-node/node_settings.toml rename to miner-nodes/node_settings_miner_0.toml index df899f0..55a8a81 100644 --- a/miner-with-lite-node/node_settings.toml +++ b/miner-nodes/node_settings_miner_0.toml @@ -2,16 +2,16 @@ miner_db_mode = { Live = 0 } miner_api_port = 3000 user_db_mode = { Live = 0 } -user_api_port = 3001 +user_api_port = 3000 [[mempool_nodes]] # testnet -address = "34.65.95.17:9116" +address = "34.65.95.17:8116" # mainnet -# address = "34.65.95.17:9333" +# address = "34.65.95.17:8333" [[miner_nodes]] -address = "172.28.0.4:12340" +address = "127.0.0.1:12342" [[user_nodes]] -address = "172.28.0.5:12350" +address = "127.0.0.1:12352" \ No newline at end of file diff --git a/miner-nodes/node_settings_miner_1.toml b/miner-nodes/node_settings_miner_1.toml new file mode 100644 index 0000000..ed98161 --- /dev/null +++ b/miner-nodes/node_settings_miner_1.toml @@ -0,0 +1,17 @@ +miner_db_mode = { Live = 0 } +miner_api_port = 3001 + +user_db_mode = { Live = 0 } +user_api_port = 3001 + +[[mempool_nodes]] +# testnet +address = "34.65.95.17:8116" +# mainnet +# address = "34.65.95.17:8333" + +[[miner_nodes]] +address = "127.0.0.1:12341" + +[[user_nodes]] +address = "127.0.0.1:12351" diff --git a/miner-with-lite-node/README.md b/miner-with-lite-node/README.md deleted file mode 100644 index a7749f5..0000000 --- a/miner-with-lite-node/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## A miner connected to a lite node - -To connect a miner with a lite node: - -1. Both nodes need to be in the `node_settings.toml` -2. The miner needs to start up with `WITH_USER_INDEX` referencing the index in `node_settings.toml`. In this example `0`. diff --git a/miner-with-lite-node/docker-compose.yml b/miner-with-lite-node/docker-compose.yml deleted file mode 100644 index 3e7d5eb..0000000 --- a/miner-with-lite-node/docker-compose.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: '3' -services: - miner-0: - image: ghcr.io/aiblockofficial/node-miner:latest - depends_on: - - user-0 - ports: - - '12340:12340' - - '3000:3000' - volumes: - - /tmp/miner:/src - - ./node_settings.toml:/etc/node_settings.toml - command: miner - environment: - - RUST_LOG = info,debug - - WITH_USER_INDEX = 0 - networks: - aiblock: - ipv4_address: 172.28.0.4 - user-0: - image: ghcr.io/aiblockofficial/node-user:latest - ports: - - '12350:12350' - - '3001:3001' - volumes: - - /tmp/user:/src - - ./node_settings.toml:/etc/node_settings.toml - command: user - environment: - - RUST_LOG = info,debug - networks: - aiblock: - ipv4_address: 172.28.0.5 -networks: - aiblock: - driver: bridge - ipam: - config: - - subnet: 172.28.0.0/24 \ No newline at end of file