diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..836b79c0 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,54 @@ +name: Create and publish a Docker image + +on: + push: + branches: ['dev'] + pull_request: + branches: ['dev'] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + display-image-name: + runs-on: ubuntu-latest + steps: + - name: Display IMAGE_NAME + run: echo "IMAGE_NAME is ${{ env.IMAGE_NAME }}" + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.PAT_TOKEN }} # ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true diff --git a/src/config.ts b/src/config.ts index 9f5e35d7..a633cf32 100644 --- a/src/config.ts +++ b/src/config.ts @@ -120,7 +120,7 @@ export const CONFIG: Config = { port: Number(process.env.LOG_SERVER_PORT) || 4446, }, ip: '0.0.0.0', - port: 8080, + port: Number(process.env.RPC_PORT) || 8080, chainId: 8082, nodeIpInfo: { externalIp: process.env.NODE_EXTERNAL_IP || '127.0.0.1', @@ -131,23 +131,23 @@ export const CONFIG: Config = { askLocalHostForArchiver: true, rotationInterval: 60, faucetServerUrl: process.env.FAUCET_URL || 'https://faucet.liberty10.shardeum.org', - queryFromValidator: true, + queryFromValidator: Boolean(process.env.QUERY_FROM_VALIDATOR) || true, explorerUrl: process.env.EXPLORER_URL || 'http://127.0.0.1:6001', queryFromExplorer: false, generateTxTimestamp: true, - nodelistRefreshInterval: 30000, + nodelistRefreshInterval: Number(process.env.NODELIST_REFRESH_INTERVAL) || 30000, defaultRequestRetry: 5, - gasEstimateMethod: 'serviceValidator', //serviceValidator or replayEngine or validator + gasEstimateMethod: process.env.GAS_ESTIMATE_METHOD || 'serviceValidator', //serviceValidator or replayEngine or validator gasEstimateInvalidationIntervalInMs: 1000 * 60 * 60 * 2, // 2 hours gasEstimateUseCache: false, - staticGasEstimate: '0x5B8D80', // comment out rather than delete this line + staticGasEstimate: process.env.STATIC_GAS_ESTIMATE || '0x5B8D80', // comment out rather than delete this line defaultRequestTimeout: { default: 2000, contract: 7000, account: 10000, full_nodelist: 10000, }, - aalgWarmup: false, + aalgWarmup: Boolean(process.env.AALG_WARMUP) || true, aalgWarmupServiceTPS: 10, recordTxStatus: false, // not safe for production, keep this off. Known issue. rateLimit: false,