From d061370e5f63ea7d6663703daa67cbc90d6c1487 Mon Sep 17 00:00:00 2001 From: kayryu Date: Thu, 17 Nov 2022 11:35:40 +0800 Subject: [PATCH] initialize docs --- README.md | 21 +++++++++ configs/db.toml | 8 ++++ configs/key.toml | 13 ++++++ configs/monitor.toml | 105 +++++++++++++++++++++++++++++++++++++++++++ configs/watcher.toml | 25 +++++++++++ docker-compose.yml | 77 +++++++++++++++++++++++++++++++ 6 files changed, 249 insertions(+) create mode 100644 README.md create mode 100644 configs/db.toml create mode 100644 configs/key.toml create mode 100644 configs/monitor.toml create mode 100644 configs/watcher.toml create mode 100644 docker-compose.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..b12cd91 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# BOOLNetwork scripts + +## Instructions + +Before Getting Started, Check at [Intel© Ark](https://ark.intel.com/content/www/us/en/ark.html#@Processors) that your processor is [Intel© SGX](https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/overview.html) compatible. + +## BOOLNetwork & Docker + +Clone the repo. + +```bash +git clone https://github.com/boolnetwork/mining-scripts.git +``` + +Run with docker-compose + +```bash +docker-compose up -d +``` + +More details about the config. [tee](https://boolnetwork.github.io/docs/developer/tee) diff --git a/configs/db.toml b/configs/db.toml new file mode 100644 index 0000000..071a020 --- /dev/null +++ b/configs/db.toml @@ -0,0 +1,8 @@ +port = 8710 +num_workers = 20 +db_path = "/bnk/data" +token = "" + +[options] +create_if_missing = true +atomic_flush = true diff --git a/configs/key.toml b/configs/key.toml new file mode 100644 index 0000000..4642982 --- /dev/null +++ b/configs/key.toml @@ -0,0 +1,13 @@ +version = 1 +port = 8730 +executors = 2 +db_url = "http://127.0.0.1:8710" +msg_pool_url = "http://127.0.0.1:8720" +db_token = "" +cert_path = "../servers/test-ca/ca.cert" +round_time_limit = 60 +clear_msg_interval = 180 +time_check_interval = 30 +retry_interval = 10 +retry_times = 2 +max_conn = 250 diff --git a/configs/monitor.toml b/configs/monitor.toml new file mode 100644 index 0000000..da4df97 --- /dev/null +++ b/configs/monitor.toml @@ -0,0 +1,105 @@ +port = 8740 +database_url = "bnk/data/sqlite.db" +notified_url = "http://localhost:8750/event" + +[[endpoints]] +chain_id = 5 +name = "goerli" +http_url = "https://rpc.goerli.dev" +private_key = "0x0000000000000000000000000000000000000000000000000000000000000000" + +[[endpoints]] +chain_id = 80001 +name = "mumbai" +http_url = "https://polygontestapi.terminet.io/rpc" +private_key = "0x0000000000000000000000000000000000000000000000000000000000000000" + +[[endpoints]] +chain_id = 420 +name = "optimism" +http_url = " https://goerli.optimism.io" +private_key = "0x0000000000000000000000000000000000000000000000000000000000000000" + +[[sources]] +named = "broadcaster" +tag = "" +kind = "Contract" +backend = "mumbai" +address = "0x58F7616FF46De73197C6f79049f6387954223451" + +[sources.watcher] +enabled = true +polling_interval = 20000 +max_step = 1000 +begin_height = 29177100 + +[[sources]] +named = "factory" +tag = "" +kind = "Contract" +backend = "mumbai" +address = "0x4d0c3b2bb15a114C6cBfa531BdeF9050809658B5" + +[sources.watcher] +enabled = true +polling_interval = 20000 +max_step = 1000 +begin_height = 29177100 + +[[sources]] +named = "broadcaster" +tag = "" +kind = "Contract" +backend = "optimism" +address = "0x97543Bb9ab8BA62Aa60F596f84792f5766dd2765" + +[sources.watcher] +enabled = true +polling_interval = 20000 +max_step = 1000 +begin_height = 2723200 + +[[sources]] +named = "factory" +tag = "" +kind = "Contract" +backend = "optimism" +address = "0x120F373F6b843A49D9103593a691F07571f6B11E" + +[sources.watcher] +enabled = true +polling_interval = 20000 +max_step = 1000 +begin_height = 2723200 + +[[sources]] +named = "broadcaster" +tag = "" +kind = "Contract" +backend = "goerli" +address = "0xf05467484fF502A94B7Aeb704A368B33B52c529c" + +[sources.watcher] +enabled = true +polling_interval = 20000 +max_step = 1000 +begin_height = 7961800 + +[[sources]] +named = "factory" +tag = "" +kind = "Contract" +backend = "goerli" +address = "0x914FfCA8E10776a7d92305BCE2Be23B4f682Ab04" + +[sources.watcher] +enabled = true +polling_interval = 20000 +max_step = 1000 +begin_height = 7961800 + +[default_watcher] +enabled = true +polling_interval = 30000 +max_step = 2000 +begin_height = 0 \ No newline at end of file diff --git a/configs/watcher.toml b/configs/watcher.toml new file mode 100644 index 0000000..5a4e5fc --- /dev/null +++ b/configs/watcher.toml @@ -0,0 +1,25 @@ +# local msg_pool server port. +msg_pool_port = 8720 +# local node url for watcher +node_ws_url = "ws://127.0.0.1:9944" +# local database url for data storage. +db_url = "http://127.0.0.1:8710" +# local database token for database usage. +db_token = "" +# local sgx key server url +key_server_url = "https://localhost:8730" +# used to generate LocalKeyStore, used to get AccountId in substrate. +identity = "0x0000000000000000000000000000000000000000000000000000000000000000" +# Notifies relayer of the event +relayer_server_url = "http://localhost:8750" +# seconds per block +block_time = 3 +# blocks per epoch +epoch_duration = 200 + +[network_config] +port = 38700 +boot_nodes = ["/ip4/20.3.233.7/tcp/38700/p2p/12D3KooWEZopB8nMuMGFT24LrkGzxCEkwUpY4w5mgY78biy8ZiU5"] +peer_key = "0x683740824cb70c50393d3fd7fe42e57df444ca93b62051f291d0ee3c71d88148" +share_peer_interval = 30 +only_global_ips = true \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a5a14e7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,77 @@ +version: "3" +services: + bnk-node: + image: boolnetwork/bnk-node:latest + ports: + - "9933:9933" + - "9944:9944" + - "30333:30333" + environment: + RUST_LOG: info + volumes: + - ./node-data:/data" + command: | + --unsafe-rpc-external + --unsafe-ws-external + --rpc-cors all + + bnk-database: + image: boolnetwork/bnk-database:latest + network_mode: "host" + # ports: + # - "8710:8710" + environment: + RUST_LOG: info + volumes: + - ./configs/db.toml:/bnk/db.toml + - ./data:/bnk/data + + bnk-watcher: + image: boolnetwork/bnk-watcher:latest + network_mode: "host" + # ports: + # - "8720:8720" + environment: + RUST_LOG: info + volumes: + - ./configs/watcher.toml:/bnk/watcher.toml + depends_on: + - bnk-database + + bnk-sgx-key-server: + image: boolnetwork/bnk-sgx-key-server:latest + network_mode: "host" + # ports: + # - "8730:8730" + environment: + RUST_LOG: info + volumes: + - ./configs/key.toml:/bnk/key.toml + devices: + - /dev/sgx/enclave + - /dev/sgx/provision + depends_on: + - bnk-watcher + + bnk-monitor: + image: boolnetwork/bnk-monitor:latest + network_mode: "host" + # ports: + # - "8740:8740" + environment: + RUST_LOG: warn,info=bnk_monitor + volumes: + - ./configs/monitor.toml:/bnk/monitor.toml + - ./data/:/bnk/data + + bnk-relayer: + image: boolnetwork/bnk-relayer:latest + network_mode: "host" + # ports: + # - "8750:8750" + environment: + RUST_LOG: debug + command: | + -w=http://127.0.0.1:8720 + -m=http://127.0.0.1:8740 + -p=8750 \ No newline at end of file