Struggling a little bit to figure out how to specify the public and private keys and account address for the default service account when I’m using flow emulator.
If I do a ‘flow project start-emulator’ - the default service account is created with this message
'Using service account 0xf8d6e0586b0a20c7 serviceAddress=f8d6e0586b0a20c7 serviceHashAlgo=SHA3_256 servicePrivKey=bf9db4706c2fdb9011ee7e170ccac492f05427b96ab41d8bf2d8c58443704b76 servicePubKey=c8e020c9ddd636cdf82084958914610af86099c3e69c58b53994fdfe537673a261c71b2bcabdf2e5ed7d6bb4113dfe9762ce77adc4108e538d8488d1d4c90b1e serviceSigAlgo=ECDSA_P256'
-
Am I supposed to use the given private key in the flow.json file?
Step 1 - Flow project init //creates flow.json
Step 2 - Flow project start-emulator
Step 3 - Flow keys generate
Step 4 - flow accounts create --key=“Public_KEY” //use the public key from Step 3
Step 5 - flow transactions status //tx-id from emulator run - command line
//when you create the flow.json it will fill in the service account
flow.json
{
“emulators”: {
“default”: {
“port”: 3569,
“serviceAccount”: “emulator-account”
}
},
“contracts”: {
“ExampleNFT”: “Nft.cdc”
},
“networks”: {
“emulator”: {
“host”: “127.0.0.1:3569”,
“chain”: “flow-emulator”
}
},
“accounts”: {
“emulator-account”: {
“address”: “xxxxxxx”,
“keys”: "xxxxx ",
“chain”: “flow-emulator”
}
},
“deployments”: {
“emulator”: {
“emulator-account”: [“ExampleNFT”]
}
}
}