Skip to content

Commit

Permalink
tweak config doc readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dshuffma-ibm committed Apr 6, 2017
1 parent 17d8b63 commit 01c4fe6
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 34 deletions.
55 changes: 33 additions & 22 deletions docs/config_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@

Configuration of marbles happens with two files.
These files can be found in the folder `<marbles directory>/config`.
You must edit them from their default state.

1. Config File
- This is the file that has settings for the marble company you are pretending to be.
- Such as a the name of your marbles company, list of marble owners, what port this marbles app should use, etc..
- It can be found in `<marbles directory>/config/marbles1.json`.
- You only need to edit/create 1 file.
- Create a new file for each Marble company you want to pretend to be.
### Config File:

1. Credential File
- This file has settings for your network.
- This can be found in `<marbles>/config/blockchain_creds1.json`.
- You only need to edit/create 1 file.
- Use seperate files for seperate blockchain networks.
- This is the file that has settings for the marble company you are pretending to be.
- Such as the name of your marbles company, list of marble owners, port for the app, etc..
- It can be found in `<marbles directory>/config/marbles1.json`.
- You only need to edit/create 1 file. Details below.
- Tip: Create a new file for each Marble company you want to pretend to be.



### Config File Example:
**Example JSON**

```json
{
Expand All @@ -37,18 +31,29 @@ These files can be found in the folder `<marbles directory>/config`.

```

- cred_filename - The name of the `Credential File` to use for your network. See the `Credential File` section for details.
- use_events - When `true` it will use EventHub.js in the SDK to be notified when tx are committed to the ledger. When `false` it will wait/sleep for a block to be created
- keep_alive_secs - How often to periodically re-enroll in seconds. This keeps the gRPC connections alive.
- company - The name of your marbles company
- usernames - The list of marbles owners that should be created on initial startup
- port - The port to use when hosting the marbles application
- last_start_hash - You do not need to modify/create this field. Its created internally when marbles runs successfull. Its a hash of the network credentials file. Its used to detect when you are trying to re-run marbles with a new network and we should go through the full initial startup.
Your config file must have all the fields listed above.
There is already an example file in the config folder you can use.

**Details**

- cred_filename - The name of the `Credential File` to use for your network. See the `Credential File` section for details.
- use_events - When `true` it will use EventHub.js in the SDK to be notified when tx are committed to the ledger. When `false` it will wait/sleep for a block to be created.
- keep_alive_secs - How often to periodically re-enroll in seconds. This keeps the gRPC connections alive. Recomended value is 120 seconds.
- company - The name of your marbles company.
- usernames - The list of marbles owners that should be created on initial startup.
- port - The port to use when hosting the marbles application.
- last_start_hash - You do not need to modify/create this field. Its created internally when marbles successfully starts up. It is a hash of the network credentials file. It is used to detect when you are trying to re-run marbles with a new network and we should go through the initial startup again.


### Creds File Example:

- This file has settings for your blockchain network.
- This can be found in `<marbles>/config/blockchain_creds1.json`.
- You only need to edit/create 1 file. Details below.
- Tip: Use seperate files for seperate blockchain networks.

**Example JSON**

```json
{
"credentials": {
Expand Down Expand Up @@ -90,6 +95,8 @@ These files can be found in the folder `<marbles directory>/config`.
}
```

**Details**

- network_id - The main purpose of this is to detect when people try to use the default file w/o any editing! Set it to anything other than `FakeNetworkId`.
- orderers - An Array. Must have at least 1 entry. You can add more, but currently only the first one will be used.
- discovery - The gRPC url to reach the orderer. It must include the port.
Expand All @@ -110,4 +117,8 @@ These files can be found in the folder `<marbles directory>/config`.
- chaincode_version - Version of the chaincode installed.
- block_delay - Time in ms for a block to be created by the orderer. This is a setting in the orderer's yaml.
- tls_common_name - Only needed when using self signed certs. It will override the common name.
- tls_certificate - Can be either the complete PEM file that has line breaks encoded as `\r\n` **OR** a relative file path to a PEM file inside the `config` folder.
- tls_certificate - Can be either the complete PEM file that has line breaks encoded as `\r\n` **OR** a relative file path to a PEM file inside the `config` folder.

Once you have edited `blockchain_creds1.json` you are ready to install/instantiate Marbles.

1. Continue where you left off in the [tutorial](./tutorial_start_here.md#installchaincode).
2 changes: 1 addition & 1 deletion docs/host_marbles_bluemix.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@

---------------------------------------- Websocket Up ------------------------------------------

1. Marbles is running! Now [Continue tutorial 1](./tutorial_start_here.md#use).
1. Marbles is running! Now [continue the tutorial](./tutorial_start_here.md#use).
2 changes: 1 addition & 1 deletion docs/host_marbles_locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ Lets do the very last setup for marbles.

![](/doc_images/localhost4.png)

1. Marbles is all setup! Now [Continue tutorial 1](./tutorial_start_here.md#use).
1. Marbles is all setup! Now [continue the tutorial](./tutorial_start_here.md#use).
2 changes: 1 addition & 1 deletion docs/tutorial_start_here.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Choose the **only** option that is relevant for your setup:
- **Option 2:** Install chaincode with the SDK locally
</strike>

*^ instructions coming soon*
**Update:** *instructions coming soon*

<a name="hostmarbles"></a>

Expand Down
14 changes: 5 additions & 9 deletions docs/use_local_hyperledger.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# Use Local Hyperledger Network:

### Creating a Local Hyperledger Fabric Network
Use the published fabric docker images and docker-compose script to get a local network quickly.
Use the Hyperledger Fabric docker images and docker-compose script to get a local network quickly.

1. Follow the Fabric v1 [Getting Started instructions](http://fabric-rtd.readthedocs.io/en/latest/getting_started.html).

### Finished
The network is all setup, right?
So if you followed the instructions then your orderer will be batching new blocks every 10 seconds.
This is a litttttle long for our application, and may give you unexpected behavior.
This is a litttttle long for our application, and may give you undesired behavior, sometimes.
Basicaly if you move a marble the trade will take 10 seconds to settle.
The **UI may redraw the marble back in its original position**, and then jump to a correct position after some time.
This is a known issue and is because of a the long batch time.
If you use the Bluemix service, the batch time is only 1 second and you will not see this odd behavior.
If you use the Bluemix service, the batch time is only 1 second and the app has been optimized for this specfic delay.

Next we need to **pass the location of our peer to our marbles application**.
Next we need to **pass the address and other info of our peer to our marbles application**.
This is done by editing the creds file.

1. Follow the [config instructions](./config_file.md). Then come back here.

Once you have edited `blockchain_creds1.json` you are ready to install/instantiate Marbles.

1. Continue where you left off in [tutorial 1](./tutorial_start_here.md#installchaincode).
1. Next, follow the [configuration file instructions](./config_file.md).

0 comments on commit 01c4fe6

Please sign in to comment.