Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-cha committed Nov 19, 2024
1 parent 8ea22b1 commit 11be233
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To ensure compatibility with the node version, check the following versions:

| L1 Node | MiniMove | MiniWasm | MiniEVM |
| ------- | -------- | -------- | ------- |
| v0.6.1+ | v0.6.3+ | v0.6.3+ | v0.6.6+ |
| v0.6.1+ | v0.6.4+ | v0.6.4+ | v0.6.7+ |

### Build and Configure

Expand Down
79 changes: 59 additions & 20 deletions executor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ To configure the Executor, fill in the values in the `~/.opinit/executor.json` f
}
```

### Oracle config
If the oracle is enabled, the `oracle_bridge_executor` field must be set. The oracle data is stored in the 0th tx of each L1 block. The bridge executor submits a `MsgUpdateOracle` containing the 0th Tx of l1 block to l2 when a block in l1 is created.

The `oracle_bridge_executor` must be an account that has received the authz grant from the executor. If it is not set, you can set the authz with the command below.
```bash
opinitd tx grant-oracle [oracle-account-address]
```

### Start height config examples

If the latest height stored in the db is not 0, start height config is ignored.
Expand Down Expand Up @@ -329,13 +337,18 @@ curl localhost:3000/status

```json
{
"bridge_id": 1,
"bridge_id": 0,
"host": {
"node": {
"last_block_height": 0,
"broadcaster": {
"pending_txs": 0,
"sequence": 0
"accounts_status": [
{
"address": "",
"sequence": 0
}
]
}
},
"last_proposed_output_index": 0,
Expand All @@ -346,7 +359,16 @@ curl localhost:3000/status
"last_block_height": 0,
"broadcaster": {
"pending_txs": 0,
"sequence": 0
"accounts_status": [
{
"address": "",
"sequence": 0
},
{
"address": "",
"sequence": 0
}
]
}
},
"last_updated_oracle_height": 0,
Expand All @@ -360,7 +382,7 @@ curl localhost:3000/status
},
"batch": {
"node": {
"last_block_height": 0,
"last_block_height": 0
},
"batch_info": {
"submitter": "",
Expand All @@ -374,7 +396,12 @@ curl localhost:3000/status
"da": {
"broadcaster": {
"pending_txs": 0,
"sequence": 0
"accounts_status": [
{
"address": "",
"sequence": 0
}
]
}
}
}
Expand All @@ -389,20 +416,32 @@ initiad tx ophost finalize-token-withdrawal ./withdrawal-info.json --gas= --gas-

```go
type QueryWithdrawalResponse struct {
// fields required to withdraw funds
BridgeId uint64 `json:"bridge_id"`
OutputIndex uint64 `json:"output_index"`
WithdrawalProofs [][]byte `json:"withdrawal_proofs"`
Sender string `json:"sender"`
Sequence uint64 `json:"sequence"`
Amount string `json:"amount"`
Version []byte `json:"version"`
StorageRoot []byte `json:"storage_root"`
LatestBlockHash []byte `json:"latest_block_hash"`

// extra info
BlockNumber int64 `json:"block_number"`
Receiver string `json:"receiver"`
WithdrawalHash []byte `json:"withdrawal_hash"`
Sequence uint64 `json:"sequence"`
To string `json:"to"`
From string `json:"from"`
Amount types.Coin `json:"amount"`
OutputIndex uint64 `json:"output_index"`
BridgeId uint64 `json:"bridge_id"`
WithdrawalProofs [][]byte `json:"withdrawal_proofs"`
Version []byte `json:"version"`
StorageRoot []byte `json:"storage_root"`
LastBlockHash []byte `json:"last_block_hash"`
}
```

```bash
curl localhost:3000/withdrawals/{address}
```
default options
- `limit`: 10
- `offset`: 0
- `order`: desc


```go
type QueryWithdrawalsResponse struct {
Withdrawals []QueryWithdrawalResponse `json:"withdrawals"`
Next uint64 `json:"next"`
Total uint64 `json:"total"`
}
```

0 comments on commit 11be233

Please sign in to comment.