Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouop0 committed Jan 8, 2025
1 parent ad8bf5e commit 4a5709f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 8 deletions.
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# Interopbackend

this project is an interop-explorer backend.
this project is an interop-explorer backend.

Mainly listens to the events from L2ToL2CrossDomainMessenger and CrossL2Inbox, and then writes the data to the database.
And determine whether a block includes cross-chain transactions based on the ExecutingMessage event of the CrossL2Outbox
contract.

contract:
```azure

Check failure on line 10 in README.md

View workflow job for this annotation

GitHub Actions / Run markdown-lint

Fenced code blocks should be surrounded by blank lines [Context: "```azure"]
- L2ToL2CrossDomainMessenger: 0x4200000000000000000000000000000000000023
```

Check failure on line 12 in README.md

View workflow job for this annotation

GitHub Actions / Run markdown-lint

Fenced code blocks should be surrounded by blank lines [Context: "```"]
events:
```azure

Check failure on line 14 in README.md

View workflow job for this annotation

GitHub Actions / Run markdown-lint

Fenced code blocks should be surrounded by blank lines [Context: "```azure"]
event SentMessage(uint256 indexed destination, address indexed target,
uint256 indexed messageNonce, address sender, bytes message);
event RelayedMessage(uint256 indexed source, uint256 indexed messageNonce,
bytes32 indexed messageHash);
```

contract:
```

Check failure on line 23 in README.md

View workflow job for this annotation

GitHub Actions / Run markdown-lint

Fenced code blocks should be surrounded by blank lines [Context: "```"]
- CrossL2Inbox: 0x4200000000000000000000000000000000000022
```

Check failure on line 25 in README.md

View workflow job for this annotation

GitHub Actions / Run markdown-lint

Fenced code blocks should be surrounded by blank lines [Context: "```"]
events:
```azure

Check failure on line 27 in README.md

View workflow job for this annotation

GitHub Actions / Run markdown-lint

Fenced code blocks should be surrounded by blank lines [Context: "```azure"]
event ExecutingMessage(bytes32 indexed msgHash, Identifier id);
```

## Install preperation: Supersim

Follow [this guide](https://github.com/ethereum-optimism/supersim/blob/main/README.md) or [supersim](https://github.com/ethereum-optimism/supersim) to install supersim.

## run the project

```azure
./deploy/start.sh
```

## stop this project

```azure
./deploy/stop.sh
```
14 changes: 7 additions & 7 deletions internal/blockchain/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ func TestRemoveContract(t *testing.T) {
// 0000000000000000000000004200000000000000000000000000000000000028 target
// 0000000000000000000000000000000000000000000000000000000000000000 messageNonce
// 0000000000000000000000004200000000000000000000000000000000000028 sender
// 0000000000000000000000000000000000000000000000000000000000000040 偏移量
// 0000000000000000000000000000000000000000000000000000000000000084 长度
// 0000000000000000000000000000000000000000000000000000000000000040 offset
// 0000000000000000000000000000000000000000000000000000000000000084 length
// 7cfd6dbc000000000000000000000000420beef000000000000000000000000000000001000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000 message
// sendMessage payloadMsg : 382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f3200000000000000000000000000000000000000000000000000000000000000386000000000000000000000000420000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000847cfd6dbc000000000000000000000000420beef000000000000000000000000000000001000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000
// 也就是sendMessage 的calldata数据
// sendMessage calldata
func TestHashL2toL2CrossDomainMessage(t *testing.T) {
logs := "382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f3200000000000000000000000000000000000000000000000000000000000000386000000000000000000000000420000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000847cfd6dbc000000000000000000000000420beef000000000000000000000000000000001000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000"
s := crypto.Keccak256(common.Hex2Bytes(logs))
Expand All @@ -44,7 +44,7 @@ func TestHashL2toL2CrossDomainMessage(t *testing.T) {
fmt.Println(sendMessageEvent.EventHash().Hex())
}

//// 来自sendMessage event data数据 也就是relayMessage _sentMessage数据
//// sendMessage event data relayMessage _sentMessage
//382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f320 selector
//0000000000000000000000000000000000000000000000000000000000000386 destination
//0000000000000000000000000000000000000000000000000000000000000385 source
Expand Down Expand Up @@ -110,11 +110,11 @@ func TestHashCody(t *testing.T) {
// 0000000000000000000000004200000000000000000000000000000000000028 target
// 0000000000000000000000000000000000000000000000000000000000000000 messageNonce
// 0000000000000000000000004200000000000000000000000000000000000028 sender
// 0000000000000000000000000000000000000000000000000000000000000040 偏移量
// 0000000000000000000000000000000000000000000000000000000000000084 长度
// 0000000000000000000000000000000000000000000000000000000000000040 offset
// 0000000000000000000000000000000000000000000000000000000000000084 length
// 7cfd6dbc000000000000000000000000420beef000000000000000000000000000000001000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000 message
// sendMessage payloadMsg : 382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f3200000000000000000000000000000000000000000000000000000000000000386000000000000000000000000420000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000847cfd6dbc000000000000000000000000420beef000000000000000000000000000000001000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000
// 也就是sendMessage 的calldata数据
// sendMessage calldata
func TestSendMsg(t *testing.T) {
payload := "382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f3200000000000000000000000000000000000000000000000000000000000000386000000000000000000000000420000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000847cfd6dbc000000000000000000000000420beef000000000000000000000000000000001000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000"

Expand Down

0 comments on commit 4a5709f

Please sign in to comment.