mirror of
https://github.com/aljazceru/ark.git
synced 2026-01-09 14:54:19 +01:00
New boarding protocol (#279)
* [domain] add reverse boarding inputs in Payment struct * [tx-builder] support reverse boarding script * [wallet] add GetTransaction * [api-spec][application] add reverse boarding support in covenantless * [config] add reverse boarding config * [api-spec] add ReverseBoardingAddress RPC * [domain][application] support empty forfeits txs in EndFinalization events * [tx-builder] optional connector output in round tx * [btc-embedded] fix getTx and taproot finalizer * whitelist ReverseBoardingAddress RPC * [test] add reverse boarding integration test * [client] support reverse boarding * [sdk] support reverse boarding * [e2e] add sleep time after faucet * [test] run using bitcoin-core RPC * [tx-builder] fix GetSweepInput * [application][tx-builder] support reverse onboarding in covenant * [cli] support reverse onboarding in covenant CLI * [test] rework integration tests * [sdk] remove onchain wallet, replace by onboarding address * remove old onboarding protocols * [sdk] Fix RegisterPayment * [e2e] add more funds to covenant ASP * [e2e] add sleeping time * several fixes * descriptor boarding * remove boarding delay from info * [sdk] implement descriptor boarding * go mod tidy * fixes and revert error msgs * move descriptor pkg to common * add replace in go.mod * [sdk] fix unit tests * rename DescriptorInput --> BoardingInput * genrest in SDK * remove boarding input from domain * remove all "reverse boarding" * rename "onboarding" ==> "boarding" * remove outdate payment unit test * use tmpfs docker volument for compose testing files * several fixes
This commit is contained in:
@@ -38,31 +38,19 @@ func main() {
|
||||
defer aliceArkClient.Lock(ctx, password)
|
||||
|
||||
log.Info("alice is acquiring onchain funds...")
|
||||
_, aliceOnchainAddr, err := aliceArkClient.Receive(ctx)
|
||||
_, boardingAddress, err := aliceArkClient.Receive(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if _, err := runCommand("nigiri", "faucet", aliceOnchainAddr); err != nil {
|
||||
if _, err := runCommand("nigiri", "faucet", boardingAddress); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
time.Sleep(5 * time.Second)
|
||||
|
||||
onboardAmount := uint64(20000)
|
||||
onboardAmount := uint64(1_0000_0000) // 1 BTC
|
||||
log.Infof("alice is onboarding with %d sats offchain...", onboardAmount)
|
||||
txid, err := aliceArkClient.Onboard(ctx, onboardAmount)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if err := generateBlock(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
time.Sleep(5 * time.Second)
|
||||
|
||||
log.Infof("alice onboarded with tx: %s", txid)
|
||||
|
||||
aliceBalance, err := aliceArkClient.Balance(ctx, false)
|
||||
if err != nil {
|
||||
@@ -72,6 +60,14 @@ func main() {
|
||||
log.Infof("alice onchain balance: %d", aliceBalance.OnchainBalance.SpendableAmount)
|
||||
log.Infof("alice offchain balance: %d", aliceBalance.OffchainBalance.Total)
|
||||
|
||||
log.Infof("alice claiming onboarding funds...")
|
||||
txid, err := aliceArkClient.Claim(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Infof("alice claimed onboarding funds in round %s", txid)
|
||||
|
||||
fmt.Println("")
|
||||
log.Info("bob is setting up his ark wallet...")
|
||||
bobArkClient, err := setupArkClient()
|
||||
@@ -137,7 +133,7 @@ func main() {
|
||||
|
||||
fmt.Println("")
|
||||
log.Info("bob is claiming the incoming payment...")
|
||||
roundTxid, err := bobArkClient.ClaimAsync(ctx)
|
||||
roundTxid, err := bobArkClient.Claim(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user