Skip to content

Commit 14828da

Browse files
authored
fiber update to 0.6.1 (#31)
* Update version number, from 0.5.1 to 0.6.0 * Addressing some upgraded details * Remove invalid parameters: final_cltv * each cell requires a minimum of 62 ckb to 98 * Update simple game to 0.6.0 * SimpleGame: Add some tips * Update fiber to 0.6.1
1 parent ae34f1d commit 14828da

File tree

11 files changed

+136
-577
lines changed

11 files changed

+136
-577
lines changed

content/docs/guide/backup.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ author: "gpBlockchain"
66
authorUrl: "https://github.com/gpBlockchain"
77
dependencies:
88
- name: Fiber Node
9-
minVersion: "0.5.1"
10-
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.5.1"
9+
minVersion: "0.6.1"
10+
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.6.1"
1111
---
1212

1313
This guide explains how to securely back up Fiber node data to safeguard funds, maintain node identity, and ensure smooth migration or upgrades. **Never store plaintext private keys**, as they risk theft if exposed.

content/docs/quick-start/basic-transfer.mdx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: Learn how to set up and execute transfers between two nodes
44
date: 2025-06-25
55
dependencies:
66
- name: Fiber Node
7-
minVersion: "0.5.1"
8-
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.5.1"
7+
minVersion: "0.6.1"
8+
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.6.1"
99
---
1010

1111
## Overview
@@ -34,7 +34,7 @@ cd fiber
3434
cargo build --release
3535
```
3636

37-
This document used the [v0.5.1 binary](https://github.com/nervosnetwork/fiber/releases/tag/v0.5.1) throughout the guide.
37+
This document used the [v0.6.1 binary](https://github.com/nervosnetwork/fiber/releases/tag/v0.6.1) throughout the guide.
3838

3939
### 2. Create Data Directories
4040

@@ -106,7 +106,7 @@ fiber:
106106
args: 0x3cb7c0304fe53f75bb5727e2484d0beae4bd99d979813c6fc97c3cca569f10f6
107107
- cell_dep:
108108
out_point:
109-
tx_hash: 0x5a5288769cecde6451cb5d301416c297a6da43dc3ac2f3253542b4082478b19b # ckb_auth
109+
tx_hash: 0x12c569a258dd9c5bd99f632bb8314b1263b90921ba31496467580d6b79dd14a7 # ckb_auth
110110
index: 0x0
111111
dep_type: code
112112
- name: CommitmentLock
@@ -121,7 +121,7 @@ fiber:
121121
args: 0xf7e458887495cf70dd30d1543cad47dc1dfe9d874177bf19291e4db478d5751b
122122
- cell_dep:
123123
out_point:
124-
tx_hash: 0x5a5288769cecde6451cb5d301416c297a6da43dc3ac2f3253542b4082478b19b #ckb_auth
124+
tx_hash: 0x12c569a258dd9c5bd99f632bb8314b1263b90921ba31496467580d6b79dd14a7 #ckb_auth
125125
index: 0x0
126126
dep_type: code
127127

@@ -201,7 +201,7 @@ curl -s -X POST \
201201
"params": [{
202202
"peer_id": "QmcFpUnjRvMyqbFBTn94wwF8LZodvPWpK39Wg9pYr2i4TQ",
203203
"funding_amount": "0xba43b7400",
204-
"commitment_delay_epoch": "0x20001000003"
204+
"public": true
205205
}]
206206
}' http://localhost:8227
207207
```
@@ -259,11 +259,14 @@ payment_preimage="0x$(openssl rand -hex 32)"
259259

260260
Once the request is sent, you can get the invoice ID from the response:
261261

262-
```sh
262+
```json
263263
{
264264
"id": "42",
265265
"jsonrpc": "2.0",
266-
"result": "fibt100000000001p..."
266+
"result": {
267+
"invoice_address": "fibt100000000001p...",
268+
"invoice": { ... }
269+
}
267270
}
268271
```
269272

content/docs/quick-start/connect-nodes.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ author: "sunchengzhu"
66
authorUrl: "https://github.com/sunchengzhu"
77
dependencies:
88
- name: Fiber Node
9-
minVersion: "0.5.1"
10-
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.5.1"
9+
minVersion: "0.6.1"
10+
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.6.1"
1111
---
1212

1313
## Overview
@@ -166,13 +166,13 @@ This document provides a user manual for connecting to the public Testnet nodes
166166

167167
This channel was established with nodeA contributing 500 ckb and node1 contributing 250 ckb.
168168

169-
Since each cell requires a minimum of 62 ckb, this amount is reserved to ensure that there are sufficient funds to cover cell occupancy costs during on-chain settlement (when the channel closes). These 62 ckb will be returned to their respective nodes at the time of on-chain settlement.
169+
Since each cell requires a minimum of 98 ckb, this amount is reserved to ensure that there are sufficient funds to cover cell occupancy costs during on-chain settlement (when the channel closes). These 98 ckb will be returned to their respective nodes at the time of on-chain settlement.
170170

171171
Actual available funds in the channel:
172172

173-
nodeA: 500 ckb - 62 ckb = 438 ckb (local_balance is 0xa32aef600)
173+
nodeA: 500 ckb - 98 ckb = 402 ckb (local_balance is 0xa32aef600)
174174

175-
node1: 250 ckb - 62 ckb = 188 ckb (remote_balance is 0x460913c00)
175+
node1: 250 ckb - 98 ckb = 152 ckb (remote_balance is 0x460913c00)
176176

177177

178178

@@ -201,7 +201,6 @@ This document provides a user manual for connecting to the public Testnet nodes
201201
"currency": "Fibt",
202202
"description": "test invoice generated by node2",
203203
"expiry": "0xe10",
204-
"final_cltv": "0x28",
205204
"payment_preimage": "0xbc03e507befb33cfd5953a2e7046428e69cb8f0ade65c05d3661128aa4b4fff9",
206205
"hash_algorithm": "sha256"
207206
}
@@ -428,7 +427,6 @@ This document provides a user manual for connecting to the public Testnet nodes
428427
"currency": "Fibt",
429428
"description": "test invoice generated by node2",
430429
"expiry": "0xe10",
431-
"final_cltv": "0x28",
432430
"payment_preimage": "0xf7d121b132b4f53bb8301591028b34fccc065f92161bb6e7d41cf6d32ad32a22",
433431
"hash_algorithm": "sha256",
434432
"udt_type_script": {

content/docs/quick-start/run-a-node.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: "Learn how to run a Testnet node on your local machine"
44
date: 2025-06-25
55
dependencies:
66
- name: Fiber Node
7-
minVersion: "0.5.1"
8-
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.5.1"
7+
minVersion: "0.6.1"
8+
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.6.1"
99
---
1010

1111
## Overview
@@ -31,7 +31,7 @@ cd fiber
3131
cargo build --release
3232
```
3333

34-
This document used the [v0.5.1 binary](https://github.com/nervosnetwork/fiber/releases/tag/v0.5.1) throughout the guide.
34+
This document used the [v0.6.1 binary](https://github.com/nervosnetwork/fiber/releases/tag/v0.6.1) throughout the guide.
3535

3636
### 2. Create Node Directory
3737

@@ -123,6 +123,7 @@ cp -r /folder-to/my-fnn/fiber/store /folder-to/my-fnn/fiber/store.backup
123123
```sh
124124
fnn-migrate -p /folder-to/my-fnn/fiber/store
125125
```
126+
( If compiling from source code locally, need `cd` to the [`./migrate`](https://github.com/nervosnetwork/fiber/tree/v0.6.1/migrate). )
126127

127128
4. Update and restart:
128129
- Replace the FNN binary

content/docs/quick-start/transfer-stablecoin.mdx

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: Learn how to transfer stablecoins between nodes
44
date: 2025-06-25
55
dependencies:
66
- name: Fiber Node
7-
minVersion: "0.5.1"
8-
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.5.1"
7+
minVersion: "0.6.1"
8+
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.6.1"
99
---
1010

1111
## Overview
@@ -35,7 +35,7 @@ cargo build --release
3535
cp target/release/fnn ./
3636
```
3737

38-
This document used the [v0.5.1 binary](https://github.com/nervosnetwork/fiber/releases/tag/v0.5.1) throughout the guide.
38+
This document used the [v0.6.1 binary](https://github.com/nervosnetwork/fiber/releases/tag/v0.6.1) throughout the guide.
3939

4040
### 2. Configure Fiber Nodes
4141

@@ -66,8 +66,6 @@ mkdir ckb
6666
# Use ckb-cli to export or generate keys
6767
ckb-cli account export --lock-arg <lock_arg> --extended-privkey-path ./ckb/exported-key
6868
head -n 1 ./ckb/exported-key > ./ckb/key
69-
# Modify key permissions
70-
chmod 600 ./ckb/key
7169
```
7270

7371
Each node requires a different key. You can get Testnet funds from Faucets.
@@ -117,7 +115,7 @@ fiber:
117115
args: 0x3cb7c0304fe53f75bb5727e2484d0beae4bd99d979813c6fc97c3cca569f10f6
118116
- cell_dep:
119117
out_point:
120-
tx_hash: 0x5a5288769cecde6451cb5d301416c297a6da43dc3ac2f3253542b4082478b19b # ckb_auth
118+
tx_hash: 0x12c569a258dd9c5bd99f632bb8314b1263b90921ba31496467580d6b79dd14a7 # ckb_auth
121119
index: 0x0
122120
dep_type: code
123121
- name: CommitmentLock
@@ -132,7 +130,7 @@ fiber:
132130
args: 0xf7e458887495cf70dd30d1543cad47dc1dfe9d874177bf19291e4db478d5751b
133131
- cell_dep:
134132
out_point:
135-
tx_hash: 0x5a5288769cecde6451cb5d301416c297a6da43dc3ac2f3253542b4082478b19b #ckb_auth
133+
tx_hash: 0x12c569a258dd9c5bd99f632bb8314b1263b90921ba31496467580d6b79dd14a7 #ckb_auth
136134
index: 0x0
137135
dep_type: code
138136

@@ -276,7 +274,6 @@ curl --location 'http://127.0.0.1:8237' \
276274
"amount": "0x3b9aca00",
277275
"currency": "Fibt",
278276
"description": "test invoice generated by node2",
279-
"final_cltv": "0x28",
280277
"payment_preimage": "0x5d3baba4cc5355dbecd27d558a2849604df15d7474144a5dfedb669cb8039cbd",
281278
"expiry": "0xe10",
282279
"hash_algorithm": "sha256",
@@ -296,28 +293,29 @@ The response will include an invoice address that can be used for payment:
296293

297294
```json
298295
{
299-
"jsonrpc": "2.0",
300-
"result": {
301-
"invoice_address": "fibt10000000001p98tjdhf7emczxzat8lhtag2ulnd9vthgash247nujysgazu2zqd7ava6w7t7e5fj0l3rl34zuhjfjsqp7tcemg83rkpxztpv0qrtmxtjua5uxsqp34tnjq4uvyh0zc9s9pp4hyxuauelxfgwh8sfwhs7q5aan9kk9ujy0s08j22eu3gzya3dusksyqfs64kswc7v77wcfp2wuql0f2z754ecxsglw2fnsdc2cs38p7p9q7r7grm5389sdnw25c9v04ks3t34f04j6t7tgps7nnm9vr3tf5x5mk73lsx3zgaz3jl7a2h25gerjhht99ucc9a9tw6dmlyzy2uqjuhh5kehzsevjp8qym5vxuzamd9vm9jpvlhacjep4pawls5czkuq39xfgqqz8f99e0xlhf9kdauvhqcpxep0f3lv8vmqkrc0uu955l2jy5907cxlxrqncg7cz9ekryflhwqxlzj5h7fmf4s5vlyy8rhk5vgptqsw67",
302-
"invoice": {
303-
"currency": "Fibt",
304-
"amount": "0x3b9aca00",
305-
"signature": "110506090800000207090505190f061f170905160d1d1c0c170018010619010f09111f0c070c1b001603180f1c1c0514141f0a120414050f1e18061f0603001318081e18020519160304091f170e00061f021214171e091b091510140c1f040407031716140c0801",
306-
"data": {
307-
"timestamp": "0x19662411ac8",
308-
"payment_hash": "0x98eed206ca5637624796212d29017aaec97700708d5b08f031ab21b3708a1d1f",
309-
"attrs": [
310-
{"description": "test invoice generated by node2"},
311-
{"expiry_time": "0xe10"},
312-
{"udt_script": "0x550000001000000030000000310000001142755a044bf2ee358cba9f2da187ce928c91cd4dc8692ded0337efa677d21a0120000000878fcc6f1f08d48e87bb1c3b3d5083f23f8a39c5d5c764f253b55b998526439b"},
313-
{"hash_algorithm": "sha256"},
314-
{"payee_public_key": "028b461870f297399c0a24d78abc169669e81db958008748ae879efbbe1f2b2d85"}
315-
]
316-
}
296+
"jsonrpc": "2.0",
297+
"id": 42,
298+
"result": {
299+
"invoice_address": "fibt10000000001p98tjdhf7emczxzat8lhtacrwqgzl9yjnq9ym97kp9kzetyuelpz0ttu98cusyr4z66wf3xxwxwa4ue5h9h63xgeg2j524c8vrct09wu9pqr9uk3hypg5388kw3tpdanz0k4muask0yaaczeunm7cdqvw5ek460v88phxw2nrx46p885l6xvcz3cge6ucnqn28e4zg4r2tqygdzh3v3rg3aqtzwrcjg33gz6v63gjgqn3vrhhftm5mcmme5vfzfxzzdn99500hnetluexzj05nzu3ehye005aed5qdkkmkwamny4c0675zuaq07fqxyakjhxve8g0xdhau67j7ejpp6pm8j7rc98qqg4k5nu9t4fnfl3xyyncrsqxlq85q7h8w0t37qhqx8nxvdxq4pm7aka7kdn0vsdtrf38m8g2dcakz9s3wrexute2uw9z9a4z249x220xnqaeyd3urwgurlugqhckzg7quxzn30he20q4d3cp8fa4vy",
300+
"invoice": {
301+
"currency": "Fibt",
302+
"amount": "0x3b9aca00",
303+
"signature": "060713060c0d060015011b1e1d161d1e160d130f0c100d0b030911071b07080a0d181d16020510110e0319061c0b190a1c0e0502051d15020a1505060a0a0f0613001d19040d111c030e081c031f1c080017181602081e001c060213110f17190a0f00150d111801",
304+
"data": {
305+
"timestamp": "0x19b887faff7",
306+
"payment_hash": "0xfd2e39468311062410470be7af3e973b42e4e027ed5c9a41039125a2e4a8c113",
307+
"attrs": [
308+
{"description": "test invoice generated by node2"},
309+
{"expiry_time": "0xe10"},
310+
{"udt_script": "0x550000001000000030000000310000001142755a044bf2ee358cba9f2da187ce928c91cd4dc8692ded0337efa677d21a0120000000878fcc6f1f08d48e87bb1c3b3d5083f23f8a39c5d5c764f253b55b998526439b"},
311+
{"hash_algorithm": "sha256"},
312+
{"payee_public_key": "026015474b61e66a7ec4a1004d00b175ca687f31e01e3d1d2f11d3a7ae47cf2794"}
313+
]
314+
}
315+
}
317316
}
318-
},
319-
"id": 42
320317
}
318+
321319
```
322320

323321
### 2. Send a Stablecoin Payment
@@ -333,7 +331,7 @@ curl --location 'http://127.0.0.1:8227' \
333331
"method": "send_payment",
334332
"params": [
335333
{
336-
"invoice": "fibt10000000001p98tjdhf7emczxzat8lhtag2ulnd9vthgash247nujysgazu2zqd7ava6w7t7e5fj0l3rl34zuhjfjsqp7tcemg83rkpxztpv0qrtmxtjua5uxsqp34tnjq4uvyh0zc9s9pp4hyxuauelxfgwh8sfwhs7q5aan9kk9ujy0s08j22eu3gzya3dusksyqfs64kswc7v77wcfp2wuql0f2z754ecxsglw2fnsdc2cs38p7p9q7r7grm5389sdnw25c9v04ks3t34f04j6t7tgps7nnm9vr3tf5x5mk73lsx3zgaz3jl7a2h25gerjhht99ucc9a9tw6dmlyzy2uqjuhh5kehzsevjp8qym5vxuzamd9vm9jpvlhacjep4pawls5czkuq39xfgqqz8f99e0xlhf9kdauvhqcpxep0f3lv8vmqkrc0uu955l2jy5907cxlxrqncg7cz9ekryflhwqxlzj5h7fmf4s5vlyy8rhk5vgptqsw67"
334+
"invoice": "fibt10000000001p98tjdhf7emczxzat8lhtacrwqgzl9yjnq9ym97kp9kzetyuelpz0ttu98cusyr4z66wf3xxwxwa4ue5h9h63xgeg2j524c8vrct09wu9pqr9uk3hypg5388kw3tpdanz0k4muask0yaaczeunm7cdqvw5ek460v88phxw2nrx46p885l6xvcz3cge6ucnqn28e4zg4r2tqygdzh3v3rg3aqtzwrcjg33gz6v63gjgqn3vrhhftm5mcmme5vfzfxzzdn99500hnetluexzj05nzu3ehye005aed5qdkkmkwamny4c0675zuaq07fqxyakjhxve8g0xdhau67j7ejpp6pm8j7rc98qqg4k5nu9t4fnfl3xyyncrsqxlq85q7h8w0t37qhqx8nxvdxq4pm7aka7kdn0vsdtrf38m8g2dcakz9s3wrexute2uw9z9a4z249x220xnqaeyd3urwgurlugqhckzg7quxzn30he20q4d3cp8fa4vy"
337335
}
338336
]
339337
}'
@@ -415,3 +413,4 @@ curl --location 'http://127.0.0.1:8227' \
415413
- Keep track of your channel IDs and peer IDs
416414
- Monitor your node logs for any errors or important messages
417415
- Make sure to properly close channels when they're no longer needed
416+
- When connecting Node 2 and Node 3, the `address` needs to use the address of Node 3.

content/docs/tutorial/simple-game.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ authorUrl: https://www.pingkey.xyz/p/ce6232feaec4e6d01a4e00daa3648030c42017bdf58
66
date: 2025-03-13
77
dependencies:
88
- name: Fiber Node
9-
minVersion: "0.4.0"
10-
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.4.0"
9+
minVersion: "0.6.1"
10+
link: "https://github.com/nervosnetwork/fiber/releases/tag/v0.6.1"
1111
---
1212

1313
## Overview
@@ -32,7 +32,7 @@ Before getting started, make sure you have:
3232

3333
### 1. Prepare two Fiber Nodes
3434

35-
You need to setup and running two fiber Testnet nodes locally, and make sure they have at least 500 CKB liquidity in their payment channels.
35+
You need to setup and running two fiber Testnet nodes locally, and make sure they have at least **500 CKB** liquidity in their **payment channels**.
3636
It is highly recommended to follow the [Run a Fiber Node](/docs/quick-start/run-a-node) and [Basic Transfer Example](/docs/quick-start/basic-transfer) guides to set up your nodes first.
3737

3838
In this tutorial, we assume the info for the two nodes are:
@@ -846,6 +846,7 @@ In this tutorial, you've learned how to integrate the Fiber network with a Phase
846846
- Real-time microtransactions without gas fees
847847
- Play-to-earn mechanics with instant payments
848848
- Token-based in-game economies
849+
- Single transactions take roughly 300-500 ms when both nodes run on the same machine
849850
850851
By leveraging Fiber's Layer 2 scaling solution, you can build games with blockchain features that don't compromise on user experience or performance.
851852

example/simple-game/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"vite": "^5.4.21"
2020
},
2121
"dependencies": {
22-
"@ckb-ccc/core": "^1.5.3",
22+
"@ckb-ccc/core": "^1.12.3",
2323
"@tailwindcss/vite": "^4.0.9",
2424
"phaser": "^3.80.1",
2525
"tailwindcss": "^4.0.9"

0 commit comments

Comments
 (0)