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

rebranding to xgon #15

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/push-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: |
okx/xagon-bridge-service
okx/xagon-bridge-service:2.0
okx/xgon-bridge-service
okx/xgon-bridge-service:2.0
build-args: |
PRIVATE_TOKEN=${{secrets.GIT_TOKEN}}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ RUN cd /src && make build

# CONTAINER FOR RUNNING BINARY
FROM alpine:3.16.0
COPY --from=build /src/dist/xagon-bridge /app/xagon-bridge
COPY --from=build /src/dist/xgon-bridge /app/xgon-bridge
COPY --from=build /src/test/vectors /app/test/vectors
EXPOSE 8080
EXPOSE 9090
CMD ["/bin/sh", "-c", "/app/xagon-bridge run"]
CMD ["/bin/sh", "-c", "/app/xgon-bridge run"]
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
include version.mk

DOCKER_COMPOSE := docker-compose -f docker-compose.yml
DOCKER_COMPOSE_STATE_DB := xagon-state-db
DOCKER_COMPOSE_POOL_DB := xagon-pool-db
DOCKER_COMPOSE_RPC_DB := xagon-rpc-db
DOCKER_COMPOSE_BRIDGE_DB := xagon-bridge-db
DOCKER_COMPOSE_ZKEVM_NODE := xagon-node
DOCKER_COMPOSE_L1_NETWORK := xagon-mock-l1-network
DOCKER_COMPOSE_ZKPROVER := xagon-prover
DOCKER_COMPOSE_BRIDGE := xagon-bridge-service
DOCKER_COMPOSE_STATE_DB := xgon-state-db
DOCKER_COMPOSE_POOL_DB := xgon-pool-db
DOCKER_COMPOSE_RPC_DB := xgon-rpc-db
DOCKER_COMPOSE_BRIDGE_DB := xgon-bridge-db
DOCKER_COMPOSE_ZKEVM_NODE := xgon-node
DOCKER_COMPOSE_L1_NETWORK := xgon-mock-l1-network
DOCKER_COMPOSE_ZKPROVER := xgon-prover
DOCKER_COMPOSE_BRIDGE := xgon-bridge-service

RUN_STATE_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_STATE_DB)
RUN_POOL_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_POOL_DB)
Expand Down Expand Up @@ -36,7 +36,7 @@ LDFLAGS += -X 'github.com/0xPolygonHermez/zkevm-bridge-service.BuildDate=$(DATE)
GO_BASE := $(shell pwd)
GO_BIN := $(GO_BASE)/dist
GO_ENV_VARS := GO_BIN=$(GO_BIN)
GO_BINARY := xagon-bridge
GO_BINARY := xgon-bridge
GO_CMD := $(GO_BASE)/cmd

LINT := $$(go env GOPATH)/bin/golangci-lint run --timeout=5m -E whitespace -E gosec -E gci -E misspell -E gomnd -E gofmt -E goimports --exclude-use-default=false --max-same-issues 0
Expand Down Expand Up @@ -66,7 +66,7 @@ install-linter: ## Installs the linter

.PHONY: build-docker
build-docker: ## Builds a docker image with the zkevm bridge binary
docker build -t xagon-bridge-service -f ./Dockerfile .
docker build -t xgon-bridge-service -f ./Dockerfile .

.PHONY: run-db-node
run-db-node: ## Runs the node database
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Xagon Bridge service
# Xgon Bridge service

This repo implements a backend service written in Go, that enables clients, like the [web UI](),
to interact with the [bridge smart contract](https://github.com/okx/Xagon-contracts) by providing Merkleproofs.
to interact with the [bridge smart contract](https://github.com/okx/Xgon-contracts) by providing Merkleproofs.

## Architecture

Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (

const (
// App name
appName = "xagon-bridge"
appName = "xgon-bridge"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion config/config.debug.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ BridgeVersion = "v1"
[CoinKafkaConsumer]
Brokers = ["localhost:9092"]
Topics = ["explorer_chainAddressPrice_push"]
ConsumerGroupID = "xagon-bridge-service"
ConsumerGroupID = "xgon-bridge-service"
InitialOffset = -1
Username = ""
Password = ""
Expand Down
14 changes: 7 additions & 7 deletions config/config.local.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Database = "postgres"
User = "test_user"
Password = "test_password"
Name = "test_db"
Host = "xagon-bridge-db"
Host = "xgon-bridge-db"
Port = "5432"
MaxConns = 20
TableSuffix = ""
Expand All @@ -21,8 +21,8 @@ RetryNumber = 10
FreeGas = true

[Etherman]
L1URL = "http://xagon-mock-l1-network:8545"
L2URLs = ["http://xagon-node:8123"]
L1URL = "http://xgon-mock-l1-network:8545"
L2URLs = ["http://xgon-node:8123"]
L1ChainId = 5
L2ChainIds = [1001]

Expand All @@ -47,21 +47,21 @@ SentinelConfigFilePath = "/app/sentinel_config.json"
User = "test_user"
Password = "test_password"
Name = "test_db"
Host = "xagon-bridge-db"
Host = "xgon-bridge-db"
Port = "5432"
MaxConns = 20
TableSuffix = ""
[BridgeServer.Redis]
Addr = "xagon-bridge-redis:6379"
Addr = "xgon-bridge-redis:6379"
Username = ""
Password = ""
DB = 0
MockPrice = true

[CoinKafkaConsumer]
Brokers = ["xagon-bridge-coin-kafka:9092"]
Brokers = ["xgon-bridge-coin-kafka:9092"]
Topics = ["explorer_chainAddressPrice_push"]
ConsumerGroupID = "xagon-bridge-service"
ConsumerGroupID = "xgon-bridge-service"
InitialOffset = -1
Username = ""
Password = ""
Expand Down
4 changes: 2 additions & 2 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Database = "postgres"
User = "test_user"
Password = "test_password"
Name = "test_db"
Host = "xagon-bridge-db"
Host = "xgon-bridge-db"
Port = "5432"
MaxConns = 20

Expand Down Expand Up @@ -46,7 +46,7 @@ BridgeVersion = "v1"
User = "test_user"
Password = "test_password"
Name = "test_db"
Host = "xagon-bridge-db"
Host = "xgon-bridge-db"
Port = "5432"
MaxConns = 20
`
38 changes: 19 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.5'
services:
xagon-state-db:
container_name: xagon-state-db
xgon-state-db:
container_name: xgon-state-db
image: postgres
deploy:
resources:
Expand All @@ -19,8 +19,8 @@ services:
- POSTGRES_DB=state_db
command: ["postgres", "-N", "500"]

xagon-pool-db:
container_name: xagon-pool-db
xgon-pool-db:
container_name: xgon-pool-db
image: postgres
deploy:
resources:
Expand All @@ -36,8 +36,8 @@ services:
- POSTGRES_DB=pool_db
command: ["postgres", "-N", "500"]

xagon-bridge-db:
container_name: xagon-bridge-db
xgon-bridge-db:
container_name: xgon-bridge-db
image: postgres
deploy:
resources:
Expand All @@ -55,8 +55,8 @@ services:
- POSTGRES_DB=test_db
command: ["postgres", "-N", "500"]

xagon-bridge-redis:
container_name: xagon-bridge-redis
xgon-bridge-redis:
container_name: xgon-bridge-redis
image: redis
deploy:
resources:
Expand All @@ -81,9 +81,9 @@ services:
expose:
- 2181

xagon-bridge-coin-kafka:
xgon-bridge-coin-kafka:
image: wurstmeister/kafka
container_name: xagon-bridge-coin-kafka
container_name: xgon-bridge-coin-kafka
expose:
- 9092
environment:
Expand Down Expand Up @@ -135,17 +135,17 @@ services:
command: >
zkProver -c /usr/src/app/config.json

xagon-bridge-service:
container_name: xagon-bridge-service
image: xagon-bridge-service
xgon-bridge-service:
container_name: xgon-bridge-service
image: xgon-bridge-service
ports:
- 8080:8080
- 9090:9090
environment:
- ZKEVM_BRIDGE_DATABASE_USER=test_user
- ZKEVM_BRIDGE_DATABASE_PASSWORD=test_password
- ZKEVM_BRIDGE_DATABASE_NAME=test_db
- ZKEVM_BRIDGE_DATABASE_HOST=xagon-bridge-db
- ZKEVM_BRIDGE_DATABASE_HOST=xgon-bridge-db
- ZKEVM_BRIDGE_DATABASE_PORT=5432
volumes:
- ./test/test.keystore.claimtx:/pk/keystore.claimtxmanager
Expand All @@ -154,15 +154,15 @@ services:
command:
- "/bin/sh"
- "-c"
- "/app/xagon-bridge run --cfg /app/config.toml"
- "/app/xgon-bridge run --cfg /app/config.toml"

xagon-bridge-kafka-consumer:
container_name: xagon-bridge-kafka-consumer
image: xagon-bridge-service
xgon-bridge-kafka-consumer:
container_name: xgon-bridge-kafka-consumer
image: xgon-bridge-service
volumes:
- ./config/config.local.toml:/app/config.toml
- ./coinmiddleware/root-ca-cert:/app/root-ca-cert
command:
- "/bin/sh"
- "-c"
- "/app/xagon-bridge runKafkaConsumer --cfg /app/config.toml"
- "/app/xgon-bridge runKafkaConsumer --cfg /app/config.toml"
16 changes: 8 additions & 8 deletions docs/running_local.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

This documentation will help you running the following components:

- Xagon Node Databases
- Xagon Bridge Database
- Xgon Node Databases
- Xgon Bridge Database
- L1 Network
- Prover
- Xagon Node
- Xagon Bridge Service
- Xgon Node
- Xgon Bridge Service

## Requirements

Expand All @@ -21,8 +21,8 @@ The current version of the environment requires `go`, `docker` and `docker-compo
- <https://www.docker.com/get-started>
- <https://docs.docker.com/compose/install/>

The `xagon-bridge-service` docker image must be built at least once and every time a change is made to the code.
If you haven't build the `xagon-bridge-service` image yet, you must run:
The `xgon-bridge-service` docker image must be built at least once and every time a change is made to the code.
If you haven't build the `xgon-bridge-service` image yet, you must run:

```bash
make build-docker
Expand Down Expand Up @@ -53,15 +53,15 @@ make test-edge

## Accessing the environment

- Xagon Bridge Database
- Xgon Bridge Database
- `Type:` Postgres DB
- `User:` test_user
- `Password:` test_password
- `Database:` test_db
- `Host:` localhost
- `Port:` 5435
- `Url:` <postgres://test_user:test_password@localhost:5435/test_db>
- Xagon Bridge Service
- Xgon Bridge Service
- `Type:` Web
- `Host:` localhost
- `Port:` 8080
Expand Down
2 changes: 1 addition & 1 deletion scripts/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func main() {
app := cli.NewApp()
app.Name = "xagon-bridge-scripts"
app.Name = "xgon-bridge-scripts"
app.Commands = []*cli.Command{
{
Name: "updatedeps",
Expand Down
6 changes: 3 additions & 3 deletions test/mocksmartcontracts/polygonzkevmbridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import "./lib/EmergencyManager.sol";
import "./lib/GlobalExitRootLib.sol";

/**
* PolygonZkEVMBridge that will be deployed on both networks Ethereum and Xagon
* PolygonZkEVMBridge that will be deployed on both networks Ethereum and Xgon
* Contract responsible to manage the token interactions with other networks
*/
contract PolygonZkEVMBridge is
Expand Down Expand Up @@ -407,15 +407,15 @@ contract PolygonZkEVMBridge is

/**
* @notice Function to activate the emergency state
" Only can be called by the Xagon in extreme situations
" Only can be called by the Xgon in extreme situations
*/
function activateEmergencyState() external onlyPolygonZkEVM {
_activateEmergencyState();
}

/**
* @notice Function to deactivate the emergency state
" Only can be called by the Xagon
" Only can be called by the Xgon
*/
function deactivateEmergencyState() external onlyPolygonZkEVM {
_deactivateEmergencyState();
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/initialClaim/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ At the beginning of the script there are the next constant variables that need t
bridgeURL = "http://localhost:8080"
```
`l2BridgeAddr` is the bridge address smart contract in L2
`zkevmAddr` is the xagonZkEvm address in L1
`zkevmAddr` is the xgonZkEvm address in L1
`accHexAddress` is the wallet address used to send the claim in L2 and to send the forcedBatch in L1
`accHexPrivateKey` is the wallet private key used to send the claim in L2 and to send the forcedBatch in L1
`l1NetworkURL` is the url of the L1 rpc
Expand Down
Loading