@ -3,18 +3,18 @@
## Docker Image
## Docker Image
You can choose to build the docker image using the included Dockerfile with the following command:
You can choose to build the docker image using the included Dockerfile with the following command:
```bash
```bash
docker build -t harmony-rosetta .
docker build -t harmonyone/explorer-node .
```
```
Or you can download/pull the image from dockerhub with the following command:
Or you can download/pull the image from dockerhub with the following command:
```bash
```bash
docker pull harmony-rosetta :latest
docker pull harmonyone/explorer-node :latest
```
```
## Starting the node
## Starting the node
You can start the node with the following command:
You can start the node with the following command:
```bash
```bash
docker run -d -p 9700:9700 -v "$(pwd)/data:/root/data" harmony-rosetta --run.shard=0
docker run -d -p 9700:9700 -v "$(pwd)/data:/root/data" harmonyone/explorer-node --run.shard=0
```
```
> This command will create the container of the harmony node on shard 0 in the detached mode,
> This command will create the container of the harmony node on shard 0 in the detached mode,
> binding port 9700 (the rosetta port) on the container to the host and mounting the shared
> binding port 9700 (the rosetta port) on the container to the host and mounting the shared
@ -29,21 +29,13 @@ docker ps
You can ensure that your node is running with the following curl command:
You can ensure that your node is running with the following curl command:
```bash
```bash
curl -X POST --data '{
curl -X POST --data '{
"network_identifier": {
"metadata": {}
"blockchain": "Harmony",
}' http://localhost:9700/network/list
"network": "Mainnet",
"sub_network_identifier": {
"network": "shard 0",
"metadata": {
"is_beacon": true
}
}
}}' http://localhost:9700/network/status
```
```
Once can start the node in the offline mode with the following command:
You can start the node in the offline mode with the following command:
```bash
```bash
docker run -d -p 9700:9700 -v "$(pwd)/data:/root/data" harmony-rosetta --run.shard=0 --run.offline
docker run -d -p 9700:9700 -v "$(pwd)/data:/root/data" harmonyone/explorer-node --run.shard=0 --run.offline
```
```
> The offline mode implies that the node will not connect to any p2p peer or sync.
> The offline mode implies that the node will not connect to any p2p peer or sync.
@ -66,33 +58,33 @@ docker stop [CONTAINER ID]
**Note that all the arguments provided when running the docker img are immediately forwarded to the harmony node binary.**
**Note that all the arguments provided when running the docker img are immediately forwarded to the harmony node binary.**
> Note that the following args are **appended** to the provided arg when running the image:
> Note that the following args are **appended** to the provided arg when running the image:
> `--http.ip "0.0.0.0" --ws.ip "0.0.0.0" --http.rosetta --node_type "explorer" --datadir "./data" --log.dir "./data/logs"` .
> `--http.ip "0.0.0.0" --ws.ip "0.0.0.0" --http.rosetta --node_type "explorer" --datadir "./data" --log.dir "./data/logs"` .
> This effectively makes them args that you cannot change.
> This effectively makes them args that you cannot easily change.
### Running the node on testnet
### Running the node on testnet
All the args on the image run are forwarded to the harmony node binary. Therefore, you can simply add `-n testnet` to
All the args on the image run are forwarded to the harmony node binary. Therefore, you can simply add `-n testnet` to
run the node for testnet. For example:
run the node for testnet. For example:
```bash
```bash
docker run -d -p 9700:9700 -v "$(pwd)/data:/root/data" harmony-rosetta --run.shard=0 -n testnet
docker run -d -p 9700:9700 -v "$(pwd)/data:/root/data" harmonyone/explorer-node --run.shard=0 -n testnet
```
```
### Running the node with the http RPC capabilities
### Running the node with the http RPC capabilities
Similar to running a node on testnet, once can simply add `--http` to enable the rpc server. Then you have to forward
Similar to running a node on testnet, once can simply add `--http` to enable the rpc server. Then you have to forward
the host port to the container's rpc server port.
the host port to the container's rpc server port.
```bash
```bash
docker run -d -p 9700:9700 -p 9500:9500 -v "$(pwd)/data:/root/data" harmony-rosetta --run.shard=0 -n testnet --http
docker run -d -p 9700:9700 -p 9500:9500 -v "$(pwd)/data:/root/data" harmonyone/explorer-node --run.shard=0 -n testnet --http
```
```
### Running the node with the web socket RPC capabilities
### Running the node with the web socket RPC capabilities
Similar to running a node on testnet, once can simply add `--ws` to enable the rpc server. Then you have to forward
Similar to running a node on testnet, once can simply add `--ws` to enable the rpc server. Then you have to forward
the host port to the container's rpc server port.
the host port to the container's rpc server port.
```bash
```bash
docker run -d -p 9700:9700 -p 9800:9900 -v "$(pwd)/data:/root/data" harmony-rosetta --run.shard=0 -n testnet --ws
docker run -d -p 9700:9700 -p 9800:9900 -v "$(pwd)/data:/root/data" harmonyone/explorer-node --run.shard=0 -n testnet --ws
```
```
### Running the node in non-archival mode
### Running the node in non-archival mode
One can append `--run.archive=false` to the docker run command to run the node in non-archival mode. For example:
One can append `--run.archive=false` to the docker run command to run the node in non-archival mode. For example:
```bash
```bash
docker run -d -p 9700:9700 -v "$(pwd)/data:/root/data" harmony-rosetta --run.shard=0 -n testnet --run.archive=false
docker run -d -p 9700:9700 -v "$(pwd)/data:/root/data" harmonyone/explorer-node --run.shard=0 -n testnet --run.archive=false
```
```
### Running a node with a rcloned DB
### Running a node with a rcloned DB
@ -100,7 +92,7 @@ Note that all node data will be stored in the `/root/data` directory within the
the `harmony_db_*` directory to some directory (i.e: `./data` ) and mount the volume on the docker run.
the `harmony_db_*` directory to some directory (i.e: `./data` ) and mount the volume on the docker run.
This way, the node will use DB in the volume that is shared between the container and host. For example:
This way, the node will use DB in the volume that is shared between the container and host. For example:
```bash
```bash
docker run -d -p 9700:9700 -v "$(pwd)/data:/root/data" harmony-rosetta --run.shard=0
docker run -d -p 9700:9700 -v "$(pwd)/data:/root/data" harmonyone/explorer-node --run.shard=0
```
```
Note that the directory structure for `/root/data` (== `./data` ) should look something like:
Note that the directory structure for `/root/data` (== `./data` ) should look something like: