Skip to content

Commit

Permalink
rename to gateway server
Browse files Browse the repository at this point in the history
  • Loading branch information
blade committed Apr 9, 2024
1 parent ae8f249 commit 10393b5
Show file tree
Hide file tree
Showing 46 changed files with 148 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package config
import (
"fmt"
"github.com/joho/godotenv"
"github.com/pokt-network/gateway-server/internal/global_config"
"os"
"pokt_gateway_server/internal/global_config"
"strconv"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/gateway_server/internal/config/provider.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package config

import (
"pokt_gateway_server/internal/global_config"
"github.com/pokt-network/gateway-server/internal/global_config"
)

type GatewayServerProvider interface {
Expand Down
16 changes: 8 additions & 8 deletions cmd/gateway_server/internal/controllers/pokt_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package controllers
import (
"context"
"github.com/jackc/pgtype"
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/common"
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/models"
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/transform"
"github.com/pokt-network/gateway-server/internal/apps_registry"
"github.com/pokt-network/gateway-server/internal/db_query"
"github.com/pokt-network/gateway-server/internal/global_config"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0"
pokt_models "github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0/models"
"github.com/pquerna/ffjson/ffjson"
"github.com/valyala/fasthttp"
"go.uber.org/zap"
"pokt_gateway_server/cmd/gateway_server/internal/common"
"pokt_gateway_server/cmd/gateway_server/internal/models"
"pokt_gateway_server/cmd/gateway_server/internal/transform"
"pokt_gateway_server/internal/apps_registry"
"pokt_gateway_server/internal/db_query"
"pokt_gateway_server/internal/global_config"
"pokt_gateway_server/pkg/pokt/pokt_v0"
pokt_models "pokt_gateway_server/pkg/pokt/pokt_v0/models"
)

type addApplicationBody struct {
Expand Down
8 changes: 4 additions & 4 deletions cmd/gateway_server/internal/controllers/qos_nodes.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package controllers

import (
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/common"
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/models"
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/transform"
"github.com/pokt-network/gateway-server/internal/session_registry"
"github.com/valyala/fasthttp"
"go.uber.org/zap"
"pokt_gateway_server/cmd/gateway_server/internal/common"
"pokt_gateway_server/cmd/gateway_server/internal/models"
"pokt_gateway_server/cmd/gateway_server/internal/transform"
"pokt_gateway_server/internal/session_registry"
)

// QosNodeController handles requests for staked applications
Expand Down
6 changes: 3 additions & 3 deletions cmd/gateway_server/internal/controllers/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package controllers

import (
"fmt"
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/common"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0/models"
"github.com/valyala/fasthttp"
"go.uber.org/zap"
"pokt_gateway_server/cmd/gateway_server/internal/common"
"pokt_gateway_server/pkg/pokt/pokt_v0"
"pokt_gateway_server/pkg/pokt/pokt_v0/models"
"strings"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/gateway_server/internal/controllers/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package controllers
// Basic imports
import (
"errors"
pocket_service_mock "pokt_gateway_server/mocks/pocket_service"
"pokt_gateway_server/pkg/pokt/pokt_v0/models"
pocket_service_mock "github.com/pokt-network/gateway-server/mocks/pocket_service"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0/models"
"testing"

"github.com/stretchr/testify/suite"
Expand Down
4 changes: 2 additions & 2 deletions cmd/gateway_server/internal/middleware/x-api-key.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package middleware

import (
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/common"
config2 "github.com/pokt-network/gateway-server/internal/global_config"
"github.com/valyala/fasthttp"
"pokt_gateway_server/cmd/gateway_server/internal/common"
config2 "pokt_gateway_server/internal/global_config"
)

func retrieveAPIKey(ctx *fasthttp.RequestCtx) string {
Expand Down
4 changes: 2 additions & 2 deletions cmd/gateway_server/internal/transform/pokt_application.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package transform

import (
"pokt_gateway_server/cmd/gateway_server/internal/models"
internal_model "pokt_gateway_server/internal/apps_registry/models"
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/models"
internal_model "github.com/pokt-network/gateway-server/internal/apps_registry/models"
)

func ToPoktApplication(app *internal_model.PoktApplicationSigner) *models.PublicPoktApplication {
Expand Down
4 changes: 2 additions & 2 deletions cmd/gateway_server/internal/transform/qos_node.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package transform

import (
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/models"
internal_model "github.com/pokt-network/gateway-server/internal/node_selector_service/models"
"math"
"pokt_gateway_server/cmd/gateway_server/internal/models"
internal_model "pokt_gateway_server/internal/node_selector_service/models"
)

func ToPublicQosNode(node *internal_model.QosNode) *models.PublicQosNode {
Expand Down
24 changes: 12 additions & 12 deletions cmd/gateway_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import (
"github.com/fasthttp/router"
fasthttpprometheus "github.com/flf2ko/fasthttp-prometheus"
"github.com/jellydator/ttlcache/v3"
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/config"
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/controllers"
"github.com/pokt-network/gateway-server/cmd/gateway_server/internal/middleware"
"github.com/pokt-network/gateway-server/internal/apps_registry"
"github.com/pokt-network/gateway-server/internal/chain_configurations_registry"
"github.com/pokt-network/gateway-server/internal/db_query"
"github.com/pokt-network/gateway-server/internal/logging"
"github.com/pokt-network/gateway-server/internal/node_selector_service"
qos_models "github.com/pokt-network/gateway-server/internal/node_selector_service/models"
"github.com/pokt-network/gateway-server/internal/relayer"
"github.com/pokt-network/gateway-server/internal/session_registry"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0"
"github.com/valyala/fasthttp"
"pokt_gateway_server/cmd/gateway_server/internal/config"
"pokt_gateway_server/cmd/gateway_server/internal/controllers"
"pokt_gateway_server/cmd/gateway_server/internal/middleware"
"pokt_gateway_server/internal/apps_registry"
"pokt_gateway_server/internal/chain_configurations_registry"
"pokt_gateway_server/internal/db_query"
"pokt_gateway_server/internal/logging"
"pokt_gateway_server/internal/node_selector_service"
qos_models "pokt_gateway_server/internal/node_selector_service/models"
"pokt_gateway_server/internal/relayer"
"pokt_gateway_server/internal/session_registry"
"pokt_gateway_server/pkg/pokt/pokt_v0"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/apps_registry/app_registry_service.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package apps_registry

import "pokt_gateway_server/internal/apps_registry/models"
import "github.com/pokt-network/gateway-server/internal/apps_registry/models"

type AppsRegistryService interface {
GetApplications() []*models.PoktApplicationSigner
Expand Down
10 changes: 5 additions & 5 deletions internal/apps_registry/cached_app_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package apps_registry
import (
"context"
"errors"
"github.com/pokt-network/gateway-server/internal/apps_registry/models"
"github.com/pokt-network/gateway-server/internal/db_query"
"github.com/pokt-network/gateway-server/internal/global_config"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0"
pokt "github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0/models"
"go.uber.org/zap"
"pokt_gateway_server/internal/apps_registry/models"
"pokt_gateway_server/internal/db_query"
"pokt_gateway_server/internal/global_config"
"pokt_gateway_server/pkg/pokt/pokt_v0"
pokt "pokt_gateway_server/pkg/pokt/pokt_v0/models"
"sort"
"strings"
"sync"
Expand Down
2 changes: 1 addition & 1 deletion internal/apps_registry/models/application.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package models

import (
"pokt_gateway_server/pkg/pokt/pokt_v0/models"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0/models"
)

type PoktApplicationSigner struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package chain_configurations_registry

import (
"context"
"github.com/pokt-network/gateway-server/internal/db_query"
"go.uber.org/zap"
"pokt_gateway_server/internal/db_query"
"sync"
"time"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package chain_configurations_registry

import "pokt_gateway_server/internal/db_query"
import "github.com/pokt-network/gateway-server/internal/db_query"

type ChainConfigurationsService interface {
GetChainConfiguration(chainId string) (db_query.GetChainConfigurationsRow, bool)
Expand Down
4 changes: 2 additions & 2 deletions internal/db_query/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"github.com/golang-migrate/migrate/v4/source/iofs"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/pkg/errors"
root "github.com/pokt-network/gateway-server"
"github.com/pokt-network/gateway-server/internal/global_config"
"go.uber.org/zap"
root "pokt_gateway_server"
"pokt_gateway_server/internal/global_config"
)

// InitDB - runs DB migrations and provides a code-generated query interface
Expand Down
2 changes: 1 addition & 1 deletion internal/logging/logger.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package logging

import (
"github.com/pokt-network/gateway-server/internal/global_config"
"go.uber.org/zap"
"pokt_gateway_server/internal/global_config"
)

func NewLogger(provider global_config.EnvironmentProvider) (*zap.Logger, error) {
Expand Down
6 changes: 3 additions & 3 deletions internal/node_selector_service/checks/async_relay_handler.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package checks

import (
"pokt_gateway_server/internal/node_selector_service/models"
"pokt_gateway_server/pkg/pokt/pokt_v0"
relayer_models "pokt_gateway_server/pkg/pokt/pokt_v0/models"
"github.com/pokt-network/gateway-server/internal/node_selector_service/models"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0"
relayer_models "github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0/models"
"sync"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package checks

import "pokt_gateway_server/internal/chain_configurations_registry"
import "github.com/pokt-network/gateway-server/internal/chain_configurations_registry"

// GetBlockHeightTolerance - helper function to retrieve block height tolerance across checks
func GetBlockHeightTolerance(chainConfiguration chain_configurations_registry.ChainConfigurationsService, chainId string, defaultValue int) int {
Expand Down
4 changes: 2 additions & 2 deletions internal/node_selector_service/checks/error_handler.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package checks

import (
"github.com/pokt-network/gateway-server/internal/node_selector_service/models"
relayer_models "github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0/models"
"github.com/valyala/fasthttp"
"go.uber.org/zap"
"pokt_gateway_server/internal/node_selector_service/models"
relayer_models "pokt_gateway_server/pkg/pokt/pokt_v0/models"
"strings"
"time"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package evm_data_integrity_check
import (
"encoding/json"
"fmt"
"github.com/pokt-network/gateway-server/internal/node_selector_service/checks"
"github.com/pokt-network/gateway-server/internal/node_selector_service/models"
"github.com/pokt-network/gateway-server/pkg/common"
"github.com/valyala/fasthttp"
"go.uber.org/zap"
"pokt_gateway_server/internal/node_selector_service/checks"
"pokt_gateway_server/internal/node_selector_service/models"
"pokt_gateway_server/pkg/common"
"strconv"
"time"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package evm_height_check
import (
"encoding/json"
"fmt"
"github.com/pokt-network/gateway-server/internal/node_selector_service/checks"
"github.com/pokt-network/gateway-server/internal/node_selector_service/models"
"github.com/pquerna/ffjson/ffjson"
"github.com/valyala/fasthttp"
"go.uber.org/zap"
"gonum.org/v1/gonum/stat"
"math"
"pokt_gateway_server/internal/node_selector_service/checks"
"pokt_gateway_server/internal/node_selector_service/models"
"strconv"
"strings"
"time"
Expand Down
6 changes: 3 additions & 3 deletions internal/node_selector_service/checks/qos_check.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package checks

import (
"pokt_gateway_server/internal/chain_configurations_registry"
qos_models "pokt_gateway_server/internal/node_selector_service/models"
"pokt_gateway_server/pkg/pokt/pokt_v0"
"github.com/pokt-network/gateway-server/internal/chain_configurations_registry"
qos_models "github.com/pokt-network/gateway-server/internal/node_selector_service/models"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0"
)

type CheckJob interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/node_selector_service/models/qos_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package models

import (
"github.com/influxdata/tdigest"
"pokt_gateway_server/pkg/pokt/pokt_v0/models"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0/models"
"sync"
"time"
)
Expand Down
16 changes: 8 additions & 8 deletions internal/node_selector_service/node_selector_service.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package node_selector_service

import (
"github.com/pokt-network/gateway-server/internal/chain_configurations_registry"
"github.com/pokt-network/gateway-server/internal/node_selector_service/checks"
"github.com/pokt-network/gateway-server/internal/node_selector_service/checks/evm_data_integrity_check"
"github.com/pokt-network/gateway-server/internal/node_selector_service/checks/evm_height_check"
"github.com/pokt-network/gateway-server/internal/node_selector_service/models"
"github.com/pokt-network/gateway-server/internal/session_registry"
"github.com/pokt-network/gateway-server/pkg/common"
"github.com/pokt-network/gateway-server/pkg/pokt/pokt_v0"
"go.uber.org/zap"
"pokt_gateway_server/internal/chain_configurations_registry"
"pokt_gateway_server/internal/node_selector_service/checks"
"pokt_gateway_server/internal/node_selector_service/checks/evm_data_integrity_check"
"pokt_gateway_server/internal/node_selector_service/checks/evm_height_check"
"pokt_gateway_server/internal/node_selector_service/models"
"pokt_gateway_server/internal/session_registry"
"pokt_gateway_server/pkg/common"
"pokt_gateway_server/pkg/pokt/pokt_v0"
"sort"
"time"
)
Expand Down
Loading

0 comments on commit 10393b5

Please sign in to comment.