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
e1c6c01b
Commit
e1c6c01b
authored
Mar 29, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
parents
b7a0bc70
391d79ef
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
26 deletions
+18
-26
.travis.yml
.travis.yml
+1
-1
Dockerfile
Dockerfile
+2
-2
README.md
README.md
+2
-2
api.go
rpc/api.go
+1
-2
args.go
rpc/args.go
+7
-14
http.go
rpc/http.go
+1
-1
responses.go
rpc/responses.go
+4
-4
No files found.
.travis.yml
View file @
e1c6c01b
...
@@ -9,7 +9,7 @@ install:
...
@@ -9,7 +9,7 @@ install:
# - go get code.google.com/p/go.tools/cmd/goimports
# - go get code.google.com/p/go.tools/cmd/goimports
# - go get github.com/golang/lint/golint
# - go get github.com/golang/lint/golint
# - go get golang.org/x/tools/cmd/vet
# - go get golang.org/x/tools/cmd/vet
-
if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
-
go get golang.org/x/tools/cmd/cover
-
go get github.com/mattn/goveralls
-
go get github.com/mattn/goveralls
before_script
:
before_script
:
# - gofmt -l -w .
# - gofmt -l -w .
...
...
Dockerfile
View file @
e1c6c01b
...
@@ -30,10 +30,10 @@ RUN mkdir -p $GOPATH/src/github.com/ethereum/
...
@@ -30,10 +30,10 @@ RUN mkdir -p $GOPATH/src/github.com/ethereum/
RUN
git clone https://github.com/ethereum/go-ethereum
$GOPATH
/src/github.com/ethereum/go-ethereum
RUN
git clone https://github.com/ethereum/go-ethereum
$GOPATH
/src/github.com/ethereum/go-ethereum
WORKDIR
$GOPATH/src/github.com/ethereum/go-ethereum
WORKDIR
$GOPATH/src/github.com/ethereum/go-ethereum
RUN
git checkout develop
RUN
git checkout develop
RUN
GOPATH
=
$GOPATH
:
$GOPATH
/src/github.com/ethereum/go-ethereum/Godeps/_workspace go
install
-v
./cmd/
ethereum
RUN
GOPATH
=
$GOPATH
:
$GOPATH
/src/github.com/ethereum/go-ethereum/Godeps/_workspace go
install
-v
./cmd/
geth
## Run & expose JSON RPC
## Run & expose JSON RPC
ENTRYPOINT
["
ethereum
", "-rpc=true", "-rpcport=8545"]
ENTRYPOINT
["
geth
", "-rpc=true", "-rpcport=8545"]
EXPOSE
8545
EXPOSE
8545
README.md
View file @
e1c6c01b
...
@@ -4,8 +4,8 @@ Ethereum Go Client © 2014 Jeffrey Wilcke.
...
@@ -4,8 +4,8 @@ Ethereum Go Client © 2014 Jeffrey Wilcke.
| Linux | OSX | Windows | Tests
| Linux | OSX | Windows | Tests
----------|---------|-----|---------|------
----------|---------|-----|---------|------
develop |
[

](https://build.ethdev.com/builders/Linux%20Go%20develop%20branch/builds/-1) |
[

](https://build.ethdev.com/builders/OSX%20Go%20develop%20branch/builds/-1) | N/A |
[

](https://travis-ci.org/ethereum/go-ethereum)
develop |
[

](https://build.ethdev.com/builders/Linux%20Go%20develop%20branch/builds/-1) |
[

](https://build.ethdev.com/builders/OSX%20Go%20develop%20branch/builds/-1) | N/A |
[

](https://travis-ci.org/ethereum/go-ethereum)
[

](https://coveralls.io/r/ethereum/go-ethereum?branch=develop)
master |
[

](https://build.ethdev.com/builders/Linux%20Go%20master%20branch/builds/-1) |
[

](https://build.ethdev.com/builders/OSX%20Go%20master%20branch/builds/-1) | N/A |
[

](https://travis-ci.org/ethereum/go-ethereum)
master |
[

](https://build.ethdev.com/builders/Linux%20Go%20master%20branch/builds/-1) |
[

](https://build.ethdev.com/builders/OSX%20Go%20master%20branch/builds/-1) | N/A |
[

](https://travis-ci.org/ethereum/go-ethereum)
[

](https://coveralls.io/r/ethereum/go-ethereum?branch=master)
[

](https://waffle.io/ethereum/go-ethereum)
[

](https://waffle.io/ethereum/go-ethereum)
[

](https://waffle.io/ethereum/go-ethereum)
[

](https://waffle.io/ethereum/go-ethereum)
...
...
rpc/api.go
View file @
e1c6c01b
...
@@ -13,7 +13,6 @@ import (
...
@@ -13,7 +13,6 @@ import (
type
EthereumApi
struct
{
type
EthereumApi
struct
{
eth
*
xeth
.
XEth
eth
*
xeth
.
XEth
xethMu
sync
.
RWMutex
xethMu
sync
.
RWMutex
db
common
.
Database
}
}
func
NewEthereumApi
(
xeth
*
xeth
.
XEth
)
*
EthereumApi
{
func
NewEthereumApi
(
xeth
*
xeth
.
XEth
)
*
EthereumApi
{
...
@@ -99,7 +98,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
...
@@ -99,7 +98,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
state
:=
api
.
xethAtStateNum
(
args
.
BlockNumber
)
.
State
()
.
SafeGet
(
args
.
Address
)
state
:=
api
.
xethAtStateNum
(
args
.
BlockNumber
)
.
State
()
.
SafeGet
(
args
.
Address
)
value
:=
state
.
StorageString
(
args
.
Key
)
value
:=
state
.
StorageString
(
args
.
Key
)
*
reply
=
common
.
Bytes2
Hex
(
value
.
Bytes
())
*
reply
=
common
.
To
Hex
(
value
.
Bytes
())
case
"eth_getTransactionCount"
:
case
"eth_getTransactionCount"
:
args
:=
new
(
GetTxCountArgs
)
args
:=
new
(
GetTxCountArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
rpc/args.go
View file @
e1c6c01b
package
rpc
package
rpc
import
(
import
(
"bytes"
"encoding/json"
"encoding/json"
// "errors"
"fmt"
"fmt"
"math/big"
"math/big"
...
@@ -105,8 +103,8 @@ type GetBlockByHashArgs struct {
...
@@ -105,8 +103,8 @@ type GetBlockByHashArgs struct {
func
(
args
*
GetBlockByHashArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
func
(
args
*
GetBlockByHashArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
var
obj
[]
interface
{}
var
obj
[]
interface
{}
r
:=
bytes
.
NewReader
(
b
)
if
err
:=
json
.
NewDecoder
(
r
)
.
Decode
(
&
obj
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
(
b
,
&
obj
);
err
!=
nil
{
return
NewDecodeParamError
(
err
.
Error
())
return
NewDecodeParamError
(
err
.
Error
())
}
}
...
@@ -134,8 +132,7 @@ type GetBlockByNumberArgs struct {
...
@@ -134,8 +132,7 @@ type GetBlockByNumberArgs struct {
func
(
args
*
GetBlockByNumberArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
func
(
args
*
GetBlockByNumberArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
var
obj
[]
interface
{}
var
obj
[]
interface
{}
r
:=
bytes
.
NewReader
(
b
)
if
err
:=
json
.
Unmarshal
(
b
,
&
obj
);
err
!=
nil
{
if
err
:=
json
.
NewDecoder
(
r
)
.
Decode
(
&
obj
);
err
!=
nil
{
return
NewDecodeParamError
(
err
.
Error
())
return
NewDecodeParamError
(
err
.
Error
())
}
}
...
@@ -405,8 +402,7 @@ type BlockNumIndexArgs struct {
...
@@ -405,8 +402,7 @@ type BlockNumIndexArgs struct {
func
(
args
*
BlockNumIndexArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
func
(
args
*
BlockNumIndexArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
var
obj
[]
interface
{}
var
obj
[]
interface
{}
r
:=
bytes
.
NewReader
(
b
)
if
err
:=
json
.
Unmarshal
(
b
,
&
obj
);
err
!=
nil
{
if
err
:=
json
.
NewDecoder
(
r
)
.
Decode
(
&
obj
);
err
!=
nil
{
return
NewDecodeParamError
(
err
.
Error
())
return
NewDecodeParamError
(
err
.
Error
())
}
}
...
@@ -436,8 +432,7 @@ type HashIndexArgs struct {
...
@@ -436,8 +432,7 @@ type HashIndexArgs struct {
func
(
args
*
HashIndexArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
func
(
args
*
HashIndexArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
var
obj
[]
interface
{}
var
obj
[]
interface
{}
r
:=
bytes
.
NewReader
(
b
)
if
err
:=
json
.
Unmarshal
(
b
,
&
obj
);
err
!=
nil
{
if
err
:=
json
.
NewDecoder
(
r
)
.
Decode
(
&
obj
);
err
!=
nil
{
return
NewDecodeParamError
(
err
.
Error
())
return
NewDecodeParamError
(
err
.
Error
())
}
}
...
@@ -468,8 +463,7 @@ type Sha3Args struct {
...
@@ -468,8 +463,7 @@ type Sha3Args struct {
func
(
args
*
Sha3Args
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
func
(
args
*
Sha3Args
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
var
obj
[]
interface
{}
var
obj
[]
interface
{}
r
:=
bytes
.
NewReader
(
b
)
if
err
:=
json
.
Unmarshal
(
b
,
&
obj
);
err
!=
nil
{
if
err
:=
json
.
NewDecoder
(
r
)
.
Decode
(
&
obj
);
err
!=
nil
{
return
NewDecodeParamError
(
err
.
Error
())
return
NewDecodeParamError
(
err
.
Error
())
}
}
...
@@ -798,8 +792,7 @@ type FilterStringArgs struct {
...
@@ -798,8 +792,7 @@ type FilterStringArgs struct {
func
(
args
*
FilterStringArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
func
(
args
*
FilterStringArgs
)
UnmarshalJSON
(
b
[]
byte
)
(
err
error
)
{
var
obj
[]
interface
{}
var
obj
[]
interface
{}
r
:=
bytes
.
NewReader
(
b
)
if
err
:=
json
.
Unmarshal
(
b
,
&
obj
);
err
!=
nil
{
if
err
:=
json
.
NewDecoder
(
r
)
.
Decode
(
&
obj
);
err
!=
nil
{
return
NewDecodeParamError
(
err
.
Error
())
return
NewDecodeParamError
(
err
.
Error
())
}
}
...
...
rpc/http.go
View file @
e1c6c01b
...
@@ -76,7 +76,7 @@ func RpcResponse(api *EthereumApi, request *RpcRequest) *interface{} {
...
@@ -76,7 +76,7 @@ func RpcResponse(api *EthereumApi, request *RpcRequest) *interface{} {
case
*
NotImplementedError
:
case
*
NotImplementedError
:
jsonerr
:=
&
RpcErrorObject
{
-
32601
,
reserr
.
Error
()}
jsonerr
:=
&
RpcErrorObject
{
-
32601
,
reserr
.
Error
()}
response
=
&
RpcErrorResponse
{
Jsonrpc
:
jsonrpcver
,
Id
:
request
.
Id
,
Error
:
jsonerr
}
response
=
&
RpcErrorResponse
{
Jsonrpc
:
jsonrpcver
,
Id
:
request
.
Id
,
Error
:
jsonerr
}
case
*
DecodeParamError
,
*
InsufficientParamsError
,
*
ValidationError
:
case
*
DecodeParamError
,
*
InsufficientParamsError
,
*
ValidationError
,
*
InvalidTypeError
:
jsonerr
:=
&
RpcErrorObject
{
-
32602
,
reserr
.
Error
()}
jsonerr
:=
&
RpcErrorObject
{
-
32602
,
reserr
.
Error
()}
response
=
&
RpcErrorResponse
{
Jsonrpc
:
jsonrpcver
,
Id
:
request
.
Id
,
Error
:
jsonerr
}
response
=
&
RpcErrorResponse
{
Jsonrpc
:
jsonrpcver
,
Id
:
request
.
Id
,
Error
:
jsonerr
}
default
:
default
:
...
...
rpc/responses.go
View file @
e1c6c01b
...
@@ -70,7 +70,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
...
@@ -70,7 +70,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
ext
.
Difficulty
=
common
.
ToHex
(
b
.
Difficulty
.
Bytes
())
ext
.
Difficulty
=
common
.
ToHex
(
b
.
Difficulty
.
Bytes
())
ext
.
TotalDifficulty
=
common
.
ToHex
(
b
.
TotalDifficulty
.
Bytes
())
ext
.
TotalDifficulty
=
common
.
ToHex
(
b
.
TotalDifficulty
.
Bytes
())
ext
.
Size
=
common
.
ToHex
(
b
.
Size
.
Bytes
())
ext
.
Size
=
common
.
ToHex
(
b
.
Size
.
Bytes
())
//
ext.ExtraData = common.ToHex(b.ExtraData)
ext
.
ExtraData
=
common
.
ToHex
(
b
.
ExtraData
)
ext
.
GasLimit
=
common
.
ToHex
(
b
.
GasLimit
.
Bytes
())
ext
.
GasLimit
=
common
.
ToHex
(
b
.
GasLimit
.
Bytes
())
// ext.MinGasPrice = common.ToHex(big.NewInt(b.MinGasPrice).Bytes())
// ext.MinGasPrice = common.ToHex(big.NewInt(b.MinGasPrice).Bytes())
ext
.
GasUsed
=
common
.
ToHex
(
b
.
GasUsed
.
Bytes
())
ext
.
GasUsed
=
common
.
ToHex
(
b
.
GasUsed
.
Bytes
())
...
@@ -111,7 +111,7 @@ func NewBlockRes(block *types.Block) *BlockRes {
...
@@ -111,7 +111,7 @@ func NewBlockRes(block *types.Block) *BlockRes {
res
.
Difficulty
=
block
.
Difficulty
()
res
.
Difficulty
=
block
.
Difficulty
()
res
.
TotalDifficulty
=
block
.
Td
res
.
TotalDifficulty
=
block
.
Td
res
.
Size
=
big
.
NewInt
(
int64
(
block
.
Size
()))
res
.
Size
=
big
.
NewInt
(
int64
(
block
.
Size
()))
// res.ExtraData =
res
.
ExtraData
=
[]
byte
(
block
.
Header
()
.
Extra
)
res
.
GasLimit
=
block
.
GasLimit
()
res
.
GasLimit
=
block
.
GasLimit
()
// res.MinGasPrice =
// res.MinGasPrice =
res
.
GasUsed
=
block
.
GasUsed
()
res
.
GasUsed
=
block
.
GasUsed
()
...
@@ -243,8 +243,8 @@ func (l *LogRes) MarshalJSON() ([]byte, error) {
...
@@ -243,8 +243,8 @@ func (l *LogRes) MarshalJSON() ([]byte, error) {
}
}
ext
.
Address
=
l
.
Address
.
Hex
()
ext
.
Address
=
l
.
Address
.
Hex
()
ext
.
Data
=
common
.
Bytes2
Hex
(
l
.
Data
)
ext
.
Data
=
common
.
To
Hex
(
l
.
Data
)
ext
.
Number
=
common
.
Bytes2
Hex
(
big
.
NewInt
(
int64
(
l
.
Number
))
.
Bytes
())
ext
.
Number
=
common
.
To
Hex
(
big
.
NewInt
(
int64
(
l
.
Number
))
.
Bytes
())
ext
.
Topics
=
make
([]
string
,
len
(
l
.
Topics
))
ext
.
Topics
=
make
([]
string
,
len
(
l
.
Topics
))
for
i
,
v
:=
range
l
.
Topics
{
for
i
,
v
:=
range
l
.
Topics
{
ext
.
Topics
[
i
]
=
v
.
Hex
()
ext
.
Topics
[
i
]
=
v
.
Hex
()
...
...
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