Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working Relayer for Other chain -> MultiversX calls & MultiversX -> other chain #10

Merged
merged 37 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
aed8861
Update proto file definition.
raress96 Jun 10, 2024
76016bf
Update abi and classes to gateway v2 integration. Start working on up…
raress96 Jun 10, 2024
60f1290
Fix all tests and full update for Gateway V2.
raress96 Jun 11, 2024
57d941b
Update dependencies.
raress96 Jun 11, 2024
c85228c
Update error message.
raress96 Jun 19, 2024
67c7399
Refactor grpc verify to keep stream open.
raress96 Jun 27, 2024
a4aed05
Refactoring and fix tests for new grpc verify.
raress96 Jun 28, 2024
15ba736
Merge pull request #9 from multiversx/gateway_v2
raress96 Jul 3, 2024
e5b9cf3
Working axelar event processor and other chain -> MultiversX flow.
raress96 Jul 12, 2024
243a843
Update tests.
raress96 Jul 12, 2024
ddd39f4
Fix call to getPayload.
raress96 Jul 18, 2024
0172dfc
Working mvx to other chain event processing with log index support.
raress96 Aug 20, 2024
267be8f
Add tests for new event index support.
raress96 Aug 21, 2024
08781c3
Fix tests.
raress96 Aug 23, 2024
603f71b
Merge pull request #11 from multiversx/event_index_support
raress96 Aug 23, 2024
a940cfa
Remove grpc axelar api and change to rest gmp api. Get project to com…
raress96 Aug 30, 2024
ffd1414
Process tasks in approvals processor service.
raress96 Aug 30, 2024
20162c3
Handle events and send them to the gmp api.
raress96 Aug 30, 2024
39ac6ca
Refactor gateway and gas service processor. Handle all gas service ev…
raress96 Sep 2, 2024
2c6cd37
Remove unneded database entries.
raress96 Sep 2, 2024
e51fe45
Start working on tests.
raress96 Sep 2, 2024
b5d36fd
Fix existing tests and add new ones after refactoring to use axelar g…
raress96 Sep 4, 2024
af68f75
Working GMP API calls.
raress96 Sep 6, 2024
90e698e
Use base64 encoding for payload.
raress96 Sep 6, 2024
8bfa078
Update message executed event.
raress96 Sep 9, 2024
ce4dd19
Merge pull request #12 from multiversx/axelar_gmp_api_integration
raress96 Sep 11, 2024
05f234e
Fix relayer getting stuck if transaction returns error.
raress96 Sep 12, 2024
e5db7d4
Fix lint for e2e tests.
raress96 Sep 12, 2024
82fc7b1
Handle verify and refund tasks. Improvements for logging and small im…
raress96 Sep 26, 2024
cb4c9e0
Implement gas cost reporting to Amplifier API. Implement reporting of…
raress96 Sep 26, 2024
b4f84ec
Fix pipeline.
raress96 Sep 26, 2024
c505ba6
Merge pull request #13 from multiversx/gas_and_verify
raress96 Sep 30, 2024
20cb777
Take into account esdt issue cost as fee in case of its execute.
raress96 Oct 1, 2024
7ca3b38
Handle signers rotated event and updates.
raress96 Nov 15, 2024
0359052
handle all todos and check available gas fees before sending transact…
raress96 Nov 18, 2024
02920ba
Update gateway events after new abi and use v2 of cannot execute mess…
raress96 Nov 20, 2024
f17dc6d
Merge pull request #14 from multiversx/verify_worker_set_and_gas
raress96 Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ REDIS_URL=127.0.0.1
EVENTS_NOTIFIER_URL=amqp://user:password@rabbitmq:5672
EVENTS_NOTIFIER_QUEUE=queue

CONTRACT_GATEWAY=erd1qqqqqqqqqqqqqpgqhxy6dv9k5p3u4d6rawnwjyp0j3sunu9dkklspga3t9
CONTRACT_GAS_SERVICE=erd1qqqqqqqqqqqqqpgqsrhknrwuvy606ar5l2kuaz4glgyyye9vkkls5ng86g
CONTRACT_ITS=erd1qqqqqqqqqqqqqpgqw08zahneragk9rnaujwe8qcyu84ehw2lkklsvca0jx
CONTRACT_GATEWAY=erd1qqqqqqqqqqqqqpgqvkhh6ex5m0sl0rgxn5790ljsscye0r48kkls7hrlaw
CONTRACT_GAS_SERVICE=erd1qqqqqqqqqqqqqpgq8fmglw6pngxsczmpa0kr3904shnclzsukklsjeykne
CONTRACT_ITS=erd1qqqqqqqqqqqqqpgqcv3rhjjrqpl88es4q25lw03hfhpw6s36kklsn6t9a6

CONTRACT_WEGLD_SWAP=erd1qqqqqqqqqqqqqpgqpv09kfzry5y4sj05udcngesat07umyj70n4sa2c0rp

AXELAR_CONTRACT_VOTING_VERIFIER=axelar1gajw625kz8el4ayk8fwpy7r6ew0m7zrg9jdd6grg85fle39shuxqwuaz2k

AXELAR_API_URL=devnet-amplifier-api.axelar.dev:11235
AXELAR_GMP_API_URL=https://amplifier-devnet-amplifier.devnet.axelar.dev

CHAIN_ID=D

WALLET_MNEMONIC=

CLIENT_CERT=
CLIENT_KEY=

ENABLE_GAS_CHECK=1
7 changes: 6 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ CONTRACT_WEGLD_SWAP=erd1qqqqqqqqqqqqqpgqhe8t5jewej70zupmh44jurgn29psua5l2jps3ntj

AXELAR_CONTRACT_VOTING_VERIFIER=axelar1jjtc5zemkt9tn6nfvk78xl6f8svrrsvyqcdcca

AXELAR_API_URL=localhost:5000
AXELAR_GMP_API_URL=localhost:5000

CHAIN_ID=test

# erd1fsk0cnaag2m78gunfddsvg0y042rf0maxxgz6kvm32kxcl25m0yq8s38vt
WALLET_MNEMONIC="fitness horror fluid six mutual ahead upon zone install stadium shuffle arrive caution flat slam machine wasp steel stand frog exist drink market absent"

CLIENT_CERT=test
CLIENT_KEY=test

ENABLE_GAS_CHECK=1
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
},
rules: {
"@typescript-eslint/no-explicit-any": ["off"],
"@typescript-eslint/no-unused-vars": ["off"],
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/ban-ts-comment": ["off"],
"@typescript-eslint/no-empty-function": ["off"],
"@typescript-eslint/ban-types": ["off"],
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- run: npm ci
- run: npm run lint

- run: npm run generate
- run: npm run test

- run: npm install -g dotenv-cli
Expand Down
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Based on Amplifier API Docs: https://bright-ambert-2bd.notion.site/Amplifier-API

1. Redis Server is required to be installed [docs](https://redis.io/).
2. PostgreSQL is required to be installed [docs](https://www.postgresql.org/).
3. For E2E tests you need dotenv-cli `npm install -g dotenv-cli`

In this repo there is a `docker-compose.yml` file providing these services so you can run them easily using `docker-compose up -d`

Expand All @@ -29,24 +30,6 @@ $ npm run test:e2e
$ npm run test:cov
```

## Regenerating gRPC Typescript interfaces from proto file
## Regenerating Typescript interfaces from OpenApi schema file

Make sure to have `protoc` installed https://grpc.io/docs/protoc-installation/.

Then you can compile the files using:
```
TS_ARGS=('lowerCaseServiceMethods=true'
'outputEncodeMethods=false'
'outputJsonMethods=false'
'outputClientImpl=false'
'snakeToCamel=true')
protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto\
--ts_proto_out=./libs/common/src/grpc/entities\
--proto_path=./libs/common/src/assets\
--ts_proto_opt="$(IFS=, ; echo "${TS_ARGS[*]}")"\
./libs/common/src/assets/amplifier.proto
```

Check out these resources for more information:
- https://github.com/stephenh/ts-proto/blob/main/NESTJS.markdown
- https://blog.stackademic.com/nestjs-grpc-typescript-codegen-9a342bbd32f9
`npx openapicmd typegen ./libs/common/src/assets/axelar-gmp-api.schema.yaml > ./libs/common/src/api/entities/axelar.gmp.api.d.ts`
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Module } from '@nestjs/common';
import { ApiConfigModule, DynamicModuleUtils } from '@mvx-monorepo/common';
import { ApiConfigModule, DatabaseModule, DynamicModuleUtils } from '@mvx-monorepo/common';
import { ApprovalsProcessorService } from './approvals.processor.service';
import { GrpcModule } from '@mvx-monorepo/common/grpc/grpc.module';
import { ApiModule } from '@mvx-monorepo/common/api/api.module';
import { ContractsModule } from '@mvx-monorepo/common/contracts/contracts.module';
import { ScheduleModule } from '@nestjs/schedule';

Expand All @@ -10,8 +10,9 @@ import { ScheduleModule } from '@nestjs/schedule';
ScheduleModule.forRoot(),
ApiConfigModule,
DynamicModuleUtils.getRedisCacheModule(),
GrpcModule,
ApiModule,
ContractsModule,
DatabaseModule,
],
providers: [ApprovalsProcessorService],
})
Expand Down
Loading