Skip to content

Commit

Permalink
Update "master" branch references to "main"
Browse files Browse the repository at this point in the history
Update "master" branch references to "main".

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
  • Loading branch information
denyeart committed Mar 19, 2021
1 parent 2508693 commit 94ed98a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository:
description: Packages for the implementation of the contract API for use in
Go chaincode
homepage: https://wiki.hyperledger.org/display/fabric
default_branch: master
default_branch: main
has_downloads: true
has_issues: false
has_projects: false
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Maintainers
| Andrew Hurt | awjh | awjh | andrewhurt@btinternet.com |
| James Taylor | jt-nti | jtonline | jamest@uk.ibm.com |

Also: Please see the [Release Manager section](https://github.com/hyperledger/fabric/blob/master/MAINTAINERS.md)
Also: Please see the [Release Manager section](https://github.com/hyperledger/fabric/blob/main/MAINTAINERS.md)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hyperledger Fabric Go Contract API

[![Build Status](https://dev.azure.com/Hyperledger/Fabric-Contract-API-Go/_apis/build/status/Fabric-Contract-API-Go?branchName=master)](https://dev.azure.com/Hyperledger/Fabric-Contract-API-Go/_build/latest?definitionId=48&branchName=master)
[![Build Status](https://dev.azure.com/Hyperledger/Fabric-Contract-API-Go/_apis/build/status/Fabric-Contract-API-Go?branchName=main)](https://dev.azure.com/Hyperledger/Fabric-Contract-API-Go/_build/latest?definitionId=48&branchName=main)
[![](http://godoc.org/github.com/hyperledger/fabric-contract-api-go?status.svg)](http://godoc.org/github.com/hyperledger/fabric-contract-api-go)

This repository contains the packages for the implementation of the contract API for use in Go chaincode running on Fabric v2.1
Expand All @@ -25,7 +25,7 @@ Documentation for all packages within this repo can be found [here](http://godoc
## Tutorials
Tutorials for how to create smart contracts using packages in this repo can be found [here](./tutorials)

A sample chaincode built using packages from this repo can be found in [fabric-samples](https://github.com/hyperledger/fabric-samples/tree/master/chaincode/fabcar/go)
A sample chaincode built using packages from this repo can be found in [fabric-samples](https://github.com/hyperledger/fabric-samples/tree/main/chaincode/fabcar/go)

## Raising issues
Issues for packages in this repository are raised and tracked using [JIRA](https://jira.hyperledger.org) under the project Fabric Contract API Go (FABCAG). You can view the current open issues by visiting [https://jira.hyperledger.org/projects/FABCAG/issues?filter=allopenissues](https://jira.hyperledger.org/projects/FABCAG/issues?filter=allopenissues). Before raising an issue please check existing issues to avoid duplication.
Expand Down
6 changes: 3 additions & 3 deletions tutorials/using-advanced-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This tutorial will assume you have:
## Transaction hooks
Creating a chaincode using the contractapi package provides the ability for you to specify functions to be called before and after each call to a contract.

You may have noticed when writing the code in the [previous tutorial](./getting-started.md) that each function performs the same task as its first action, reading from the world state. It would therefore be useful to create one function to do this and set it up to run before each transaction. The transaction context sent to before and after functions is the same instance as the called function receives. We can therefore set data in our before function on this transaction context and use that data in our called function. Likewise we can set data in our called function and use it in an after function. One thing of note is that, since in fabric you [cannot read your own writes](https://hyperledger-fabric.readthedocs.io/en/master/readwrite.html), if you write to the world state in your before function the called function will not see that updated value.
You may have noticed when writing the code in the [previous tutorial](./getting-started.md) that each function performs the same task as its first action, reading from the world state. It would therefore be useful to create one function to do this and set it up to run before each transaction. The transaction context sent to before and after functions is the same instance as the called function receives. We can therefore set data in our before function on this transaction context and use that data in our called function. Likewise we can set data in our called function and use it in an after function. One thing of note is that, since in fabric you [cannot read your own writes](https://hyperledger-fabric.readthedocs.io/en/latest/readwrite.html), if you write to the world state in your before function the called function will not see that updated value.

Before and after functions do not follow the same structure [rules](./getting-started.md#writing-contract-functions) as contract functions. Functions specified to be called before the call cannot take any parameter other than the transaction context and those specified to be called after can only take the transaction context and an interface type. For example:

Expand Down Expand Up @@ -211,7 +211,7 @@ peer chaincode query -n mycc -c '{"Args":["BadFunction", "KEY_1"]}' -C myc
Notice that the output differs from what was returned when you issued the same command before setting up the custom unknown transaction handler.

## Chaincode metadata
Chaincode created using the contractapi package automatically has generated for it a system contract which provides metadata about the chaincode. This metadata describes the contracts that form the chaincode, describing their functions, the parameters those functions take, as well as function return values. The metadata produced follows this [schema](https://raw.githubusercontent.com/hyperledger/fabric-contract-api-go/master/metadata/schema/schema.json).
Chaincode created using the contractapi package automatically has generated for it a system contract which provides metadata about the chaincode. This metadata describes the contracts that form the chaincode, describing their functions, the parameters those functions take, as well as function return values. The metadata produced follows this [schema](https://raw.githubusercontent.com/hyperledger/fabric-contract-api-go/main/metadata/schema/schema.json).

In Go the metadata is produced automatically for you using reflection, due to limitations of Go reflection the parameter names of functions in the metadata will not match the chaincode code but will instead use param0, param1, ..., paramN.

Expand Down Expand Up @@ -241,4 +241,4 @@ The info section of metadata is by default filled with a title and version. This
> Note: the version in the chaincode's info section is not linked directly to the version used when creating the chaincode in the network
## What to do next?
Follow the [Managing objects](./managing-objects.md) tutorial.
Follow the [Managing objects](./managing-objects.md) tutorial.

0 comments on commit 94ed98a

Please sign in to comment.