Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
docs: update README (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason Gao authored Sep 21, 2021
1 parent d81dafe commit 4a8240a
Showing 1 changed file with 42 additions and 16 deletions.
58 changes: 42 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ There are two config files corresponding to mainnet and testnet located in `./de
| center_id | The data center id. | null |
| machine_id | The machine id. | null |
| indexer_mode | Use indexer mode or not. | null |
| need_sync | Need synchronization parallelly or not. | True |
| need_sync | Need synchronization parallelly or not. | true |
| rpc_thread_number | The number of threads allocated to rpc. | 2 |
| flush_tx_pool_cache_interval | Flush transaction pool cache interval. | 300 |
| | | |
Expand All @@ -43,29 +43,29 @@ There are two config files corresponding to mainnet and testnet located in `./de
| db_type | Database type. | null |
| db_host | The database host. | null |
| db_port | The database port. | null |
| Db_name | The database name. | null |
| db_name | The database name. | null |
| db_user | The database user. | null |
| Password | The database password. | null |
| password | The database password. | null |
| db_path | The RocksDB path. | null |
| db_log_level | The database log level. | null |
| cellbase_maturity | The epoch required for cellbase maturity. | 4 |
| cheque_timeout | The epoch that reciever should claim cheque cell. | 6 |
| | | |
| Network_config | | |
| network_config | | |
| network_type | The Ckb type that mercury connected. | "ckb" |
| ckb_uri | The Ckb node uri. | "http://127.0.0.1:8114" |
| listen_uri | The mercury listening uri. | "127.0.0.1:8116" |
| | | |
| Sync_config | | |
| sync_block_batch_size | The block batch size in synchronization. | Null |
| Max_task_count | The maximum task count in thread pool. | Null |
| sync_config | | |
| sync_block_batch_size | The block batch size in synchronization. | null |
| max_task_count | The maximum task count in thread pool. | null |
| | | |
| Log_config | | |
| log_config | | |
| log_level | The mercury log level. | "INFO" |
| log_path | The path where the log file is stored. | "console" |
| use_split_file | Split log file or not. | False |
| use_split_file | Split log file or not. | false |
| | | |
| Builtin_scripts | The builtin script information. | null |
| builtin_scripts | The builtin script information. | null |

### Run Mercury

Expand All @@ -83,25 +83,51 @@ Edit the database config in config file. If you want to run via Docker, you shou
- connect a ckb mainnet node

```shell
mercury -c devtools/config/mainnet_config.toml run
$ mercury -c devtools/config/mainnet_config.toml run
```

- connect a ckb testnet node

```shell
mercury -c devtools/config/testnet_config.toml run
$ mercury -c devtools/config/testnet_config.toml run
```

##### Run via Docker
###### Running mercury development environment

```shell
docker-compose up -d
- step1
Modify mercury to synchronize the execution environment of ckb.

- step2
Modify the runtime environment of ckb like this:

```yml
environment:
CKB_NETWORK: mainnet
```
or
```yml
environment:
CKB_NETWORK: testnet
```
- step3
```shell
$ docker-compose up -d
```

###### Run a mercury application via docker

- step1
```shell
$ docker build -t mercury .
```

- step2
```shell
docker run -d -p 8116:8116 -v {user_config_path}:/app/devtools/config mercury:latest
$ docker run -d -p 8116:8116 -v {user_config_path}:/app/devtools/config mercury:latest
```

#### 3. Call mercury rpc via ckb-sdk ([java](https://github.com/nervosnetwork/ckb-sdk-java) ,[go](https://github.com/nervosnetwork/ckb-sdk-go) )
#### 3. Call mercury rpc via ckb-sdk ([java](https://github.com/nervosnetwork/ckb-sdk-java) , [go](https://github.com/nervosnetwork/ckb-sdk-go))

0 comments on commit 4a8240a

Please sign in to comment.