Skip to content

Commit

Permalink
Merge pull request #258 from multiversx/rebranding
Browse files Browse the repository at this point in the history
Rebranding
  • Loading branch information
iulianpascalau authored Mar 5, 2023
2 parents 2b9c97e + 88541c5 commit 3698d61
Show file tree
Hide file tree
Showing 216 changed files with 4,040 additions and 3,928 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ assignees: ''
---

<!--
Add here the question you want to ask. For a more immediate response, please use our validator's telegram page: https://t.me/ElrondValidators
Add here the question you want to ask. For a more immediate response, please use our validator's telegram page: https://t.me/MultiversXValidators
-->
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ^1.17.6
go-version: 1.17.6
id: go

- name: Check out code into the Go module directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ^1.17.6
go-version: 1.17.6
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ^1.17.6
go-version: 1.17.6
id: go

- name: Check out code into the Go module directory
Expand All @@ -43,7 +43,7 @@ jobs:
GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
GOPATH=$(go env GOPATH)
ARCHIVE="elrond_eth_bridge""$APP_VER_SHORT""_""$GOOS""_""$GOARCH"".tgz"
ARCHIVE="multiversx_eth_bridge""$APP_VER_SHORT""_""$GOOS""_""$GOARCH"".tgz"
BUILD_DIR=${GITHUB_WORKSPACE}/build
echo "GOOS=${GOOS}" >> $GITHUB_ENV
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
name: golangci linter
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17.6
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ^1.17.6
go-version: 1.17.6
id: go

- name: Check out code
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Smart contracts for both blockchains:
## Installation and running for the relayer

### Step 1: install & configure go:
The installation of go should proceed as shown in official golang installation guide https://golang.org/doc/install . In order to run the node, minimum golang version should be 1.14.7.
The installation of go should proceed as shown in official golang installation guide https://golang.org/doc/install . In order to run the node, minimum golang version should be 1.17.6.

### Step 2: clone the repository and build the binaries:
The `main` branch is the one to use
Expand Down
2 changes: 1 addition & 1 deletion api/gin/httpServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"time"

apiErrors "github.com/ElrondNetwork/elrond-go/api/errors"
apiErrors "github.com/multiversx/mx-chain-go/api/errors"
)

type httpServer struct {
Expand Down
6 changes: 3 additions & 3 deletions api/gin/httpServer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"net/http"
"testing"

apiErrors "github.com/ElrondNetwork/elrond-eth-bridge/api/errors"
testsServer "github.com/ElrondNetwork/elrond-eth-bridge/testsCommon/server"
"github.com/ElrondNetwork/elrond-go-core/core/check"
apiErrors "github.com/multiversx/mx-bridge-eth-go/api/errors"
testsServer "github.com/multiversx/mx-bridge-eth-go/testsCommon/server"
"github.com/multiversx/mx-chain-core-go/core/check"
"github.com/stretchr/testify/assert"
)

Expand Down
28 changes: 14 additions & 14 deletions api/gin/webServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import (
"sync"
"time"

apiErrors "github.com/ElrondNetwork/elrond-eth-bridge/api/errors"
"github.com/ElrondNetwork/elrond-eth-bridge/api/groups"
"github.com/ElrondNetwork/elrond-eth-bridge/api/shared"
"github.com/ElrondNetwork/elrond-eth-bridge/config"
"github.com/ElrondNetwork/elrond-eth-bridge/core"
"github.com/ElrondNetwork/elrond-go-core/core/check"
"github.com/ElrondNetwork/elrond-go-core/marshal"
logger "github.com/ElrondNetwork/elrond-go-logger"
"github.com/ElrondNetwork/elrond-go/api/logs"
"github.com/ElrondNetwork/elrond-go/api/middleware"
elrondShared "github.com/ElrondNetwork/elrond-go/api/shared"
"github.com/btcsuite/websocket"
"github.com/gin-contrib/cors"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/gin"
apiErrors "github.com/multiversx/mx-bridge-eth-go/api/errors"
"github.com/multiversx/mx-bridge-eth-go/api/groups"
"github.com/multiversx/mx-bridge-eth-go/api/shared"
"github.com/multiversx/mx-bridge-eth-go/config"
"github.com/multiversx/mx-bridge-eth-go/core"
"github.com/multiversx/mx-chain-core-go/core/check"
"github.com/multiversx/mx-chain-core-go/marshal"
"github.com/multiversx/mx-chain-go/api/logs"
"github.com/multiversx/mx-chain-go/api/middleware"
chainShared "github.com/multiversx/mx-chain-go/api/shared"
logger "github.com/multiversx/mx-chain-logger-go"
)

var log = logger.GetOrCreate("api")
Expand All @@ -38,7 +38,7 @@ type webServer struct {
facade shared.FacadeHandler
apiConfig config.ApiRoutesConfig
antiFloodConfig config.WebServerAntifloodConfig
httpServer elrondShared.HttpServerCloser
httpServer chainShared.HttpServerCloser
groups map[string]shared.GroupHandler
cancelFunc func()
}
Expand Down Expand Up @@ -206,8 +206,8 @@ func registerLoggerWsRoute(ws *gin.Engine, marshalizer marshal.Marshalizer) {
})
}

func (ws *webServer) createMiddlewareLimiters() ([]elrondShared.MiddlewareProcessor, error) {
middlewares := make([]elrondShared.MiddlewareProcessor, 0)
func (ws *webServer) createMiddlewareLimiters() ([]chainShared.MiddlewareProcessor, error) {
middlewares := make([]chainShared.MiddlewareProcessor, 0)

if ws.apiConfig.Logging.LoggingEnabled {
responseLoggerMiddleware := middleware.NewResponseLoggerMiddleware(time.Duration(ws.apiConfig.Logging.ThresholdInMicroSeconds) * time.Microsecond)
Expand Down
16 changes: 8 additions & 8 deletions api/gin/webServer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"testing"
"time"

apiErrors "github.com/ElrondNetwork/elrond-eth-bridge/api/errors"
"github.com/ElrondNetwork/elrond-eth-bridge/api/shared"
"github.com/ElrondNetwork/elrond-eth-bridge/config"
"github.com/ElrondNetwork/elrond-eth-bridge/core"
"github.com/ElrondNetwork/elrond-eth-bridge/testsCommon/facade"
"github.com/ElrondNetwork/elrond-eth-bridge/testsCommon/groups"
"github.com/ElrondNetwork/elrond-go-core/core/check"
"github.com/ElrondNetwork/elrond-go/api/middleware"
apiErrors "github.com/multiversx/mx-bridge-eth-go/api/errors"
"github.com/multiversx/mx-bridge-eth-go/api/shared"
"github.com/multiversx/mx-bridge-eth-go/config"
"github.com/multiversx/mx-bridge-eth-go/core"
"github.com/multiversx/mx-bridge-eth-go/testsCommon/facade"
"github.com/multiversx/mx-bridge-eth-go/testsCommon/groups"
"github.com/multiversx/mx-chain-core-go/core/check"
"github.com/multiversx/mx-chain-go/api/middleware"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions api/gin/writers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "bytes"
type ginWriter struct {
}

// Write will output the message using elrond-go-logger's logger
// Write will output the message using mx-chain-logger-go's logger
func (gv *ginWriter) Write(p []byte) (n int, err error) {
trimmed := bytes.TrimSpace(p)
log.Trace("gin server", "message", string(trimmed))
Expand All @@ -16,7 +16,7 @@ func (gv *ginWriter) Write(p []byte) (n int, err error) {
type ginErrorWriter struct {
}

// Write will output the error using elrond-go-logger's logger
// Write will output the error using mx-chain-logger-go's logger
func (gev *ginErrorWriter) Write(p []byte) (n int, err error) {
trimmed := bytes.TrimSpace(p)
log.Trace("gin server", "error", string(trimmed))
Expand Down
6 changes: 3 additions & 3 deletions api/groups/baseGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package groups
import (
"strings"

"github.com/ElrondNetwork/elrond-eth-bridge/config"
logger "github.com/ElrondNetwork/elrond-go-logger"
"github.com/ElrondNetwork/elrond-go/api/shared"
"github.com/gin-gonic/gin"
"github.com/multiversx/mx-bridge-eth-go/config"
"github.com/multiversx/mx-chain-go/api/shared"
logger "github.com/multiversx/mx-chain-logger-go"
)

var log = logger.GetOrCreate("api/groups")
Expand Down
4 changes: 2 additions & 2 deletions api/groups/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"fmt"
"io"

"github.com/ElrondNetwork/elrond-eth-bridge/api/shared"
"github.com/ElrondNetwork/elrond-eth-bridge/config"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"github.com/multiversx/mx-bridge-eth-go/api/shared"
"github.com/multiversx/mx-bridge-eth-go/config"
)

type generalResponse struct {
Expand Down
22 changes: 11 additions & 11 deletions api/groups/nodeGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"net/http"
"sync"

"github.com/ElrondNetwork/elrond-eth-bridge/api/shared"
"github.com/ElrondNetwork/elrond-go-core/core/check"
"github.com/ElrondNetwork/elrond-go/api/errors"
elrondApiShared "github.com/ElrondNetwork/elrond-go/api/shared"
"github.com/gin-gonic/gin"
"github.com/multiversx/mx-bridge-eth-go/api/shared"
"github.com/multiversx/mx-chain-core-go/core/check"
"github.com/multiversx/mx-chain-go/api/errors"
chainAPIShared "github.com/multiversx/mx-chain-go/api/shared"
)

const (
Expand All @@ -35,7 +35,7 @@ func NewNodeGroup(facade shared.FacadeHandler) (*nodeGroup, error) {
baseGroup: &baseGroup{},
}

endpoints := []*elrondApiShared.EndpointHandlerData{
endpoints := []*chainAPIShared.EndpointHandlerData{
{
Path: statusPath,
Method: http.MethodGet,
Expand All @@ -58,10 +58,10 @@ func (ng *nodeGroup) statusListMetrics(c *gin.Context) {

c.JSON(
http.StatusOK,
elrondApiShared.GenericAPIResponse{
chainAPIShared.GenericAPIResponse{
Data: list,
Error: "",
Code: elrondApiShared.ReturnCodeSuccess,
Code: chainAPIShared.ReturnCodeSuccess,
},
)
}
Expand All @@ -80,21 +80,21 @@ func (ng *nodeGroup) statusMetrics(c *gin.Context) {
if err != nil {
c.JSON(
http.StatusInternalServerError,
elrondApiShared.GenericAPIResponse{
chainAPIShared.GenericAPIResponse{
Data: nil,
Error: fmt.Sprintf("%s: %s", ErrGettingMetrics.Error(), err.Error()),
Code: elrondApiShared.ReturnCodeInternalError,
Code: chainAPIShared.ReturnCodeInternalError,
},
)
return
}

c.JSON(
http.StatusOK,
elrondApiShared.GenericAPIResponse{
chainAPIShared.GenericAPIResponse{
Data: info,
Error: "",
Code: elrondApiShared.ReturnCodeSuccess,
Code: chainAPIShared.ReturnCodeSuccess,
},
)
}
Expand Down
20 changes: 10 additions & 10 deletions api/groups/nodeGroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import (
"strings"
"testing"

"github.com/ElrondNetwork/elrond-eth-bridge/core"
mockFacade "github.com/ElrondNetwork/elrond-eth-bridge/testsCommon/facade"
"github.com/ElrondNetwork/elrond-go-core/core/check"
"github.com/ElrondNetwork/elrond-go-core/marshal"
elrondApiErrors "github.com/ElrondNetwork/elrond-go/api/errors"
"github.com/multiversx/mx-bridge-eth-go/core"
mockFacade "github.com/multiversx/mx-bridge-eth-go/testsCommon/facade"
"github.com/multiversx/mx-chain-core-go/core/check"
"github.com/multiversx/mx-chain-core-go/marshal"
apiErrors "github.com/multiversx/mx-chain-go/api/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

var marshalizer = &marshal.JsonMarshalizer{}
var marshaller = &marshal.JsonMarshalizer{}

func equalStructsThroughJsonSerialization(t *testing.T, expected interface{}, got interface{}) {
expectedBuff, err := marshalizer.Marshal(expected)
expectedBuff, err := marshaller.Marshal(expected)
require.Nil(t, err)

gotBuff, err := marshalizer.Marshal(got)
gotBuff, err := marshaller.Marshal(got)
require.Nil(t, err)

assert.Equal(t, string(expectedBuff), string(gotBuff))
Expand All @@ -35,7 +35,7 @@ func TestNewNodeGroup(t *testing.T) {
ng, err := NewNodeGroup(nil)

assert.True(t, check.IfNil(ng))
assert.True(t, errors.Is(err, elrondApiErrors.ErrNilFacadeHandler))
assert.True(t, errors.Is(err, apiErrors.ErrNilFacadeHandler))
})
t.Run("should work", func(t *testing.T) {
ng, err := NewNodeGroup(&mockFacade.RelayerFacadeStub{})
Expand Down Expand Up @@ -138,7 +138,7 @@ func TestNodeGroup_UpdateFacade(t *testing.T) {
ng, _ := NewNodeGroup(&mockFacade.RelayerFacadeStub{})

err := ng.UpdateFacade(nil)
assert.Equal(t, elrondApiErrors.ErrNilFacadeHandler, err)
assert.Equal(t, apiErrors.ErrNilFacadeHandler, err)
})
t.Run("should work", func(t *testing.T) {
ng, _ := NewNodeGroup(&mockFacade.RelayerFacadeStub{})
Expand Down
4 changes: 2 additions & 2 deletions api/shared/interface.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package shared

import (
"github.com/ElrondNetwork/elrond-eth-bridge/config"
"github.com/ElrondNetwork/elrond-eth-bridge/core"
"github.com/gin-gonic/gin"
"github.com/multiversx/mx-bridge-eth-go/config"
"github.com/multiversx/mx-bridge-eth-go/core"
)

// GroupHandler defines the actions needed to be performed by an gin API group
Expand Down
2 changes: 1 addition & 1 deletion api/swagger/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Swagger setup for the relayer node
The relayer node exposes some api routes in order to monitor the health of it:
- connection status between ethereum and elrond clients
- connection status between ethereum and multiversx clients
- information for each half-bridge regarding the current status

In order to setup the swagger for interacting with those routes we will use `docker`
Expand Down
10 changes: 5 additions & 5 deletions api/swagger/swagger/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ info:
version: "1.0.0"
title: "Relayers API"
contact:
email: "contact@elrond.com"
email: "contact@multiversx.com"
basePath: "/node"
host: localhost:8080
tags:
Expand All @@ -24,7 +24,7 @@ paths:
content:
application/json:
schema:
$ref: '#components/schemas/ElrondReply'
$ref: '#components/schemas/MultiversXReply'
/status?name={metric}:
get:
tags:
Expand All @@ -37,18 +37,18 @@ paths:
required: true
description: The wanted metric
type: string
enum: [ElrondToEth, EthToElrond, elrond-client, eth-client]
enum: [MultiversXToEth, EthToMultiversX, multiversx-client, eth-client]
responses:
'200':
description: Information of the requested metric
content:
application/json:
schema:
$ref: '#components/schemas/ElrondReply'
$ref: '#components/schemas/MultiversXReply'

components:
schemas:
ElrondReply:
MultiversXReply:
type: object
properties:
data:
Expand Down
Loading

0 comments on commit 3698d61

Please sign in to comment.