github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/docs/deploy.md (about)

     1  # Burrow Deploy (Playbooks)
     2  
     3  The Burrow deploy toolkit can do a number of things:
     4  
     5  * compile Solidity source files (using solc) and deploy to chain
     6  * call function on existing contract
     7  * read or write to name registry
     8  * manage permissions of accounts
     9  * run tests and assert on result
    10  * bond and unbond validators
    11  * create proposals or vote for a proposal
    12  
    13  burrow deploy needs a script to its commands. This script format bares some similarity to [ansible](https://www.ansible.com/). It
    14  is in yaml format. The top level structure is an array of [jobs](https://github.com/hyperledger/burrow/blob/main/deploy/def/job.go).
    15  The different job types are [defined here](https://github.com/hyperledger/burrow/blob/main/deploy/def/jobs.go).
    16  
    17  You can invoke burrow from the command line:
    18  
    19  ```shell
    20  burrow deploy -a CF8F9480252B70D59CF5B5F3CAAA75FEAF6A4B33 deploy.yaml
    21  ```
    22  
    23  Each job in the playbook has a name. This name can be used in later jobs to refer to the result of a previous job (e.g. the address of a contract
    24  which was deployed). The jobs are executed in-order.
    25  
    26  Whenever an account needs to be specified, the key name in the burrow keys server can also be used.
    27  
    28  ## Deploy
    29  
    30  The deploy job compiles a solidity source file to a bin file which is then deployed to the chain. This type of job has the following
    31  parameters:
    32  
    33  * _source:_ the input address from which to do the deploy transaction
    34  * _contract:_ the path to the solidity source file
    35  * _instance:_ once solidity source file can contain multiple contracts. This field is ignored if there is only one contract in the
    36    source. If there are multiple, the contract must match the filename, else this field. If this field is set to "all", all contracts
    37    in will be deployed.
    38  * _libraries:_ list of the library address to link against
    39  * _data:_ the arguments to the contract's constructor
    40  
    41  The solidity source file is compiled using the [solidity compiler](https://github.com/ethereum/solidity) unless the `--wasm` argument was given
    42  on the burrow deploy command line, in which case the [solang compiler](https://github.com/hyperledger-labs/solang) is used.
    43  
    44  The contract is deployed with its metadata, so that we can retrieve the ABI when we need to call a function of this contract. For this
    45  reason, the bin file is a modified version of the [solidity output json](https://solidity.readthedocs.io/en/v0.5.11/using-the-compiler.html#output-description).
    46  
    47  A solidity source file can have any number of contracts, and those contract names do not have to match the file name of the source. The resulting bin
    48  file(s) is named according to the name of the contract(s). To select which contracts to use, specifiy the _instance_ field.
    49  
    50  If the _contract_ is specified as a bin file, compilation will be skipped. It can be useful to separate compilation from deployment using the build job,
    51  which is described next.
    52  
    53  ## Build
    54  
    55  The build job is used to only compile solidity and do not do any deployment. This only has one parameter:
    56  
    57  * _contract:_ the path to the solidity source
    58  
    59  ## Call / Query-Contract
    60  
    61  The call and query contract job is for executing contract code by way of running one of the functions. The call job will create a transaction
    62  and will have to wait until the next block to retrieve the result; the query-contract job is for accessing read-only functions which do not require
    63  write access. This type of job has the following parameters:
    64  
    65  * _source:_ the input address which should execute the transaction
    66  * _destination:_ the account to access
    67  * _function:_ the name of the function to call
    68  * _data:_ the arguments to the function call
    69  * _bin:_ the path to the abi or bin file
    70  
    71  The _destination_ field can either be a hex encoding adress, the name of a key name (e.g. Root\_0 or Participant\_1), or the result
    72  of previous burrow deploy job. In the latter case the name of the job must be specified, prefixed with $.
    73  
    74  If the contract was deployed without metadata (e.g. using the burrow js module or with an earlier version of burrow deploy) the abi must be
    75  specified. This must be the path to the contract bin file or abi file.
    76  
    77  ## Proposal
    78  
    79  This is described in the [proposal tutorial](tutorials/8-proposals.md).