godwokenrises / godwoken-kicker

one line command to start godwoken-polyjuice chain.
19 stars 24 forks source link

feat: Auto deposit zero address when start #348

Closed classicalliu closed 1 year ago

classicalliu commented 1 year ago

Run ./kicker start when zero address account not exists

:> docker-compose -f docker/docker-compose.yml up -d --build

Creating network "docker_default" with the default driver
Creating docker_ckb_1       ... done
Creating docker_redis_1                          ... done
Creating docker_ckb-miner_1 ... done
Creating docker_postgres_1                       ... done
Creating docker_check-ckb-started-successfully_1 ... done
Creating docker_ckb-indexer_1                    ... done
Creating docker_godwoken_1                       ... done
Creating docker_godwoken-readonly_1              ... done
Creating docker_web3_1                           ... done
Creating docker_web3-indexer_1                   ... done
[start] Services started successfully
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   224  100    38  100   186  38000   181k --:--:-- --:--:-- --:--:--  218k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   268  100   142  100   126   138k   123k --:--:-- --:--:-- --:--:--  261k
[try_deposit_zero_address] Zero address account id not found, deposit ...
Creating docker_godwoken_run ... done
2023-03-01T14:08:17.263846Z  INFO gw_tools::deposit_ckb: eth address: 0x0000000000000000000000000000000000000000
2023-03-01T14:08:17.263987Z  INFO gw_tools::deposit_ckb: layer2 script hash: 0x2adae9b0d2e7d9348b33f0ef40e619aa330746b1ac8ea6caadab7f16ee56ca97

2023-03-01T14:08:17.273937Z  INFO gw_tools::deposit_ckb: script hash: 0x2adae9b0d2e7d9348b33f0ef40e619aa330746b1ac8ea6caadab7f16ee56ca97
2023-03-01T14:08:17.274745Z  INFO gw_tools::deposit_ckb: balance before deposit: 0
2023-03-01T14:08:17.949318Z  INFO gw_tools::deposit_ckb: tx_hash: 0xeaa52313902379944fadf95967e03a99bcde947f691a3793610047786abce355
2023-03-01T14:08:17.949773Z  INFO gw_rpc_client::ckb_client: waiting for transaction, status: Pending
2023-03-01T14:08:20.951732Z  INFO gw_rpc_client::ckb_client: waiting for transaction, status: Pending
2023-03-01T14:08:23.953717Z  INFO gw_rpc_client::ckb_client: waiting for transaction, status: Pending
2023-03-01T14:08:26.955546Z  INFO gw_rpc_client::ckb_client: waiting for transaction, status: Pending
2023-03-01T14:08:29.957302Z  INFO gw_rpc_client::ckb_client: waiting for transaction, status: Pending
2023-03-01T14:08:32.960556Z  INFO gw_rpc_client::ckb_client: waiting for transaction, status: Proposed
2023-03-01T14:08:35.962285Z  INFO gw_rpc_client::ckb_client: waiting for transaction, status: Proposed
2023-03-01T14:08:38.964083Z  INFO gw_rpc_client::ckb_client: waiting for transaction, status: Proposed
2023-03-01T14:08:41.964588Z  INFO gw_rpc_client::ckb_client: transaction committed
2023-03-01T14:08:43.965062Z  INFO gw_tools::deposit_ckb: current balance: 0, waiting for 2 secs.
2023-03-01T14:08:45.965494Z  INFO gw_tools::deposit_ckb: current balance: 0, waiting for 4 secs.
2023-03-01T14:08:47.966003Z  INFO gw_tools::deposit_ckb: current balance: 0, waiting for 6 secs.
2023-03-01T14:08:49.966622Z  INFO gw_tools::deposit_ckb: current balance: 0, waiting for 8 secs.
2023-03-01T14:08:51.967387Z  INFO gw_tools::deposit_ckb: current balance: 1000000000000000000000, waiting for 10 secs.
2023-03-01T14:08:51.967421Z  INFO gw_tools::deposit_ckb: deposit success!
2023-03-01T14:08:51.967615Z  INFO gw_tools::deposit_ckb: Your account id: 5
[try_deposit_zero_address] Zero address deposit succeed.

Run ./kicker start next time

:> docker-compose -f docker/docker-compose.yml up -d --build

Creating network "docker_default" with the default driver
Creating docker_redis_1     ... done
Creating docker_ckb-miner_1 ... done
Creating docker_ckb_1       ... done
Creating docker_postgres_1  ... done
Creating docker_check-ckb-started-successfully_1 ... done
Creating docker_ckb-indexer_1                    ... done
Creating docker_godwoken_1                       ... done
Creating docker_godwoken-readonly_1              ... done
Creating docker_web3_1                           ... done
Creating docker_web3-indexer_1                   ... done
[start] Services started successfully
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   288  100   102  100   186    99k   181k --:--:-- --:--:-- --:--:--  281k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   227  100    39  100   188  39000   183k --:--:-- --:--:-- --:--:--  221k
[try_deposit_zero_address] Zero address already deposited.