release: kitabu chain v0.1.0

This commit is contained in:
Mohamed Sohail 2022-02-05 12:50:01 +03:00
commit 363de8601d
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
8 changed files with 361 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
openethereum/.env
openethereum/key
openethereum/data
openethereum/password
devops/caddy

61
README.md Normal file
View File

@ -0,0 +1,61 @@
## Kitabu Chain
### Prerequisites
_This step assumes you have root access on a Debian or Ubuntu based host OS_
```bash
$ apt get update
$ apt install chrony curl git
$ curl -fsSL https://get.docker.com | bash
$ curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose
```
### Validator node setup
#### 1. Clone this repo
```bash
$ git clone https://git.grassecon.net/grassrootseconomics/kitabu-chain
$ cd kitabu chain
```
#### 2. Obtain your private key
If you have an existing keystore file, rename it to `key` else create a new one:
```bash
$ openethereum account new --base-path=$(pwd)
$ mv keys/ethereum/UTC* ./key
$ rm -rf keys
```
Save the password of the key created above in a `password` file. Save the key's public address for the next step.
#### 3. Setup environmental variables and other configs
```bash
cp .env.example .env
```
Edit the `.env` file:
- `EXT_IP`: Your server's external IP (`curl ifconfig.me`)
- `ACCOUNT`: Your private key's public address
Edit `docker-compose.yml` or `kitabu.toml` to tweak the Openethereum config as per your own preferences.
#### 4. Start the validator node
```bash
$ docker-compose up
# or...
$ docker-compose up -d
```
#### 5. Reverse proxy setup
The `devops` folder contains a Caddy config to use as a reverse proxy to further control access to your validator node's API.
Replace `.yourdomain` in the `Caddyfile` and point it to your server IP.

12
devops/Caddyfile Normal file
View File

@ -0,0 +1,12 @@
rpc.yourdomain {
reverse_proxy openethereum:8545
}
ws.yourdomain {
@websockets {
header Connection *Upgrade*
header Upgrade websocket
}
reverse_proxy @websockets openethereum:8546
}

17
devops/docker-compose.yml Normal file
View File

@ -0,0 +1,17 @@
version: '3.9'
services:
caddy:
restart: unless-stopped
container_name: caddy
image: caddy:2-alpine
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./caddy/data:/data
ports:
- '80:80'
- '443:443'
networks:
- openethereum_kitabu
networks:
openethereum_kitabu:
external: true

View File

@ -0,0 +1,2 @@
EXT_IP=
ACCOUNT=

View File

@ -0,0 +1,37 @@
version: '3.9'
services:
openethereum:
init: true
user: root
restart: unless-stopped
container_name: kitabu-openethereum
image: openethereum/openethereum:v3.3.3
command:
--config=/root/kitabu.toml
--nat='extip:$EXT_IP'
--engine-signer='$ACCOUNT'
--jsonrpc-port=8545
--jsonrpc-cors=all
--jsonrpc-interface=all
--jsonrpc-hosts=all
--jsonrpc-apis=web3,eth,net,parity
--ws-port=8546
--ws-interface=all
--ws-hosts=all
volumes:
- ./key:/root/data/keys/kitabu_sarafu/key
- ./kitabu.json:/root/kitabu.json
- ./kitabu.toml:/root/kitabu.toml
- ./password:/root/password
- ./data:/root/data
expose:
- '8545'
- '8546'
ports:
- '30303:30303'
- '30303:30303/udp'
networks:
- kitabu
networks:
kitabu:
driver: bridge

205
openethereum/kitabu.json Normal file

File diff suppressed because one or more lines are too long

22
openethereum/kitabu.toml Normal file
View File

@ -0,0 +1,22 @@
[parity]
chain = "/root/kitabu.json"
base_path = "/root/data"
[network]
max_peers = 25
snapshot_peers = 10
[account]
password = ["/root/password"]
[mining]
reseal_on_txs = "none"
force_sealing = true
min_gas_price = 1
gas_floor_target = "1"
[footprint]
tracing = "on"
pruning = "archive"
pruning_history = 256
cache_size_db = 2000