Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
c9cfe3cc
Unverified
Commit
c9cfe3cc
authored
Feb 20, 2023
by
tom goriunov
Committed by
GitHub
Feb 20, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #617 from blockscout/l2-setup
l2 setup
parents
0d732f3f
d776c7cc
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
0 deletions
+59
-0
.env.template
.env.template
+4
-0
README.md
README.md
+6
-0
config.ts
configs/app/config.ts
+4
-0
.env.goerli.l2test
configs/envs/.env.goerli.l2test
+29
-0
getServerSidePropsL2.ts
lib/next/getServerSidePropsL2.ts
+15
-0
package.json
package.json
+1
-0
No files found.
.env.template
View file @
c9cfe3cc
...
@@ -53,3 +53,7 @@ NEXT_PUBLIC_VISUALIZE_API_HOST=__PLACEHOLDER_FOR_NEXT_PUBLIC_VISUALIZE_API_HOST_
...
@@ -53,3 +53,7 @@ NEXT_PUBLIC_VISUALIZE_API_HOST=__PLACEHOLDER_FOR_NEXT_PUBLIC_VISUALIZE_API_HOST_
NEXT_PUBLIC_SENTRY_DSN=__PLACEHOLDER_FOR_NEXT_PUBLIC_SENTRY_DSN__
NEXT_PUBLIC_SENTRY_DSN=__PLACEHOLDER_FOR_NEXT_PUBLIC_SENTRY_DSN__
NEXT_PUBLIC_AUTH0_CLIENT_ID=__PLACEHOLDER_FOR_NEXT_PUBLIC_AUTH0_CLIENT_ID__
NEXT_PUBLIC_AUTH0_CLIENT_ID=__PLACEHOLDER_FOR_NEXT_PUBLIC_AUTH0_CLIENT_ID__
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=__PLACEHOLDER_FOR_NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID__
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=__PLACEHOLDER_FOR_NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID__
# l2 config
NEXT_PUBLIC_IS_L2_NETWORK=__PLACEHOLDER_FOR_NEXT_PUBLIC_IS_L2_NETWORKL__
NEXT_PUBLIC_L1_BASE_URL=__PLACEHOLDER_FOR_NEXT_PUBLIC_L1_BASE_URL__
README.md
View file @
c9cfe3cc
...
@@ -128,6 +128,12 @@ The app instance could be customized by passing following variables to NodeJS en
...
@@ -128,6 +128,12 @@ The app instance could be customized by passing following variables to NodeJS en
| NEXT_PUBLIC_AUTH0_CLIENT_ID |
`string`
*(optional)*
| Client id for
[
Auth0
](
https://auth0.com/
)
provider |
`<secret>`
|
| NEXT_PUBLIC_AUTH0_CLIENT_ID |
`string`
*(optional)*
| Client id for
[
Auth0
](
https://auth0.com/
)
provider |
`<secret>`
|
| NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID |
`string`
| Project id for
[
WalletConnect
](
https://docs.walletconnect.com/2.0/web3modal/react/installation#obtain-project-id
)
integration |
`<secret>`
|
| NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID |
`string`
| Project id for
[
WalletConnect
](
https://docs.walletconnect.com/2.0/web3modal/react/installation#obtain-project-id
)
integration |
`<secret>`
|
### L2 configuration
| Variable | Type | Description | Default value
| --- | --- | --- | --- |
| NEXT_PUBLIC_IS_L2_NETWORK |
`boolean`
*(optional)*
| Set to true for L2 solutions (Optimism Bedrock based) | false |
| NEXT_PUBLIC_L1_BASE_URL |
`string`
*(optional)*
| Base Blockscout URL for L1 network |
`'http://eth-goerli.blockscout.com'`
|
### Marketplace app configuration properties
### Marketplace app configuration properties
| Property | Type | Description | Example value
| Property | Type | Description | Example value
...
...
configs/app/config.ts
View file @
c9cfe3cc
...
@@ -104,6 +104,10 @@ const config = Object.freeze({
...
@@ -104,6 +104,10 @@ const config = Object.freeze({
socket
:
apiHost
?
`wss://
${
apiHost
}
`
:
'
wss://blockscout.com
'
,
socket
:
apiHost
?
`wss://
${
apiHost
}
`
:
'
wss://blockscout.com
'
,
basePath
:
stripTrailingSlash
(
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_API_BASE_PATH
)
||
''
),
basePath
:
stripTrailingSlash
(
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_API_BASE_PATH
)
||
''
),
},
},
L2
:
{
isL2Network
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_IS_L2_NETWORK
)
===
'
true
'
,
L1BaseUrl
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_L1_BASE_URL
),
},
statsApi
:
{
statsApi
:
{
endpoint
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_STATS_API_HOST
),
endpoint
:
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_STATS_API_HOST
),
basePath
:
''
,
basePath
:
''
,
...
...
configs/envs/.env.goerli.l2test
0 → 100644
View file @
c9cfe3cc
This diff is collapsed.
Click to expand it.
lib/next/getServerSidePropsL2.ts
0 → 100644
View file @
c9cfe3cc
import
type
{
GetServerSideProps
}
from
'
next
'
;
import
appConfig
from
'
configs/app/config
'
;
import
type
{
Props
}
from
'
lib/next/getServerSideProps
'
;
import
{
getServerSideProps
as
getServerSidePropsBase
}
from
'
lib/next/getServerSideProps
'
;
export
const
getServerSideProps
:
GetServerSideProps
<
Props
>
=
async
(
args
)
=>
{
if
(
!
appConfig
.
L2
.
isL2Network
)
{
return
{
notFound
:
true
,
};
}
return
getServerSidePropsBase
(
args
);
};
package.json
View file @
c9cfe3cc
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
"dev:local"
:
"./node_modules/.bin/dotenv -e ./configs/envs/.env.localhost -e ./configs/envs/.env.secrets next dev | ./node_modules/.bin/pino-pretty"
,
"dev:local"
:
"./node_modules/.bin/dotenv -e ./configs/envs/.env.localhost -e ./configs/envs/.env.secrets next dev | ./node_modules/.bin/pino-pretty"
,
"dev:poa_core"
:
"./node_modules/.bin/dotenv -e ./configs/envs/.env.poa_core -e ./configs/envs/.env.common -e ./configs/envs/.env.secrets next dev | ./node_modules/.bin/pino-pretty"
,
"dev:poa_core"
:
"./node_modules/.bin/dotenv -e ./configs/envs/.env.poa_core -e ./configs/envs/.env.common -e ./configs/envs/.env.secrets next dev | ./node_modules/.bin/pino-pretty"
,
"dev:goerli"
:
"./node_modules/.bin/dotenv -e ./configs/envs/.env.goerli -e ./configs/envs/.env.common -e ./configs/envs/.env.secrets next dev | ./node_modules/.bin/pino-pretty"
,
"dev:goerli"
:
"./node_modules/.bin/dotenv -e ./configs/envs/.env.goerli -e ./configs/envs/.env.common -e ./configs/envs/.env.secrets next dev | ./node_modules/.bin/pino-pretty"
,
"dev:goerli:l2test"
:
"./node_modules/.bin/dotenv -e ./configs/envs/.env.goerli.l2test -e ./configs/envs/.env.common -e ./configs/envs/.env.secrets next dev | ./node_modules/.bin/pino-pretty"
,
"build"
:
"next build"
,
"build"
:
"next build"
,
"build:docker"
:
"docker build --build-arg GIT_COMMIT_SHA=$(git rev-parse HEAD) -t blockscout ./"
,
"build:docker"
:
"docker build --build-arg GIT_COMMIT_SHA=$(git rev-parse HEAD) -t blockscout ./"
,
"start"
:
"next start"
,
"start"
:
"next start"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment