Skip to content

Commit fea6688

Browse files
committed
feat: default port
1 parent f598ae0 commit fea6688

6 files changed

Lines changed: 23 additions & 27 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ target/release/ckb run
114114

115115
### Send Transaction via RPC
116116

117-
Find RPC port in the log output, the following command assumes 3030 is used:
117+
Find RPC port in the log output, the following command assumes 8114 is used:
118118

119119
```shell
120120
curl -d '{"id": 2, "jsonrpc": "2.0", "method":"send_transaction","params": [{"version":2, "inputs":[], "outputs":[], "deps":[]}]}' \
121-
-H 'content-type:application/json' 'http://localhost:3030'
121+
-H 'content-type:application/json' 'http://localhost:8114'
122122
```
123123

124124
### Advanced

devtools/playground/random_transaction.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'net/http'
44
require 'uri'
55

6-
URL = ARGV[0] || "http://localhost:3030"
6+
URL = ARGV[0] || "http://localhost:8114"
77
CKB_BIN = ARGV[1] || "./target/debug/ckb"
88
ACCOUNTS = [
99
{

explorer/src/components/app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import JsonRPC from "simple-jsonrpc-js"
3333
export default {
3434
data: function() {
3535
return {
36-
addr: 'http://localhost:3030/',
36+
addr: 'http://localhost:8114/',
3737
blocks: [],
3838
transactions: [],
3939
block: {},

rpc/src/integration_test.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,35 @@ use std::sync::Arc;
2222
//TODO: build_rpc_trait! do not surppot trait bounds
2323
build_rpc_trait! {
2424
pub trait IntegrationTestRpc {
25-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"submit_solution","params": [1]}' -H 'content-type:application/json' 'http://localhost:3030'
25+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"submit_solution","params": [1]}' -H 'content-type:application/json' 'http://localhost:8114'
2626
#[rpc(name = "submit_pow_solution")]
2727
fn submit_pow_solution(&self, u64) -> Result<()>;
2828

29-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"send_transaction","params": [{"version":2, "deps":[], "inputs":[], "outputs":[]}]}' -H 'content-type:application/json' 'http://localhost:3030'
29+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"send_transaction","params": [{"version":2, "deps":[], "inputs":[], "outputs":[]}]}' -H 'content-type:application/json' 'http://localhost:8114'
3030
#[rpc(name = "send_transaction")]
3131
fn send_transaction(&self, Transaction) -> Result<H256>;
3232

33-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:3030'
33+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:8114'
3434
#[rpc(name = "get_block")]
3535
fn get_block(&self, H256) -> Result<Option<BlockWithHash>>;
3636

37-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_transaction","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:3030'
37+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_transaction","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:8114'
3838
#[rpc(name = "get_transaction")]
3939
fn get_transaction(&self, H256) -> Result<Option<TransactionWithHash>>;
4040

41-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_hash","params": [1]}' -H 'content-type:application/json' 'http://localhost:3030'
41+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_hash","params": [1]}' -H 'content-type:application/json' 'http://localhost:8114'
4242
#[rpc(name = "get_block_hash")]
4343
fn get_block_hash(&self, u64) -> Result<Option<H256>>;
4444

45-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_tip_header","params": []}' -H 'content-type:application/json' 'http://localhost:3030'
45+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_tip_header","params": []}' -H 'content-type:application/json' 'http://localhost:8114'
4646
#[rpc(name = "get_tip_header")]
4747
fn get_tip_header(&self) -> Result<Header>;
4848

49-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_template","params": []}' -H 'content-type:application/json' 'http://localhost:3030'
49+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_template","params": []}' -H 'content-type:application/json' 'http://localhost:8114'
5050
#[rpc(name = "get_block_template")]
5151
fn get_block_template(&self) -> Result<BlockTemplate>;
5252

53-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_cells_by_type_hash","params": ["0x1b1c832d02fdb4339f9868c8a8636c3d9dd10bd53ac7ce99595825bd6beeffb3", 1, 10]}' -H 'content-type:application/json' 'http://localhost:3030'
53+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_cells_by_type_hash","params": ["0x1b1c832d02fdb4339f9868c8a8636c3d9dd10bd53ac7ce99595825bd6beeffb3", 1, 10]}' -H 'content-type:application/json' 'http://localhost:8114'
5454
#[rpc(name = "get_cells_by_type_hash")]
5555
fn get_cells_by_type_hash(&self, H256, u64, u64) -> Result<Vec<CellOutputWithOutPoint>>;
5656

rpc/src/server.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,31 @@ use std::sync::Arc;
1818

1919
build_rpc_trait! {
2020
pub trait Rpc {
21-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"send_transaction","params": [{"version":2, "deps":[], "inputs":[], "outputs":[]}]}' -H 'content-type:application/json' 'http://localhost:3030'
21+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"send_transaction","params": [{"version":2, "deps":[], "inputs":[], "outputs":[]}]}' -H 'content-type:application/json' 'http://localhost:8114'
2222
#[rpc(name = "send_transaction")]
2323
fn send_transaction(&self, Transaction) -> Result<H256>;
2424

25-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:3030'
25+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:8114'
2626
#[rpc(name = "get_block")]
2727
fn get_block(&self, H256) -> Result<Option<BlockWithHash>>;
2828

29-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_transaction","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:3030'
29+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_transaction","params": ["0x0f9da6db98d0acd1ae0cf7ae3ee0b2b5ad2855d93c18d27c0961f985a62a93c3"]}' -H 'content-type:application/json' 'http://localhost:8114'
3030
#[rpc(name = "get_transaction")]
3131
fn get_transaction(&self, H256) -> Result<Option<TransactionWithHash>>;
3232

33-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_hash","params": [1]}' -H 'content-type:application/json' 'http://localhost:3030'
33+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_hash","params": [1]}' -H 'content-type:application/json' 'http://localhost:8114'
3434
#[rpc(name = "get_block_hash")]
3535
fn get_block_hash(&self, u64) -> Result<Option<H256>>;
3636

37-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_tip_header","params": []}' -H 'content-type:application/json' 'http://localhost:3030'
37+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_tip_header","params": []}' -H 'content-type:application/json' 'http://localhost:8114'
3838
#[rpc(name = "get_tip_header")]
3939
fn get_tip_header(&self) -> Result<Header>;
4040

41-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_template","params": []}' -H 'content-type:application/json' 'http://localhost:3030'
41+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_block_template","params": []}' -H 'content-type:application/json' 'http://localhost:8114'
4242
#[rpc(name = "get_block_template")]
4343
fn get_block_template(&self) -> Result<BlockTemplate>;
4444

45-
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_cells_by_type_hash","params": ["0x1b1c832d02fdb4339f9868c8a8636c3d9dd10bd53ac7ce99595825bd6beeffb3", 1, 10]}' -H 'content-type:application/json' 'http://localhost:3030'
45+
// curl -d '{"id": 2, "jsonrpc": "2.0", "method":"get_cells_by_type_hash","params": ["0x1b1c832d02fdb4339f9868c8a8636c3d9dd10bd53ac7ce99595825bd6beeffb3", 1, 10]}' -H 'content-type:application/json' 'http://localhost:8114'
4646
#[rpc(name = "get_cells_by_type_hash")]
4747
fn get_cells_by_type_hash(&self, H256, u64, u64) -> Result<Vec<CellOutputWithOutPoint>>;
4848
}

src/config/default.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,18 @@
99
},
1010
"network": {
1111
"listen_addresses": [
12-
"/ip4/0.0.0.0/tcp/0"
13-
],
14-
"boot_nodes": [
15-
"/ip4/127.0.0.1/tcp/12345/p2p/QmVMJYDCL2vDnk4PmRGNdDRTWRnfeboUsriYA9CixJsBRf"
16-
],
17-
"reserved_nodes": [
18-
"/ip4/127.0.0.1/tcp/12345/p2p/QmVMJYDCL2vDnk4PmRGNdDRTWRnfeboUsriYA9CixJsBRf"
12+
"/ip4/0.0.0.0/tcp/8115"
1913
],
14+
"boot_nodes": [],
15+
"reserved_nodes": [],
2016
"only_reserved_peers": false,
2117
"min_peers": 4,
2218
"max_peers": 8,
2319
"secret_file": "secret",
2420
"nodes_file": "nodes.json"
2521
},
2622
"rpc": {
27-
"listen_addr": "0.0.0.0:0"
23+
"listen_addr": "0.0.0.0:8114"
2824
},
2925
"sync": {
3026
"verification_level": "Full",

0 commit comments

Comments
 (0)