Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
341f4510
Unverified
Commit
341f4510
authored
Aug 25, 2020
by
Shude Li
Committed by
GitHub
Aug 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graphql: add support for retrieving the chain id (#21451)
parent
d13b8e55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
graphql.go
graphql/graphql.go
+4
-0
schema.go
graphql/schema.go
+2
-0
No files found.
graphql/graphql.go
View file @
341f4510
...
...
@@ -1044,6 +1044,10 @@ func (r *Resolver) ProtocolVersion(ctx context.Context) (int32, error) {
return
int32
(
r
.
backend
.
ProtocolVersion
()),
nil
}
func
(
r
*
Resolver
)
ChainID
(
ctx
context
.
Context
)
(
hexutil
.
Big
,
error
)
{
return
hexutil
.
Big
(
*
r
.
backend
.
ChainConfig
()
.
ChainID
),
nil
}
// SyncState represents the synchronisation status returned from the `syncing` accessor.
type
SyncState
struct
{
progress
ethereum
.
SyncProgress
...
...
graphql/schema.go
View file @
341f4510
...
...
@@ -314,6 +314,8 @@ const schema string = `
protocolVersion: Int!
# Syncing returns information on the current synchronisation state.
syncing: SyncState
# ChainID returns the current chain ID for transaction replay protection.
chainID: BigInt!
}
type Mutation {
...
...
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