generated from KyberNetwork/go-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TRD-573 using tradelog as struct, add dockerfile & readme
- Loading branch information
1 parent
02656de
commit a2867e2
Showing
23 changed files
with
281 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
## This is service to indexing tradelogs from event | ||
|
||
### Re-generate mock file | ||
|
||
First, you need to install `mockery` | ||
|
||
- https://vektra.github.io/mockery/latest/installation/ | ||
- https://github.com/vektra/mockery | ||
|
||
Then you use the `mockery` to generate mock files from interface | ||
|
||
``` | ||
mockery --dir=<interface directory> --name=<interface name> --output=<output dir> --structname=<name of output struct> --filename=<output filename> | ||
``` | ||
|
||
Example: generate `Storage` interface to a struct name `MockStorage` | ||
|
||
``` | ||
mockery --dir=v2/pkg/storage/state --name=Storage --output=v2/mocks/ --structname=MockState --filename=State.go | ||
``` | ||
|
||
For more information `mockery --help` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package constant | ||
|
||
const ( | ||
ExZeroX = "zerox" | ||
EXZeroXV3 = "zeroxV3" | ||
ExParaswap = "paraswap" | ||
ExTokenlon = "tokenlon" | ||
ExZeroXRFQ = "zerox_rfq" | ||
ExKs = "kyberswap" | ||
ExHashflow = "hashflow" | ||
ExKsRFQ = "kyberswapRFQ" | ||
Ex1Inch = "1inch" | ||
Ex1InchV6 = "1inchV6" | ||
ExHashflowV3 = "hashflowV3" | ||
ExParaswapTaker = "paraswap_taker" | ||
ExUniswapX = "uniswapx" | ||
ExNative = "native" | ||
ExBebop = "bebop" | ||
ExUniswapXV1 = "uniswapxV1" | ||
|
||
Addr1InchV6 = "0x111111125421cA6dc452d289314280a0f8842A65" | ||
AddrBebop = "0xbbbbbBB520d69a9775E85b458C58c648259FAD5F" | ||
AddrHashflowV3 = "0x24b9d98FABF4DA1F69eE10775F240AE3dA6856fd" | ||
AddrKyberswap = "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5" | ||
AddrKyberswapRFQ = "0x7A819Fa46734a49D0112796f9377E024c350FB26" | ||
AddrParaswap = "0xe92b586627ccA7a83dC919cc7127196d70f55a06" | ||
AddrUniswapX = "0x00000011F84B9aa48e5f8aA8B9897600006289Be" | ||
AddrUniswapXV1 = "0x6000da47483062A0D734Ba3dc7576Ce6A0B645C4" | ||
Addr0x = "0xDef1C0ded9bec7F1a1670819833240f027b25EfF" | ||
Deployer0xV3 = "0x00000000000004533Fe15556B1E086BB1A72cEae" | ||
|
||
TableZeroX = "tradelogs_zerox" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package kafka | ||
|
||
type Config struct { | ||
Addresses []string | ||
|
||
UseAuthentication bool | ||
Username string | ||
Password string | ||
} | ||
|
||
type Message struct { | ||
Type MessageType `json:"type"` | ||
Data interface{} `json:"data"` | ||
} | ||
|
||
type MessageType string | ||
|
||
const ( | ||
MessageTypeTradeLog MessageType = "trade_log" | ||
MessageTypeRevert MessageType = "revert" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.