Note: Anyone can deploy and update contracts on mainnet. Smart contract reviews (to discover any issues that may affect your users) are still provided upon request. However, they are not mandatory.
- Testnet testing: Smart contracts include test coverage and follow any additional guidelines set out here: Smart Contract Testing Guidelines. Application live on testnet and handling real world traffic for an extended period of time as suggested here: Testnet Testing Guidelines
- Flow CLI: You have the CLI installed and ran
flow init
in your project folder, generating aflow.json
file - Mainnet account: You completed the mainnet account setup and have your key pair and mainnet address ready
First, you need to configure the flow.json
file to add your mainnet account details:
1{2...3"accounts": {4"my-mainnet-account": {5"address": "ADDRESS_FROM_PREVIOUS_STEP",6"key": "PRIVATE_KEY_GENERATED_IN_PREVIOUS_STEP"7}8}9...10}
Next, you need to set the deployment target configuration for the mainnet:
1{2...3"deployments": {4"mainnet": {5"my-mainnet-account": ["Foo", "Bar"]6}7}8...9}
With the configuration changes completed, run the Flow CLI deployment command:
1> flow project deploy --network=mainnet23Deploying 2 contracts for accounts: my-mainnet-account45Foo -> 0xab7... (1e8fdb973...90b7ee38b8)67Bar -> 0xab7... (6c243d09e...b878111098)8910✨ All contracts deployed successfully
Note: This command automatically deploys your project's contracts based on the configuration defined in your
flow.json
file. If you encounter any errors, review the configuration first.
Important: If you see
Error Code: 1103
, your new account does not have enough funds to complete the transaction. Make sure you have enough FLOW (e.g. by sending some from your Blocto account).
Once all your contracts are deployed, you can visit flow-view-source or run the Flow CLI get account command to confirm the deployment.
You can use the Flow CLI contract update command to re-deploy an updated version of your contract:
1> flow accounts update-contract Foo ./Foo.cdc --signer=my-mainnet-account --network=mainnet23Transaction ID: e0728170165ce...6956785be504Contract 'Foo' updated on the account 'ab7...'.56Address 0xab7...7Balance 1000.000996778Keys 1910Key 0 Public Key 39a097c....11Weight 100012Signature Algorithm ECDSA_P25613Hash Algorithm SHA3_25614Revoked false15Sequence Number 316Index 01718Contracts Deployed: 219Contract: 'Foo'20Contract: 'Bar'212223Contracts (hidden, use --include contracts)
You should follow the steps listed in the Alchemy repository to get your NFT discovered through the Alchemy API. Make sure you added files needed to support your NFT on mainnet specifically.
In these early days of Flow, version updates to Cadence, Flow Node software, and the Flow SDKs will often contain important updates as well as breaking changes.
Breaking changes will be a fact of life for early adopters of Flow's development stack, and you may often need to manually re-deploy your application's contracts after updates.
A version compatibility table can be found here. This will help you navigate version compatibility between Emulator, SDK, and Network Node (flow-go) versions.
"Sporking" (soft forking) is the process of upgrading Flow network node software, and migrating the state from the previous version.
Currently, historical event data is not migrated between sporks, so you'll need to design your application with this in mind. We recognize the usefulness of historical event data and plan on adding a means of accessing it in the near future.
Unlike Flow Testnet, once your application is launched on Flow Mainnet, your users will be exchanging real value in the form of FLOW tokens (The Flow blockchain's native token) or other resources which have been made available. You or your user will also be responsible for paying transaction fees using FLOW tokens.
You can read about Transaction fees here: https://docs.onflow.org/flow-token/concepts/#fees