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

Merge master into feat sovereign 9 oct 2024 #299

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
cdefbff
change indexing mechanism for cross shard transfer
miiu96 Jun 5, 2024
fe9e1c8
empty line
miiu96 Jun 5, 2024
d7c8bb2
fix integration tests
miiu96 Jun 5, 2024
6c5d2db
extra integration test
miiu96 Jun 5, 2024
6608ee8
Merge pull request #281 from multiversx/change-indexing-mechanism-for…
miiu96 Jun 6, 2024
eeeeebf
esdt improvements integration
miiu96 Jun 13, 2024
e6d3af5
fix integration tests
miiu96 Jun 13, 2024
53fb5cd
fixes
miiu96 Jun 13, 2024
b21ce82
fixes
miiu96 Jun 13, 2024
9588363
MetaData recreate
miiu96 Jun 17, 2024
7afaf28
esdt new features
miiu96 Jun 18, 2024
731bdda
fix linter
miiu96 Jun 19, 2024
0514345
latest vm common
miiu96 Jun 19, 2024
95104d5
contract address in topics
miiu96 Jul 3, 2024
1e2203e
Merge pull request #282 from multiversx/esdt-improvements
miiu96 Jul 3, 2024
bda0024
Merge branch 'rc/v1.7.next1' into delegator-processor-contract-addres…
miiu96 Jul 3, 2024
92d6b30
relayed v3 integration
miiu96 Jul 8, 2024
f59580a
fix unit tests
miiu96 Jul 8, 2024
e7f4007
fix linter issues
miiu96 Jul 8, 2024
e632bc2
new mappings in transaction and operation index
miiu96 Jul 8, 2024
643032a
comments
miiu96 Jul 8, 2024
51838a7
Merge pull request #284 from multiversx/delegator-processor-contract-…
miiu96 Jul 12, 2024
6ec7a77
Merge branch 'rc/v1.7.next1' into relayed-v3-integration-and-multi-tr…
miiu96 Jul 16, 2024
98808ec
fixes after review
miiu96 Jul 16, 2024
7b36851
Merge branch 'master' of https://github.com/multiversx/mx-chain-es-in…
sstanculeanu Jul 25, 2024
b3457c5
updated deps after merge
sstanculeanu Jul 25, 2024
9532aae
Merge pull request #287 from multiversx/merge_master_into_rc17next1_2…
sstanculeanu Jul 25, 2024
eaa70a3
updated deps
sstanculeanu Jul 29, 2024
dd63bad
Merge branch 'refs/heads/rc/v1.7.next1' into relayed-v3-integration-a…
miiu96 Jul 29, 2024
9f42664
Merge pull request #285 from multiversx/relayed-v3-integration-and-mu…
sstanculeanu Jul 29, 2024
51bea3e
Merge branch 'rc/v1.7.next1' into update_deps
sstanculeanu Jul 29, 2024
d697c76
Merge pull request #288 from multiversx/update_deps
sstanculeanu Jul 29, 2024
70ffce2
- added docker build action
iulianpascalau Jul 30, 2024
30bfcb3
Merge branch 'master' into docker-build-action
iulianpascalau Jul 30, 2024
ecd8f49
Merge pull request #289 from multiversx/docker-build-action
iulianpascalau Jul 30, 2024
275fccc
- fixed docker build
iulianpascalau Jul 30, 2024
be66982
Merge branch 'master' into fix-docker-build-action
iulianpascalau Jul 30, 2024
a399afb
Merge pull request #290 from multiversx/fix-docker-build-action
iulianpascalau Jul 30, 2024
3392d77
- fixed docker build
iulianpascalau Jul 30, 2024
e9ac399
Merge branch 'master' into fix-docker-build-action-2
iulianpascalau Jul 30, 2024
0e39df8
Merge pull request #291 from multiversx/fix-docker-build-action-2
iulianpascalau Jul 30, 2024
b1cd805
fix transaction status
miiu96 Aug 7, 2024
4f2f595
extra check
miiu96 Aug 7, 2024
c555bdf
Merge pull request #293 from multiversx/fix-transaction-status
miiu96 Aug 20, 2024
3287bbe
bug fix multiple recreate
miiu96 Sep 12, 2024
db67228
Merge pull request #296 from multiversx/bug-fix-multiple-recreate
miiu96 Sep 13, 2024
599824b
Merge remote-tracking branch 'origin/master' into merge-master-in-rc-…
miiu96 Sep 17, 2024
6f62aad
Merge pull request #297 from multiversx/merge-master-in-rc-next
miiu96 Sep 17, 2024
7dc6e64
Merge branch 'master' into merge-master-into-feat-sovereign-9-oct-2024
mariusmihaic Oct 9, 2024
f37745c
FIX: go mod
mariusmihaic Oct 9, 2024
cbc1607
Merge branch 'rc/v1.7.next1' into merge-master-into-feat-sovereign-9-…
mariusmihaic Oct 9, 2024
7b5c180
FIX: go mod 2
mariusmihaic Oct 9, 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
54 changes: 54 additions & 0 deletions .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish Docker image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.20.7
id: go

- name: Get dependencies
run: |
go mod download
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: multiversx/elastic-indexer

- name: Build and push Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.5 as builder
FROM golang:1.20.7 as builder

RUN apt-get update && apt-get install -y

Expand Down
18 changes: 18 additions & 0 deletions client/elasticClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package client
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -84,6 +85,23 @@ func (ec *elasticClient) CheckAndCreateIndex(indexName string) error {
return ec.createIndex(indexName)
}

// PutMappings will put the provided mappings to a given index
func (ec *elasticClient) PutMappings(indexName string, mappings *bytes.Buffer) error {
res, err := ec.client.Indices.PutMapping(
mappings,
ec.client.Indices.PutMapping.WithIndex(indexName),
)
if err != nil {
return err
}

if res.IsError() {
return errors.New(res.String())
}

return nil
}

// CheckAndCreateAlias creates a new alias if it does not already exist
func (ec *elasticClient) CheckAndCreateAlias(alias string, indexName string) error {
if ec.aliasExists(alias) {
Expand Down
9 changes: 8 additions & 1 deletion data/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@ package data

import (
"time"

"github.com/multiversx/mx-chain-core-go/core"
)

const metaESDT = "MetaESDT"

// NFTDataUpdate will contain the update information for an NFT or SFT
type NFTDataUpdate struct {
Identifier string
Address string
NewCreator string
URIsToAdd [][]byte
NewAttributes []byte
Address string
Freeze bool
UnFreeze bool
Pause bool
UnPause bool
SetURIs bool
NewRoyalties core.OptionalUint32
NewMetaData *TokenMetaData
}

// ResponseTokens is the structure for the tokens response
Expand Down Expand Up @@ -51,6 +57,7 @@ type TokenInfo struct {
Data *TokenMetaData `json:"data,omitempty"`
OwnersHistory []*OwnerData `json:"ownersHistory,omitempty"`
TransferOwnership bool `json:"-"`
ChangeToDynamic bool `json:"-"`
Properties *TokenProperties `json:"properties,omitempty"`
}

Expand Down
94 changes: 49 additions & 45 deletions data/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,61 @@ package data

import (
"time"

"github.com/multiversx/mx-chain-core-go/data/transaction"
)

// Transaction is a structure containing all the fields that need
// to be saved for a transaction. It has all the default fields
// plus some extra information for ease of search and filter
type Transaction struct {
MBHash string `json:"miniBlockHash"`
Nonce uint64 `json:"nonce"`
Round uint64 `json:"round"`
Value string `json:"value"`
ValueNum float64 `json:"valueNum"`
Receiver string `json:"receiver"`
Sender string `json:"sender"`
ReceiverShard uint32 `json:"receiverShard"`
SenderShard uint32 `json:"senderShard"`
GasPrice uint64 `json:"gasPrice"`
GasLimit uint64 `json:"gasLimit"`
GasUsed uint64 `json:"gasUsed"`
Fee string `json:"fee"`
FeeNum float64 `json:"feeNum"`
InitialPaidFee string `json:"initialPaidFee,omitempty"`
Data []byte `json:"data"`
Signature string `json:"signature"`
Timestamp time.Duration `json:"timestamp"`
Status string `json:"status"`
SearchOrder uint32 `json:"searchOrder"`
SenderUserName []byte `json:"senderUserName,omitempty"`
ReceiverUserName []byte `json:"receiverUserName,omitempty"`
HasSCR bool `json:"hasScResults,omitempty"`
IsScCall bool `json:"isScCall,omitempty"`
HasOperations bool `json:"hasOperations,omitempty"`
HasLogs bool `json:"hasLogs,omitempty"`
Tokens []string `json:"tokens,omitempty"`
ESDTValues []string `json:"esdtValues,omitempty"`
ESDTValuesNum []float64 `json:"esdtValuesNum,omitempty"`
Receivers []string `json:"receivers,omitempty"`
ReceiversShardIDs []uint32 `json:"receiversShardIDs,omitempty"`
Type string `json:"type,omitempty"`
Operation string `json:"operation,omitempty"`
Function string `json:"function,omitempty"`
IsRelayed bool `json:"isRelayed,omitempty"`
Version uint32 `json:"version,omitempty"`
GuardianAddress string `json:"guardian,omitempty"`
GuardianSignature string `json:"guardianSignature,omitempty"`
ErrorEvent bool `json:"errorEvent,omitempty"`
CompletedEvent bool `json:"completedEvent,omitempty"`
ExecutionOrder int `json:"-"`
SmartContractResults []*ScResult `json:"-"`
Hash string `json:"-"`
BlockHash string `json:"-"`
HadRefund bool `json:"-"`
MBHash string `json:"miniBlockHash"`
Nonce uint64 `json:"nonce"`
Round uint64 `json:"round"`
Value string `json:"value"`
ValueNum float64 `json:"valueNum"`
Receiver string `json:"receiver"`
Sender string `json:"sender"`
ReceiverShard uint32 `json:"receiverShard"`
SenderShard uint32 `json:"senderShard"`
GasPrice uint64 `json:"gasPrice"`
GasLimit uint64 `json:"gasLimit"`
GasUsed uint64 `json:"gasUsed"`
Fee string `json:"fee"`
FeeNum float64 `json:"feeNum"`
InitialPaidFee string `json:"initialPaidFee,omitempty"`
Data []byte `json:"data"`
Signature string `json:"signature"`
Timestamp time.Duration `json:"timestamp"`
Status string `json:"status"`
SearchOrder uint32 `json:"searchOrder"`
SenderUserName []byte `json:"senderUserName,omitempty"`
ReceiverUserName []byte `json:"receiverUserName,omitempty"`
HasSCR bool `json:"hasScResults,omitempty"`
IsScCall bool `json:"isScCall,omitempty"`
HasOperations bool `json:"hasOperations,omitempty"`
HasLogs bool `json:"hasLogs,omitempty"`
Tokens []string `json:"tokens,omitempty"`
ESDTValues []string `json:"esdtValues,omitempty"`
ESDTValuesNum []float64 `json:"esdtValuesNum,omitempty"`
Receivers []string `json:"receivers,omitempty"`
ReceiversShardIDs []uint32 `json:"receiversShardIDs,omitempty"`
Type string `json:"type,omitempty"`
Operation string `json:"operation,omitempty"`
Function string `json:"function,omitempty"`
IsRelayed bool `json:"isRelayed,omitempty"`
Version uint32 `json:"version,omitempty"`
GuardianAddress string `json:"guardian,omitempty"`
GuardianSignature string `json:"guardianSignature,omitempty"`
ErrorEvent bool `json:"errorEvent,omitempty"`
CompletedEvent bool `json:"completedEvent,omitempty"`
RelayedAddr string `json:"relayed,omitempty"`
InnerTransactions []*transaction.FrontendTransaction `json:"innerTransactions,omitempty"`
ExecutionOrder int `json:"-"`
SmartContractResults []*ScResult `json:"-"`
Hash string `json:"-"`
BlockHash string `json:"-"`
HadRefund bool `json:"-"`
}

// Receipt is a structure containing all the fields that need to be safe for a Receipt
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ require (
github.com/elastic/go-elasticsearch/v7 v7.12.0
github.com/gin-contrib/cors v1.4.0
github.com/gin-gonic/gin v1.9.1
github.com/multiversx/mx-chain-communication-go v1.0.15-0.20240508074652-e128a1c05c8e
github.com/multiversx/mx-chain-core-go v1.2.21-0.20240514102932-72b1cac83784
github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240508072523-3f00a726af57
github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240514104734-6dc768a4c5aa
github.com/multiversx/mx-chain-communication-go v1.1.0
github.com/multiversx/mx-chain-core-go v1.2.23-0.20241007113300-50ac1ae23824
github.com/multiversx/mx-chain-logger-go v1.0.15
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20241008143259-334f3a5bafe0
github.com/prometheus/client_model v0.4.0
github.com/prometheus/common v0.37.0
github.com/stretchr/testify v1.8.4
Expand Down
18 changes: 9 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/multiversx/mx-chain-communication-go v1.0.15-0.20240508074652-e128a1c05c8e h1:Tsmwhu+UleE+l3buPuqXSKTqfu5FbPmzQ4MjMoUvCWA=
github.com/multiversx/mx-chain-communication-go v1.0.15-0.20240508074652-e128a1c05c8e/go.mod h1:2yXl18wUbuV3cRZr7VHxM1xo73kTaC1WUcu2kx8R034=
github.com/multiversx/mx-chain-core-go v1.2.21-0.20240514102932-72b1cac83784 h1:Dxm8MIIbEQW9hUIjfiVFm7mR+UbOSkb7xhMtXHP7dmk=
github.com/multiversx/mx-chain-core-go v1.2.21-0.20240514102932-72b1cac83784/go.mod h1:P/YBoFnt25XUaCQ7Q/SD15vhnc9yV5JDhHxyFO9P8Z0=
github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240508074452-cc21c1b505df h1:clihfi78bMEOWk/qw6WA4uQbCM2e2NGliqswLAvw19k=
github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240508072523-3f00a726af57 h1:g9t410dqjcb7UUptbVd/H6Ua12sEzWU4v7VplyNvRZ0=
github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240508072523-3f00a726af57/go.mod h1:cY6CIXpndW5g5PTPn4WzPwka/UBEf+mgw+PSY5pHGAU=
github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240514104734-6dc768a4c5aa h1:CJyBXV0PHDE3/bjJU3quoNBjOmGjrn/EBqU7wBdcqhk=
github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240514104734-6dc768a4c5aa/go.mod h1:/scqfBjA912V3Z2sPlkRVxWAE3puVNS2adQegm4LjCc=
github.com/multiversx/mx-chain-communication-go v1.1.0 h1:J7bX6HoN3HiHY7cUeEjG8AJWgQDDPcY+OPDOsSUOkRE=
github.com/multiversx/mx-chain-communication-go v1.1.0/go.mod h1:WK6bP4pGEHGDDna/AYRIMtl6G9OA0NByI1Lw8PmOnRM=
github.com/multiversx/mx-chain-core-go v1.2.23-0.20241007113300-50ac1ae23824 h1:OHYcWOeTNwSaTMRAfusu6/1zoTWGEtHKPBig4dbRAwM=
github.com/multiversx/mx-chain-core-go v1.2.23-0.20241007113300-50ac1ae23824/go.mod h1:P/YBoFnt25XUaCQ7Q/SD15vhnc9yV5JDhHxyFO9P8Z0=
github.com/multiversx/mx-chain-crypto-go v1.2.12 h1:zWip7rpUS4CGthJxfKn5MZfMfYPjVjIiCID6uX5BSOk=
github.com/multiversx/mx-chain-logger-go v1.0.15 h1:HlNdK8etyJyL9NQ+6mIXyKPEBo+wRqOwi3n+m2QIHXc=
github.com/multiversx/mx-chain-logger-go v1.0.15/go.mod h1:t3PRKaWB1M+i6gUfD27KXgzLJJC+mAQiN+FLlL1yoGQ=
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20241008143259-334f3a5bafe0 h1:WpfFe6ueS+nRIq2RzVaeF1/TJStyYH/YLYPCmN8kdDM=
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20241008143259-334f3a5bafe0/go.mod h1:IOE+gYAtTEKZJwUr9ZhOnjdf4vFKrZdZ9RVEyuFsEP4=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
Expand Down
Loading
Loading