code.vegaprotocol.io/vega@v0.79.0/core/faucet/README.md (about)

     1  # Faucet
     2  
     3  The faucet provides a way to deposit/mint new funds for vega builtin assets (for
     4  now, maybe more will be supported later on). The faucet takes the form of an
     5  http server exposing a REST API which triggers new chain events on the Vega.
     6  
     7  In order to control exactly who is allowed to broadcast events to the network,
     8  the [node configuration](../config/) contains a list of public keys allowed to
     9  broadcast chain events. The faucet's keypairs must be on this list before it can
    10  start allocating assets.
    11  
    12  ## Request rate limiting
    13  
    14  To prevent the users to request unlimited amount of funds, the CoolDown field in
    15  the configuration allow operator to specify a minimum amount of time between 2
    16  request for funds.
    17  
    18  ## Spam prevention
    19  
    20  In order to prevent spam from non-validator node, the faucet needs to be
    21  connected to a validator node.
    22  
    23  ## Initialisation
    24  
    25  The faucet exists as its own entity next to the vega node, with its own configuration file. It can be initialised by running the following:
    26  
    27  ```shell
    28  vega faucet init -f --update-in-place
    29  ```
    30  
    31  this will create a new config file that can be found at `VEGA_HOME/faucet/config.toml`. Providing the `--update-in-place` flag will cause the command to automatically update the Event Forward section in the main vega config with the public key of the faucet:
    32  
    33  ```toml
    34  [EvtForward]
    35    Level = "Info"
    36    RetryRate = "10s"
    37    BlockchainQueueAllowlist = ["c65af95865b4e970c48860f5c854c5ca8f340416372f9e72a98ff09e365aa0cf"]
    38  ```
    39  ## Run the faucet
    40  
    41  The faucet can be started using the core vega command line:
    42  
    43  ```shell
    44  vega faucet run
    45  ```
    46  
    47  You can run the help for more details explanation on the available flags:
    48  
    49  ```
    50  vega faucet run -h
    51  ```
    52  
    53  # API
    54  
    55  ## Get new funds
    56  
    57  ### Request
    58  
    59  POST /api/v1/mint
    60  
    61  ```json
    62  {
    63  	"party": "party_pub_key",
    64  	"amount": "amount_to_be_deposited",
    65  	"asset": "asset_id"
    66  }
    67  ```
    68  
    69  ### Response
    70  
    71  ```json
    72  {
    73  	"success": true
    74  }
    75  ```
    76  
    77  Note: the response does not indicate that the deposit succeeded, but that the
    78  request was send to the Vega network. It may take a few blocks before your the
    79  assets are deposited.