A Next.js application for viewing verified smart contract details from the Sourcify API.
- Node.js 18.x or later
- npm or yarn
- Docker (optional, for containerized deployment)
Create a .env file in the root directory with the following variables:
SOURCIFY_SERVER_URL=https://sourcify.dev/server
# NODE_ENV=development or NODE_ENV=production-
Clone the repository:
git clone https://github.com/sourcifyeth/repo.sourcify.dev.git cd repo.sourcify.dev -
Install dependencies:
npm install # or yarn install -
Run the development server:
npm run dev # or yarn dev -
Open http://localhost:3000 in your browser to see the application.
npm run build
npm start
# or
yarn build
yarn startThe project includes a Dockerfile based on the official Next.js Docker example.
Keep in mind you need to pass the SOURCIFY_SERVER_URL as a build argument. The way to pass this might differ depending on your build platform. In Google Cloud Build, you need to pass it as a value to be substituted in your cloudbuild.yaml file:
steps:
- name: gcr.io/cloud-builders/docker
args:
- build
- "--build-arg"
- "SOURCIFY_SERVER_URL=${_SOURCIFY_SERVER_URL}"
---
substitutions:
_SOURCIFY_SERVER_URL: https://sourcify.dev/server-
Build the Docker image:
# Build the image with the Sourcify server URL as a build argument docker build --build-arg SOURCIFY_SERVER_URL=https://sourcify.dev/server -t repo-sourcify .
-
Run the container:
docker run -p 3000:3000 -e SOURCIFY_SERVER_URL=https://sourcify.dev/server repo-sourcify
-
Access the application at http://localhost:3000.