github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/docs/example/basic-app-website/Makefile (about)

     1  #
     2  # basic-app is intended to provide an example end-to-end use of burrow and burrow module in a node.js app
     3  #
     4  
     5  
     6  # One of: Darwin_i386, Darwin_x86_64, Linux_i386, Linux_x86_64
     7  BURROW_ARCH := Linux_x86_64
     8  BURROW_VERSION := 0.27.0
     9  BURROW_RELEASE_URL := "https://github.com/hyperledger/burrow/releases/download/v${BURROW_VERSION}/burrow_${BURROW_VERSION}_${BURROW_ARCH}.tar.gz "
    10  # Set to 'burrow' to use whatever is on PATH instead
    11  BURROW_BIN := bin/burrow
    12  
    13  #
    14  # Running the chain
    15  #
    16  # Make a simple single node chain
    17  .PHONY: chain
    18  chain: bin/burrow burrow.toml
    19  
    20  # Get the burrow binary
    21  bin/burrow:
    22  	mkdir -p bin
    23  	curl -L ${BURROW_RELEASE_URL} | tar zx -C bin burrow
    24  
    25  # Generate the chain
    26  burrow.toml genesis.json:
    27  	${BURROW_BIN} spec --full-accounts 1 | ${BURROW_BIN} configure --genesis-spec=- --separate-genesis-doc=genesis.json > burrow.toml
    28  
    29  # Dump account information to file for app
    30  account.json: genesis.json
    31  	jq  '.Accounts[] | select(.Name == "Full_0")' genesis.json > account.json
    32  
    33  # Reset burrow state
    34  .PHONY: reset_chain
    35  reset_chain:
    36  	rm -rf .burrow
    37  
    38  # Remove burrow chain completely
    39  .PHONY: remove_chain
    40  remove_chain:
    41  	rm -rf burrow.toml genesis.json .keys .burrow
    42  
    43  # remake and reset chain
    44  .PHONY: rechain
    45  rechain: | remove_chain chain
    46  
    47  .PHONY: start_chain
    48  start_chain: chain
    49  	${BURROW_BIN} start -v0
    50  
    51  .PHONY: restart
    52  restart: | rechain start_chain
    53  
    54  #
    55  # Deploying the contract
    56  #
    57  deploy.output.json: simplestorage.sol deploy.yaml account.json
    58  	${BURROW_BIN} deploy --address $(shell jq '.Address' account.json) deploy.yaml
    59  
    60  .PHONY: delete_deploy
    61  delete_deploy:
    62  	rm -rf deploy.output.json
    63  
    64  .PHONY: deploy
    65  deploy: deploy.output.json
    66  
    67  .PHONY: redeploy
    68  redeploy: | delete_deploy deploy.output.json
    69  
    70  #
    71  # Running the app
    72  #
    73  
    74  .PHONY: yarn_install
    75  yarn_install:
    76  	yarn install
    77  
    78  .PHONY: start_app
    79  start_app: yarn_install deploy
    80  	node app.js