Skip to content

Commit a831339

Browse files
authored
Merge pull request #347 from EYBlockchain/wenxing/from-mumbai-to-amoy
fix: update for polygon testnet from mumbai to amoy
2 parents d829286 + 7df3554 commit a831339

File tree

5 files changed

+29
-21
lines changed

5 files changed

+29
-21
lines changed

README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -344,17 +344,9 @@ Starlight handles secret initiation in the constructor by creating a proof at th
344344

345345
Since this inevitably creates a commitment to be sent your local db, simply restarting the zapp will **not** work. The blockchain will be aware of the constructor commitment, but your zapp will not.
346346

347-
If you would like to restart the zapp and redeploy the contract, always (with no running docker containers) run:
348-
349-
`./bin/redeploy` <-- creates a new constructor proof and saves the commitment, then deploys the shield contract
350-
351-
`npm run restart` <-- if you'd like to use the APIs, always **restart** rather than **start** since the latter clears your local dbs
352-
353-
Then, if you previously had nullifiers, reinstate them in your local sparse merkle tree by sending a POST to `http://localhost:3000/reinstateNullifiers`.
354-
355347
#### Deploy on public testnets
356348

357-
Apart from local ganache instance, Starlight output zapps can now be deployed in Sepolia, Goerli and Polygon Mumbai as cli options. Connection to Sepolia and Goerli are made through [infura](https://infura.io/) endpoints and that of Polygon Mumbai is provided via [maticvigil](https://rpc.maticvigil.com/).
349+
Apart from local ganache instance, Starlight output zapps can now be deployed in Sepolia, Goerli and Polygon Amoy as cli options. Connection to Sepolia and Goerli are made through [infura](https://infura.io/) endpoints and that of Polygon Amoy is provided via [Alchemy](https://www.alchemy.com/).
358350

359351
The configuration can be done during `./bin/setup` phase in the following way.
360352

@@ -364,7 +356,7 @@ The configuration can be done during `./bin/setup` phase in the following way.
364356

365357
| option | description |
366358
|:--|:--|
367-
| `-n` | Network : Specify testnet you want to connect to. possible options: `mumbai/ sepolia/ goerli` |
359+
| `-n` | Network : Specify testnet you want to connect to. possible options: `amoy/ sepolia/ goerli` |
368360
| `-a` | Ethereum address |
369361
| `-k` | Private key of above ethereum address |
370362
| `-m` - | 12 letter mnemonic passphrase |

bin/start

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ set -e
33

44
npm install -g ./
55

6-
tsc
6+
./node_modules/typescript/bin/tsc

src/boilerplate/common/bin/setup

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ rm -rf proving-files
4444

4545
perl -i -pe "s,docker-compose.zapp.yml -f docker-compose.zapp.override.yml,docker-compose.zapp.yml,g" package.json
4646

47-
if [[ $network == 'mumbai' ]] || [[ $network == 'sepolia' ]] || [[ $network == 'goerli' ]]
47+
if [[ $network == 'amoy' ]] || [[ $network == 'sepolia' ]] || [[ $network == 'goerli' ]]
4848
then
4949
perl -i -pe "s,DEFAULT_ACCOUNT: '',DEFAULT_ACCOUNT: \'$account\',g" docker-compose.zapp.override.yml
5050
perl -i -pe "s,DEFAULT_ACCOUNT_MNEMONIC: '',DEFAULT_ACCOUNT_MNEMONIC: \'$mnemonic\',g" docker-compose.zapp.override.yml
@@ -54,10 +54,10 @@ perl -i -pe "s,docker-compose.zapp.yml,docker-compose.zapp.yml -f docker-compose
5454
perl -i -pe "s,docker-compose -f docker-compose.zapp.yml up -d ganache, ## up ganache service for ganache,g" bin/startup
5555
fi
5656

57-
if [[ $network == 'mumbai' ]]
57+
if [[ $network == 'amoy' ]]
5858
then
59-
perl -i -pe "s,RPC_URL: '',RPC_URL: \'wss:\/\/rpc-mumbai.maticvigil.com\/ws\/v1\/$rpc\',g" docker-compose.zapp.override.yml
60-
perl -i -pe "s,development_ganache,mumbai,g" entrypoint.sh
59+
perl -i -pe "s,RPC_URL: '',RPC_URL: \'wss:\/\/polygon-amoy.g.alchemy.com\/v2\/$rpc\',g" docker-compose.zapp.override.yml
60+
perl -i -pe "s,development_ganache,amoy,g" entrypoint.sh
6161
perl -i -pe "s,while,##while,g" entrypoint.sh
6262
perl -i -pe "s,10,60,g" bin/startup
6363
fi

src/boilerplate/common/config/default.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,27 +88,41 @@ module.exports = {
8888
port: process.env.BLOCKCHAIN_PORT,
8989
},
9090
// web3:
91-
web3: {
91+
web3: {
9292
host: process.env.BLOCKCHAIN_HOST,
9393
port: process.env.BLOCKCHAIN_PORT,
9494
// url: `${process.env.BLOCKCHAIN_HOST}:${process.env.BLOCKCHAIN_PORT}`,
9595
url: process.env.RPC_URL,
9696
rpcUrl: process.env.RPC_URL,
9797
defaultAccountMnemonic: process.env.DEFAULT_ACCOUNT_MNEMONIC,
9898
key: process.env.KEY,
99+
autoReconnectInterval: process.env.BLOCKCHAIN_RECONNECT_INTERVAL || 1000,
99100

100101
options: {
101102
// defaultAccount: '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1',
102103
defaultAccount: process.env.DEFAULT_ACCOUNT,
103-
defaultGas: 5221975,
104-
defaultGasPrice: 20000000000,
104+
defaultGas: 11511304,
105+
defaultGasPrice: 30000000000,
105106
// defaultBlock: '0', // e.g. the genesis block our blockchain
106107
// defaultGas: 90000000,
107108
// defaultGasPrice: 20000000000,
108-
// transactionBlockTimeout: 50,
109+
transactionBlockTimeout: 150,
109110
// transactionConfirmationBlocks: 15,
110111
// transactionPollingTimeout: 480,
111112
// transactionSigner: new CustomTransactionSigner()
113+
clientConfig: {
114+
// Useful to keep a connection alive
115+
keepalive: true,
116+
// Keep keepalive interval small so that socket doesn't die
117+
keepaliveInterval: -1,
118+
},
119+
timeout: 0,
120+
reconnect: {
121+
auto: true,
122+
delay: 5000, // ms
123+
maxAttempts: 120,
124+
onTimeout: false,
125+
},
112126
},
113127
},
114128
};

src/boilerplate/common/truffle-config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ module.exports = {
5050
network_id: 1337, // Any network (default: none)
5151
gas: 10000000,
5252
},
53-
mumbai: {
53+
amoy: {
5454
networkCheckTimeout: 10000,
5555
provider: () => new HDWalletProvider(mnemonic, rpcUrl),
56-
network_id: 80001,
56+
network_id: 80002,
57+
gas:8500000,
58+
gasPrice:30000000000,
5759
confirmations: 2,
5860
timeoutBlocks: 200,
5961
port: 8545,

0 commit comments

Comments
 (0)