diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-13 18:01:34 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-13 18:01:34 +0800 |
commit | d31303a592bcf8662fbbe66e542535e0e82c5a83 (patch) | |
tree | 87e715b4aea81ab53757c41d474edb1dbb64bdbf /ethrpc | |
parent | a9d5656a466f2d57bcf97efdc4644ca20ae8bd6b (diff) | |
download | dexon-d31303a592bcf8662fbbe66e542535e0e82c5a83.tar.gz dexon-d31303a592bcf8662fbbe66e542535e0e82c5a83.tar.zst dexon-d31303a592bcf8662fbbe66e542535e0e82c5a83.zip |
Implemented support for a custom RPC port
Diffstat (limited to 'ethrpc')
-rw-r--r-- | ethrpc/server.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ethrpc/server.go b/ethrpc/server.go index a612f1163..3960e641c 100644 --- a/ethrpc/server.go +++ b/ethrpc/server.go @@ -1,6 +1,7 @@ package ethrpc import ( + "fmt" "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethutil" "net" @@ -48,8 +49,9 @@ func (s *JsonRpcServer) Start() { } } -func NewJsonRpcServer(ethp *ethpub.PEthereum) (*JsonRpcServer, error) { - l, err := net.Listen("tcp", ":8080") +func NewJsonRpcServer(ethp *ethpub.PEthereum, port int) (*JsonRpcServer, error) { + sport := fmt.Sprintf(":%d", port) + l, err := net.Listen("tcp", sport) if err != nil { return nil, err } |