Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 5.63 KB

README.md

File metadata and controls

59 lines (44 loc) · 5.63 KB

Scripts

Setup bridge

  1. Run bridge-setup.go with privateKey, accountId and network as flags to generate the configurations go run ./scripts/bridge/setup/cmd/setup.go --privateKey=/your private key/ --accountID=/your account id/ --adminKey=/your admin key/ --network=/previewnet|testnet|mainnet/ --members=/int, the count of the wanted bridge custodians/

  2. Run create.go to create custom token and associate it with hedera go run ./scripts/token/native/create/cmd/create.go --privateKey=/your private key/ --accountID=/your account id/ --network=/previewnet|testnet|mainnet/ --memberPrKeys=/'The array of private keys from from the output of the previous step separated by ","'/ --bridgeID=/The bridge id from the output of the previous step/

  3. Run wrapped-token-create.go to create custom wrapped token with a bridge account treasury and associate it with hedera go run ./scripts/token/wrapped/create/cmd/create.go --privateKey=/your private key/ --accountID=/your account id/ --adminKey=/your admin key/ --network=/previewnet|testnet|mainnet/ --memberPrKeys=/'The array of private keys from from the output of the previous step separated by ","'/ --bridgeID=/The bridge id from the output of the previous step/ --generateSupplyKeysFromMemberPrKeys=true

  4. Associate new account to token go run ./scripts/token/associate/cmd/associate.go --privateKey=/your private key/ --accountID=/your account id/ --network=/previewnet|testnet|mainnet/ --tokenID=/The Token id from the output of the previous step/

Update bridge config

  1. Run create-topic.go (only once) with supplyKeys, executorAccountID, executorPrivateKey, keyThreshold, network to create the topic with all given public keys and the key threshold. go run ./scripts/common/create-topic/create-topic.go --supplyKeys /public keys, split by comma/ --executorAccountID /executor account id/ --executorAccountID /executor private key/ --keyThreshold /key threshold (default: 1)/ --network /previewnet|testnet|mainnet/

  2. Run prepare-update-config.go with executorAccountID, topicID and configPath to create frozen transaction as bytes which to send for signing to all members go run ./scripts/bridge/update-config/cmd/prepare-update-config.go --executorAccountID /executor account id/ --topicID /topic id/ --network /previewnet|testnet|mainnet/ --configPath /full or relative path to bridge.yml/ --validStartMinutes /start minutes (default 2)/ --nodeAccountID /node account id which process the transaction (default: "0.0.3")/

  3. Depending on the threshold, n out of m keys of the threshold supply key have to sign the generated bytes by running sign-transaction.go with privateKeys and transaction itself go run ./scripts/common/sign/sign-transaction.go --privateKeys /member private key (or all members private keys separated by comma/ --transaction /transaction bytes/

  4. Submit the transaction after it has been signed by the required keys, by running submit-transaction.go with privateKey, accountID, network and transaction (the signed bytes) go run ./scripts/common/submit/submit-transaction.go --privateKey /private key of executor/ --accountID /account id of the executor/ --network=/previewnet|testnet|mainnet/ --transaction /signed transaction bytes/

Full Hedera Bridge Setup with Tokens from extended Bridge Config

  1. Run extend-bridge-config with evmPrivateKey, network, configPath to extend bridge config with needed additional information (you will need also to update the 'evmNodeUrls' to add node urls for each used EVM) and will output 'extended-bridge.yml' inside 'setup/extend-config': go run ./scripts/bridge/setup/extend-config/cmd/extend-bridge-config.go --evmPrivateKey=/your evm private key/ --network=/previewnet|testnet|mainnet/ --configPath=/the path to the normal (non-extended) bridge config/

  2. Run setup-from-config.go with privateKey, accountID, network, members, adminKey, topicThreshold, wrappedTokenThreshold, configPath to fully deploy bridge with all Hedera Tokens from specified extended bridge config. go run ./scripts/bridge/setup/from-config/cmd/setup-from-config.go --privateKey=/your private key/ --accountID=/your account id/ --network=/previewnet|testnet|mainnet/ --members=/int, the count of the wanted bridge custodians/ --adminKey=/your admin key/ --topicThreshold=/topic threshold of signs needed to submit a message/ --wrappedTokenThreshold=/threshold of signs needed to manage a wrapped token/ --configPath=/the path to the extended bridge config/

Transfer tokens

Param Name Description
privateKey Private Key of the Sender
senderAccountId Sender Account id.
recipientAccountId Recipient Account id.
network Hedera network: mainet or testnet.
tokenIDs IDs of the tokens that will be transfered. They must be seperated by coma.
hbarAmount Amount of HBAR's that will be transfered to the Recipient
  1. Run transfer.go go run ./scripts/token/transfer/transfer.go -senderAccountId=/your sender account id/ --privateKey=/your private key/ --network=/testnet|mainnet/ --recipientAccountId=/recipient account id/ --tokenIds=/ids of the tokens you want to transfer (separated by coma)/ --hbarAmount=/amount of HBARs that will be send to the user/

Create Account

Param Name Description
privateKey Private Key of the account creator
senderAccountId Account id of the account creator
network Hedera network: mainet or testnet
initialBalance Initial balance of the account
  1. Run create-account.go go run ./scripts/common/create-account/create-account.go --privateKey=/your private key/ --senderAccountId=/your account id/ --network=/testnet|mainnet/ --initialBalance=/initial balance of the account in HBARs/