forked from DNAProject/DNA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. provide a command 'nodectl' 2. provide a local RPC server Signed-off-by: Ziyan Zhou <[email protected]>
- Loading branch information
1 parent
a4f6aa0
commit 1f4e0b7
Showing
21 changed files
with
838 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package httpjsonrpc | ||
|
||
import ( | ||
. "GoOnchain/common" | ||
. "GoOnchain/config" | ||
"log" | ||
"net/http" | ||
"strconv" | ||
) | ||
|
||
func StartRPCServer() { | ||
Trace() | ||
http.HandleFunc("/", Handle) | ||
|
||
HandleFunc("getbestblockhash", getBestBlockHash) | ||
HandleFunc("getblock", getBlock) | ||
HandleFunc("getblockcount", getBlockCount) | ||
HandleFunc("getblockhash", getBlockHash) | ||
HandleFunc("getconnectioncount", getConnectionCount) | ||
HandleFunc("getrawmempool", getRawMemPool) | ||
HandleFunc("getrawtransaction", getRawTransaction) | ||
HandleFunc("submitblock", submitBlock) | ||
|
||
err := http.ListenAndServe(":"+strconv.Itoa(Parameters.HttpJsonPort), nil) | ||
if err != nil { | ||
log.Fatal("ListenAndServe: ", err.Error()) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.