Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test.py #11

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- name: curl
run: |
curl --location 'localhost:8114/' --header 'Content-Type: application/json' --data '{ "jsonrpc":"2.0","method":"get_tip_block_number", "params":[], "id":64}'
cd docker && docker-compose exec -T mysql mysql -uroot -p123456 -hmysql -P3306 demo -e 'SELECT * FROM found_blocks;'
cd docker && docker compose exec -T mysql mysql -uroot -p123456 -hmysql -P3306 demo -e 'SELECT * FROM found_blocks;'
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
container_name: kafka

ckb:
image: nervos/ckb:v0.118.0-rc1
image: nervos/ckb:v0.118.0-rc2
user: root
ports:
- 8114:8114 # rpc
Expand Down
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_tip_block_number(url):


# 启动 docker-compose
subprocess.run("cd docker && docker-compose up > docker-compose.log 2>&1 &", shell=True)
subprocess.run("cd docker && docker compose up > docker-compose.log 2>&1 &", shell=True)

# 启动 nodebridge
nodebridge_command = "RUST_LOG=info ./ckbNodeBridge/target/debug/nodebridge ckb --rpc_addr http://127.0.0.1:8114 --rpc_interval 3000 --kafka_brokers 127.0.0.1:9092 --db_url mysql://root:[email protected]:8006/demo --job_topic tominer --solved_share_topic tochain > ckbNodeBridge.log 2>&1 &"
Expand All @@ -45,7 +45,7 @@ def get_tip_block_number(url):

# 查询mysql数据库表found_blocks的所有信息
docker_compose_path = "docker"
mysql_command = f"docker-compose exec -T mysql mysql -uroot -p123456 -hmysql -P3306 demo -e 'SELECT * FROM found_blocks;'"
mysql_command = f"docker compose exec -T mysql mysql -uroot -p123456 -hmysql -P3306 demo -e 'SELECT * FROM found_blocks;'"
result = subprocess.check_output(mysql_command, shell=True, cwd=docker_compose_path)
print(result.decode('utf-8'))
tip_number = get_tip_block_number("http://localhost:8114/")
Expand Down
Loading