- 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
bindAddress
ininternal/pkg/config/ethereum.yaml
to: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
bindAddress
ininternal/pkg/config/ethereum.yaml
to: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.go
as you want, note that increasing in MaxPaths and MaxHops will result in larger complexity. Recommend to useMaxHops = 5
andMaxPaths = 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
MathPaths
andMaxHops
as 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.db
file at root project directory. You should install SQLite Extension to view/query.