-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
2,038 additions
and
394 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v0.2.2 |
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 |
---|---|---|
|
@@ -344,6 +344,7 @@ | |
}, | ||
"mainnet": "主网", | ||
"testnet": "测试网", | ||
"lightTestnet": "轻节点测试网", | ||
"devnet": "开发网" | ||
}, | ||
"locale": { | ||
|
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,55 @@ | ||
# chain = "mainnet" | ||
# chain = "testnet" | ||
# chain = "your_path_to/dev.toml" | ||
chain = "testnet" | ||
|
||
[store] | ||
path = "data/store" | ||
|
||
[network] | ||
path = "data/network" | ||
|
||
listen_addresses = ["/ip4/0.0.0.0/tcp/8118"] | ||
### Specify the public and routable network addresses | ||
# public_addresses = [] | ||
|
||
# Node connects to nodes listed here to discovery other peers when there's no local stored peers. | ||
# When chain.spec is changed, this usually should also be changed to the bootnodes in the new chain. | ||
bootnodes = [ | ||
# Hangzhou, Asia | ||
"/ip4/47.111.169.36/tcp/8111/p2p/QmNQ4jky6uVqLDrPU7snqxARuNGWNLgSrTnssbRuy3ij2W", | ||
# Ohio, North America | ||
"/ip4/18.217.146.65/tcp/8111/p2p/QmT6DFfm18wtbJz3y4aPNn3ac86N4d4p4xtfQRRPf73frC", | ||
# Singapore, Asia | ||
"/ip4/18.136.60.221/tcp/8111/p2p/QmTt6HeNakL8Fpmevrhdna7J4NzEMf9pLchf1CXtmtSrwb", | ||
# London, Europe | ||
"/ip4/35.176.207.239/tcp/8111/p2p/QmSJTsMsMGBjzv1oBNwQU36VhQRxc2WQpFoRu1ZifYKrjZ" | ||
] | ||
|
||
### Whitelist-only mode | ||
# whitelist_only = false | ||
### Whitelist peers connecting from the given IP addresses | ||
# whitelist_peers = [] | ||
|
||
### Enable `SO_REUSEPORT` feature to reuse port on Linux, not supported on other OS yet | ||
# reuse_port_on_linux = true | ||
|
||
max_peers = 125 | ||
max_outbound_peers = 8 | ||
# 2 minutes | ||
ping_interval_secs = 120 | ||
# 20 minutes | ||
ping_timeout_secs = 1200 | ||
connect_outbound_interval_secs = 15 | ||
# If set to true, try to register upnp | ||
upnp = false | ||
# If set to true, network service will add discovered local address to peer store, it's helpful for private net development | ||
discovery_local_address = false | ||
# If set to true, random cleanup when there are too many inbound nodes | ||
# Ensure that itself can continue to serve as a bootnode node | ||
bootnode_mode = false | ||
|
||
[rpc] | ||
# Light client rpc is designed for self hosting, exposing to public network is not recommended and may cause security issues. | ||
# By default RPC only binds to localhost, thus it only allows accessing from the same machine. | ||
listen_address = "127.0.0.1:9000" |
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
44 changes: 44 additions & 0 deletions
44
packages/neuron-wallet/src/block-sync-renderer/sync/connector.ts
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,44 @@ | ||
import { Subject } from 'rxjs' | ||
|
||
export interface BlockTips { | ||
cacheTipNumber: number | ||
indexerTipNumber: number | undefined | ||
} | ||
|
||
export interface LumosCellQuery { | ||
lock: CKBComponents.Script | null | ||
type: CKBComponents.Script | null | ||
data: string | null | ||
} | ||
|
||
export interface LumosCell { | ||
block_hash: string | ||
out_point: { | ||
tx_hash: string | ||
index: string | ||
} | ||
cell_output: { | ||
capacity: string | ||
lock: { | ||
code_hash: string | ||
args: string | ||
hash_type: string | ||
} | ||
type?: { | ||
code_hash: string | ||
args: string | ||
hash_type: string | ||
} | ||
} | ||
data?: string | ||
} | ||
|
||
export abstract class Connector<TransactionsSubjectParam = unknown> { | ||
abstract blockTipsSubject: Subject<BlockTips> | ||
abstract transactionsSubject: Subject<{ txHashes: CKBComponents.Hash[]; params: TransactionsSubjectParam }> | ||
|
||
abstract connect(): Promise<void> | ||
abstract notifyCurrentBlockNumberProcessed(param: TransactionsSubjectParam): void | ||
abstract stop(): void | ||
abstract getLiveCellsByScript(query: LumosCellQuery): Promise<unknown> | ||
} |
Oops, something went wrong.
2dca3fc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Packaging for test is done in 4507571326