-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into stan/31-ika-signature-logic
- Loading branch information
Showing
2 changed files
with
99 additions
and
0 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,67 @@ | ||
# Run btcd simnet mode | ||
|
||
## Install btcd and btcwallet | ||
|
||
Follow the instruction in [btcd README.md](https://github.com/btcsuite/btcd?tab=readme-ov-file#installation) | ||
and [btcwallet README](https://github.com/btcsuite/btcwallet?tab=readme-ov-file#installation-and-updating) to install btcd and btcwallet | ||
|
||
## Run btcd with simnet mode | ||
|
||
### Bootstrap the wallet and btc node | ||
|
||
First you need to start the btcd in simnet mode | ||
|
||
```bash | ||
btcd --simnet --rpcuser=user --rpcpass=password | ||
``` | ||
|
||
Create btc wallet. Please remember the password. | ||
|
||
```bash | ||
btcwallet --simnet --create | ||
``` | ||
|
||
Connect you wallet to btcd simmode. The password and user here must be the btcd password/user pair. | ||
Open a new terminal and run: | ||
|
||
```bash | ||
btcwallet --simnet -u=user -P=password | ||
``` | ||
|
||
Create a new address. We will use it as the `--miningaddr` parameter - an address that receives btc when mining a new block. | ||
Open a new terminal and run: | ||
|
||
```bash | ||
btcctl --simnet --wallet --rpcuser=user --rpcpass=password getnewaddress | ||
``` | ||
|
||
Copy the address created by the command above. Shutdown the btcd service and run: | ||
|
||
```bash | ||
btcd --simnet --rpcuser=user --rpcpass=password --miningaddr=<address> | ||
``` | ||
|
||
Right now, everytime we mine a new block, the minner address should receive some bitcoin. | ||
We can use this for testing and development. | ||
|
||
## Generate a new block | ||
|
||
Generate 100 blocks | ||
|
||
```bash | ||
btcctl --simnet --wallet --rpcuser=user --rpcpass=password generate 100 | ||
``` | ||
|
||
## Check information | ||
|
||
Blockchain information | ||
|
||
```bash | ||
btcctl --simnet --wallet --rpcuser=user --rpcpass=password getblockchaininfo | ||
``` | ||
|
||
Miner balance | ||
|
||
```bash | ||
btcctl --simnet --wallet --rpcuser=user --rpcpass=password getbalance | ||
``` |
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,32 @@ | ||
# Flow | ||
|
||
The following diagram illustrates the flow of a transaction through the relayer and the database. This is one `Relayer`, but it interacts with three different networks (`Native`, `Ika` and `Bitcoin`) | ||
|
||
```mermaid | ||
flowchart TB | ||
subgraph subGraph0["Relayer (Native network)"] | ||
direction TB | ||
B["Indexes transaction"] | ||
A["User submits transaction"] | ||
end | ||
subgraph subGraph1["Relayer (Ika network)"] | ||
E["Ika signs transaction"] | ||
D["Sends to Ika for signing"] | ||
end | ||
subgraph subGraph2["Relayer (Bitcoin network)"] | ||
H["Broadcasts Bitcoin transaction"] | ||
G["Constructs Bitcoin transaction"] | ||
I["Checks for confirmations"] | ||
end | ||
A --> B | ||
B -- Stores transaction (Pending) --> Database["Database"] | ||
Database -- Reads pending transaction --> D | ||
D --> E | ||
E -- Stores signed transaction --> Database | ||
Database -- Reads signed transaction --> G | ||
G --> H | ||
H --> I | ||
I -- Updates status to Confirmed --> Database | ||
Database@{ shape: db} | ||
``` |