run fabcar go (#232)

* add go/runfabcar.sh

Signed-off-by: Acmefocus <107723772@qq.com>

* add set hosts and env in go

Signed-off-by: Acmefocus <107723772@qq.com>

* Update fabcar/startFabric.sh

Co-authored-by: Sijo Cherian <sijocherian@users.noreply.github.com>
Signed-off-by: Acmefocus <107723772@qq.com>

* Update startFabric.sh

delete  set  /etc/hosts

Signed-off-by: Acmefocus <107723772@qq.com>

* add environment variable DISCOVERY_AS_LOCALHOST

Signed-off-by: Acmefocus <107723772@qq.com>

Co-authored-by: Sijo Cherian <sijocherian@users.noreply.github.com>
This commit is contained in:
Acmefocus 2020-07-10 23:18:05 +08:00 committed by GitHub
parent 1249207afd
commit 59acacbef1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -18,6 +18,7 @@ import (
)
func main() {
os.Setenv("DISCOVERY_AS_LOCALHOST", "true")
wallet, err := gateway.NewFileSystemWallet("wallet")
if err != nil {
fmt.Printf("Failed to create wallet: %s\n", err)

15
fabcar/go/runfabcar.sh Executable file
View file

@ -0,0 +1,15 @@
ENV_DAL=`echo $DISCOVERY_AS_LOCALHOST`
echo "ENV_DAL:"$DISCOVERY_AS_LOCALHOST
if [ "$ENV_DAL" != "true" ]
then
export DISCOVERY_AS_LOCALHOST=true
fi
echo "DISCOVERY_AS_LOCALHOST="$DISCOVERY_AS_LOCALHOST
echo "run fabcar..."
go run fabcar.go