Skip to content

Commit

Permalink
Add deployment testnet and mainnet (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
phucnguyenit authored Jun 20, 2024
1 parent e74a83d commit 19f07a8
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 0 deletions.
37 changes: 37 additions & 0 deletions deployment/mainnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Prerequisites
Install Docker following the installation guide for Linux OS: [https://docs.docker.com/engine/installation/](https://docs.docker.com/engine/installation/)
* [CentOS](https://docs.docker.com/install/linux/docker-ce/centos)
* [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu)

Install docker compose
* [Docker compose](https://docs.docker.com/compose/install/)

Build dependencies
* [Network](https://docs.u2u.xyz/network/build-dependencies)
* [Create validator wallet](https://docs.u2u.xyz/network/run-validator-node/mainnet-validator-node#create-a-validator-wallet)

### Buiding image

```
cd <path>/go-u2u
make NET=mainnet u2u-image
```

### Configuration
```
Update password wallet in "/etc/password"
Go to <path>/go-u2u/deployment/mainnet
Update config in docker-compose.yml:
validator.id <id>
validator.pubkey <pubkey>
bootnodes <bootnodes>
```

### Running node
```
docker compose up -d
```

### Logging
````
docker logs -f --tail 10 u2u
34 changes: 34 additions & 0 deletions deployment/mainnet/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3'
services:
node:
image: u2u:latest
container_name: u2u
restart: always
volumes:
- ./data:/root/.u2u
- ../../mainnet.g:/mainnet.g
- /etc/password:/password
ports:
- 30303:30303
- 30303:30303/udp
- 19090:19090
logging:
driver: "json-file"
options:
max-size: 300m
command:
--genesis /mainnet.g
--gcmode full
--genesis.allowExperimental
--cache 3875
--port 30303
--http
--http.addr="0.0.0.0"
--http.port=8545
--http.corsdomain="*"
--http.vhosts="*"
--validator.id <id>
--validator.pubkey <pubkey>
--validator.password /password
--bootnodes <bootnodes>
--monitor
36 changes: 36 additions & 0 deletions deployment/testnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Prerequisites
Install Docker following the installation guide for Linux OS: [https://docs.docker.com/engine/installation/](https://docs.docker.com/engine/installation/)
* [CentOS](https://docs.docker.com/install/linux/docker-ce/centos)
* [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu)

Install docker compose
* [Docker compose](https://docs.docker.com/compose/install/)

Build dependencies
* [Network](https://docs.u2u.xyz/network/build-dependencies)
* [Create validator wallet](https://docs.u2u.xyz/network/run-validator-node/testnet-validator-node#create-a-validator-wallet)

### Buiding image
```
cd <path>/go-u2u
make NET=testnet u2u-image
```

### Configuration
```
Update password wallet in "/etc/password"
Go to <path>/go-u2u/deployment/testnet
Update config in docker-compose.yml:
validator.id <id>
validator.pubkey <pubkey>
bootnodes <bootnodes>
```

### Running node
```
docker compose up -d
```

### Logging
````
docker logs -f --tail 10 u2u
34 changes: 34 additions & 0 deletions deployment/testnet/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3'
services:
node:
image: u2u:latest
container_name: u2u
restart: always
volumes:
- ./data:/root/.u2u
- ../../testnet.g:/testnet.g
- /etc/password:/password
ports:
- 30303:30303
- 30303:30303/udp
- 19090:19090
logging:
driver: "json-file"
options:
max-size: 300m
command:
--genesis /testnet.g
--gcmode full
--genesis.allowExperimental
--cache 3875
--port 30303
--http
--http.addr="0.0.0.0"
--http.port=8545
--http.corsdomain="*"
--http.vhosts="*"
--validator.id <id>
--validator.pubkey <pubkey>
--validator.password /password
--bootnodes <bootnodes>
--monitor

0 comments on commit 19f07a8

Please sign in to comment.