Skip to content

Commit 34d92ef

Browse files
committed
added faq
1 parent ce49ce9 commit 34d92ef

File tree

2 files changed

+103
-4
lines changed

2 files changed

+103
-4
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,24 @@ The admin moved the marble, JS detected the drag/drop, client sends a websocket
550550
551551
That’s it! Hope you had fun transferring marbles.
552552
553-
## Marbles Tips
554-
There are few comments about marbles that don't fit neatly into the instructions above.
555-
Here is an assortment of marbles tips and instructions.
556-
- coming soon
553+
# Marbles FAQs
554+
Do you have questions about _why_ something in marbles is the way it is? Or _how_ to do something? Check out the [FAQ](./docs/faq.md) .
555+
556+
# Feedback
557+
I'm very interested in your feedback.
558+
This is a demo built for people like you, and it will continue to be shaped for people like you.
559+
On a scale of no-anesthetic-root-canal to basket of puppies, how was it?
560+
If you have any ideas on how to improve the demo/tutorial, please reach out!
561+
Specifically:
562+
563+
- Did the format of the readme work well for you?
564+
- At which points did you get lost?
565+
- Is something broken!?
566+
- Did your knowledge grow by the end of the tutorial?
567+
- Was something particularly painful?
568+
- Did it make you have an existential crisis and you are suddenly unsure of what it means to be, you?
569+
570+
Use the [GitHub Issues](https://github.com/IBM-Blockchain/marbles/issues) section to communicate any improvements/bugs and pain points!
557571
558572
# License
559573
[Apache 2.0](LICENSE)

docs/faq.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Marbles FAQ
2+
3+
1. [Does deleting a marble re-write history? How is this not breaking the blockchain ledger?](./#deleteHistory)
4+
5+
1. [What is with the required input arguments for the marbles chaincode?](./#inputArgs)
6+
7+
1. [How can I create a HA(high-availability) setup?](./#ha)
8+
9+
1. [I want to run a local Hyperledger Fabric network... how?](./#localFabric)
10+
11+
1. [What is this "fcw" aka "fc wrangler" thing?](./#fcw)
12+
13+
1. [I'm stuck, can you help me?](./#stuck)
14+
15+
***
16+
17+
<a name="deleteHistory"></a>
18+
19+
### Q. Does deleting a marble re-write history? How is this not breaking the blockchain ledger?
20+
It does not re-write history.
21+
"History" would refer to the ledger, which can not be re-written under normal circumstances.
22+
The "delete" transaction is a regular transaction that gets recorded into a block in the ledger.
23+
Therefore the marble's creation and activity remains in the ledger unchanged, forever, even after a "delete".
24+
However the _state_ of the asset did change.
25+
The ledger and the world state are different things.
26+
The ledger contains the historic actions to the chaincode and channel (transactions).
27+
While the world state is all the asset data at a specific _moment_ of time.
28+
Think of it as the combined result of playing back all transactions.
29+
When we created a marble, we appended the create transaction to the ledger, and added the marble to the world state.
30+
Like-wise when we delete, the delete transaction is appended to the ledger, and the world state is altered to remove the marble.
31+
32+
33+
<a name="inputArgs"></a>
34+
35+
### Q. What is with the required input arguments for the marbles chaincode?
36+
The marbles chaincode requires a single integer as an input.
37+
This is purely for demonstration reasons to show how its possible to pass inputs to a chaincode during its instantiate.
38+
The actual number you provide to marbles is meaningless, go nuts.
39+
40+
41+
<a name="ha"></a>
42+
43+
### Q. How can I create a HA(high-availability) setup
44+
The latest and greatest marbles already does this! Checkout the `fc wrangler` files: [high_availability.js](../utils/fc_wrangler/high_availability.js) and [index.js](../utils/fc_wrangler/index.js). The code snippet below shows that when an invoke fails, we call `ha.switch_peer()` to send the same call to the next peer. Remember that the SDK is configured to send requests to specific peers, so all we have to do is change this peer.
45+
46+
__./utils/fc_wrangler/index.js__
47+
```js
48+
fcw.invoke_chaincode = function (obj, options, cb_done) {
49+
invoke_cc.invoke_chaincode(obj, options, function (err, resp) {
50+
if (err != null) { //looks like an error with the request
51+
if (ha.switch_peer(obj, options) == null) { //try another peer
52+
logger.info('Retrying invoke on different peer');
53+
fcw.invoke_chaincode(obj, options, cb_done);
54+
} else {
55+
if (cb_done) cb_done(err, resp); //out of peers, give up
56+
}
57+
} else { //all good, pass resp back to callback
58+
ha.success_peer_position = ha.using_peer_position; //remember the last good one
59+
if (cb_done) cb_done(err, resp);
60+
}
61+
});
62+
};
63+
```
64+
65+
66+
<a name="localFabric"></a>
67+
68+
### Q. I want to run a local Hyperledger Fabric network... how?
69+
Great, I recommend that everyone starts with a local network. [Lets get going](../docs/use_local_hyperledger.md) .
70+
71+
72+
<a name="fcw"></a>
73+
74+
### Q. What is this "fcw" aka "fc wrangler" thing?
75+
It's called the Fabric Client Wrangler.
76+
It is simply a wrapper around the [fabric-client](https://www.npmjs.com/package/fabric-client) SDK module.
77+
ie it gives me a slightly friendlier interface to the SDK.
78+
It is generic and reuseable for your own adaptations.
79+
It is **not** a required component of a node.js -> Fabric application, but I feel it helps.
80+
81+
82+
<a name="stuck"></a>
83+
84+
### Q. I'm stuck, can you help me?
85+
Yes. Open an issue on our [GitHub Issues](https://github.com/IBM-Blockchain/marbles/issues). Please include as much info as you can, such as the logs you are seeing, what you were expecting to happen, etc.

0 commit comments

Comments
 (0)