Skip to content

Commit

Permalink
Merge pull request #11 from cryptape/gpBlockchain-patch-1
Browse files Browse the repository at this point in the history
Update test.py
  • Loading branch information
15168316096 authored Sep 9, 2024
2 parents a402bf9 + b76d333 commit 334407d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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:123456@127.0.0.1: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

0 comments on commit 334407d

Please sign in to comment.