Migrate Contract
Zeus migrate allows developers to easily migrate code between different environments such as the EOS Mainnet and the CryptoKylin testnet.
If you want to easily compile, test, and deploy your code to different environments (locally, testnet, mainnet), then you've come to the right place.
You can also use Truffle to migrate npx truffle migrate.
First we'll create a contract deployment JSON file with the following command:
1
# zeus create contract-deployment tokenpeg tokenpegacct kylin
2
zeus create contract-deployment <CONTRACT_FILE_NAME> <CONTRACT_ACCOUNT_NAME> <CHAIN_NAME>
Copied!
To set code on the kylin testnet or any EOSIO network run the following
Migrate
Options
Truffle
1
# zeus migrate tokenpeg --network=kylin --creator=tokenpegacct --creator-key ... --no-reset
2
zeus migrate [CONTRACT] --network=kylin --creator=[ACCOUNT_NAME] --creator-key [ACTIVE_PRIVATE_KEY_ACCOUNT_NAME]
Copied!
1
zeus migrate [contract]
2
​
3
run migration scripts
4
​
5
Options:
6
--version Show version number [boolean]
7
--storage-path path for persistent storage
8
[default: "/home/ubuntu/.zeus"]
9
--rc-file use rc file to load options from
10
[default: "/home/ubuntu/.zeus/zeusrc.json"]
11
--rc-ignore ignore rc file [default: false]
12
--verbose, -v [default: false]
13
-h, --help Show help [boolean]
14
--compile-all compile all contracts [default: true]
15
--wallet keosd wallet to use [default: "zeus"]
16
--creator-key private key to set contract to
17
[default: "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
18
--creator eos account to set contract to [default: "eosio"]
19
--reset reset local environment [default: true]
20
--chain chain to work on [default: "eos"]
21
--network network to work on [default: "development"]
22
--services service APIs to run [default: ""]
23
--sidechain sidechain name to use for liquidx [default: ""]
24
--transfer account staking amount [default: "1000"]
25
--custom-token custom chain token [default: ""]
26
--custom-token-precision custom chain token permission [default: 4]
27
--evm-host custom evm host [default: ""]
28
--evm-port custom evm port [default: 4]
29
--evm-sister-host custom evm sister host [default: ""]
30
--evm-sister-port custom evm sister port [default: 4]
31
--stake account staking amount [default: "300"]
32
​
33
Examples:
34
zeus migrate [contract] --no-compile-all --no-reset
Copied!
1
npx truffle migrate
Copied!
Before migrating, you can also import the keys and not need to pass the creator key
You can also run combinations like:
1
# specify key for deployment
2
zeus migrate cronconsumer --creator natdeveloper --creator-key 5JxD6PbUpUSQQhunwGDK9ajWFZQ17h4Qa4271SzMdhivhwunQ4x --network=kylin
3
# all kylin cronconsumer contract deployments on jungle3
4
zeus migrate cronconsumer --network=jungle3
5
# all migrations
6
zeus migrate
7
# all migrations on kylin
8
zeus migrate --network=kylin
9
# all migrations for creator natdeveloper on development
10
zeus migrate --creator natdeveloper --network=development
11
# do not compile and do not reset environment
12
zeus migrate --no-compile-all --no-reset
Copied!
​
​
Last modified 4mo ago
Copy link