- Go 1.17+
- Redis
From the root folder of the project:
- Ensure that redis server which run in localhost has existing find route data crawled from ethereum-network scanners.
- Note that this quickstart guide is used only for Ethereum mainnet network
- Clone project
git clone https://github.com/KyberNetwork/kyberswap-aggregator
go mod download- Edit
bindAddressininternal/pkg/config/ethereum.yamlto:8081 - Run project
go run ./cmd/app -c internal/pkg/config/ethereum.yaml api- Clone project
git clone -b fix/find-route-algorithm https://github.com/KyberNetwork/kyberswap-aggregator
go mod download- Edit
bindAddressininternal/pkg/config/ethereum.yamlto:8080 - Run project
go run ./cmd/app -c internal/pkg/config/ethereum.yaml api- Clone project
git clone https://github.com/datluongductuan/benchmark-findroute-algorithms
go mod download- Edit parameters in
internal/pkg/entity/constants.goas you want, note that increasing in MaxPaths and MaxHops will result in larger complexity. Recommend to useMaxHops = 5andMaxPaths = 2, this config will give good result when run withamountIn <= 100ETH - Edit parameters in new-algorithm-project at step 4 (project kyberswap-aggreagator, branch fix/find-route-algorithm)
- In service/route.go, line 628 and 630, edit value of
MathPathsandMaxHopsas same as the edited values at Step 8.
go run ./cmd/main.go Note that every time you changed config at Step 8 and Step 9, you need to restart new-algortihm-project.
- Result will save in
test.dbfile at root project directory. You should install SQLite Extension to view/query.