Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
72e8de8
added bulk add stream function and test to migrate streams from core-api
samt1803 Nov 10, 2021
088b7d2
added first draft of script, parsing tsv file with all streams, check…
samt1803 Nov 11, 2021
f109773
further into migration script, nonce is issue
samt1803 Nov 15, 2021
200d139
migrate script is working with manual nonces
samt1803 Nov 16, 2021
a55d07e
adding an array of permissions per stream into registry ([][] not sup…
samt1803 Nov 19, 2021
78b2013
migrate script does not spam mempool and saves progress to disk
samt1803 Nov 22, 2021
3a8caa2
added stream data clean script
samt1803 Nov 24, 2021
123bdb6
refactores migration script to use new cleanded up data
samt1803 Nov 24, 2021
1967c6e
little linting
samt1803 Nov 24, 2021
acc4b31
detect stuck transactions, resend them with higher gasPrice working
samt1803 Nov 25, 2021
378613d
renaming of permission attributes cherrypicked from master
samt1803 Dec 8, 2021
3fa1995
reset progress file
samt1803 Dec 14, 2021
aaf80d8
fixed possible timing async issue
samt1803 Dec 14, 2021
6d6e43d
Merge remote-tracking branch 'origin/master' into ETH-138_migrate_str…
samt1803 Dec 14, 2021
1609222
Merge branch 'master-3' into ETH-138_migrate_streams_to_ocr
samt1803 Feb 1, 2022
bdecdb2
created new package with migration, that can connect to the sqldb and…
samt1803 Feb 1, 2022
f28676a
added graphql client
samt1803 Feb 2, 2022
c5544a7
graphql query not working completely yet
samt1803 Feb 3, 2022
ca3821c
refactoring migration logic
samt1803 Feb 4, 2022
b385c78
further writing logic for migration
samt1803 Feb 4, 2022
374c837
continue implementation and refactor of migration script
samt1803 Feb 4, 2022
6bc7bec
refactor migration algorithm
samt1803 Feb 7, 2022
108bef5
seems to work as intended
samt1803 Feb 8, 2022
e4b7f0c
code cleanup, adding better log outputs
samt1803 Feb 8, 2022
dd3305b
resolve dependency cycle, some renaming
samt1803 Feb 8, 2022
4da1646
small fix; gasprice streategy; permissions are migrated in chunks of 20
samt1803 Feb 9, 2022
6eb0fe4
fix pagination
samt1803 Feb 9, 2022
637753e
add correct metadata from the database
samt1803 Feb 9, 2022
0b30939
Merge remote-tracking branch 'origin/master' into ETH-138_migrate_str…
samt1803 Feb 15, 2022
5c1aeb9
script is writing back migrated_at timestamps to the DB
samt1803 Feb 15, 2022
5098377
looping migration
samt1803 Feb 15, 2022
8709ce7
some cleanup
samt1803 Feb 15, 2022
9c829e5
some cleanup, loop-running without self-referencing setTimeouts
samt1803 Feb 16, 2022
3e86c9b
remove setup of migrator role
samt1803 Feb 16, 2022
7692353
production endpoint settings
samt1803 Feb 16, 2022
a61f88d
moved configs to .env file/env variables
samt1803 Feb 16, 2022
196c880
replacement logic for transactions, where they are replaced with high…
samt1803 Feb 17, 2022
882a5d0
debug code cleanup
samt1803 Feb 17, 2022
508b1f7
increase timeout on stuck transaction to 30 seconds
samt1803 Feb 17, 2022
59e9a48
remove one debug output
samt1803 Feb 17, 2022
93d66f6
add one debug output
samt1803 Feb 17, 2022
943e5cb
change of gas increase, some improvements in error handling, env vari…
samt1803 Feb 18, 2022
c0c0921
fixed bug with number addition not working in classes in typescript
samt1803 Feb 18, 2022
4520430
better error handling
samt1803 Feb 18, 2022
e05305f
fix: bugfix with permissions, where all their streams are filtered ou…
samt1803 Feb 28, 2022
2777eb3
Merge branch 'master-3' into ETH-138_migrate_streams_to_ocr
samt1803 Feb 28, 2022
72f9536
fix linting
samt1803 Feb 28, 2022
61bd51d
fix: fact that migrationscript has no tests should not throw error
samt1803 Feb 28, 2022
51ba248
cleanup
samt1803 Mar 2, 2022
921828a
fix: lint
jtakalai Mar 2, 2022
84a2e80
doc: add comments
jtakalai Mar 2, 2022
fc0475c
refactor: mostly renaming and adding comments
jtakalai Mar 2, 2022
9b92758
fix: rpc URL
jtakalai Mar 2, 2022
0c09cbe
build: remove IDE file
jtakalai Mar 2, 2022
ab4b6aa
Revert "refactor: mostly renaming and adding comments"
samt1803 Mar 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
/packages/smartcontracts/artifacts/
/packages/smartcontracts/typechain/
/packages/smartcontracts/.openzeppelin/
/packages/brubeck-migration-script/artifacts
/packages/brubeck-migration-script/typechain
/bin/
.DS_Store
.idea
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@
},
"cwd": "${workspaceFolder}/packages/smartcontracts"
},
{
"command": "npm run migration-run",
"name": "Run migration",
"request": "launch",
"type": "node-terminal",
"env": {
"DEBUG": "*,-mocha:*"
},
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
Expand Down
5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"graph2_copyInfo": "./scripts/copyAbis.sh && ./scripts/generateYaml.sh",
"graph3_build": "npm run doAll --workspace=streamregistry-thegraph-subgraph",
"graph": "npm run graph1_build && npm run graph2_copyInfo && npm run graph3_build",
"e2etest": "npm run e2etest --workspace=smartcontracts"
"e2etest": "npm run e2etest --workspace=smartcontracts",
"migration-build": "npm run build -w=brubeck-migration-script",
"migration-run": "npm run migration -w=brubeck-migration-script"
},
"devDependencies": {
"@types/chai": "4.3.0",
Expand Down
14 changes: 14 additions & 0 deletions packages/brubeck-migration-script/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
DB_HOST="localhost"
DB_USER="root"
DB_PASSWORD="password"
DB_NAME="core_test"

PAUSE_BETWEEN_MIGRATIONS_MS="5000"
THE_GRAPH_URL="http://10.200.10.1:8000/subgraphs/name/streamr-dev/network-contracts"
CHAIN_NODE_URL="http://localhost:8546"
ADMIN_PRIVATEKEY="0x5e98cce00cff5dea6b454889f359a4ec06b9fa6b88e9d69b86de8e1c81887da0"
MIGRATOR_PRIVATEKEY="0x000000000000000000000000000000000000000000000000000000000000000c"
STREAMREGISTRY_ADDRESS="0x6cCdd5d866ea766f6DF5965aA98DeCCD629ff222"

GASPRICE_INCREASE_PERCENT="10"
GASPRICE_INCREASE_TIMEOUT_MS="40000"
12 changes: 12 additions & 0 deletions packages/brubeck-migration-script/.env_prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DB_HOST="localhost"
DB_USER="root"
DB_PASSWORD=""
DB_NAME="streamr_prod"

PAUSE_BETWEEN_MIGRATIONS_MS="30000"
THE_GRAPH_URL="https://api.thegraph.com/subgraphs/name/streamr-dev/streams"
CHAIN_NODE_URL="https://polygon-rpc.com/"
STREAMREGISTRY_ADDRESS="0x0D483E10612F327FC11965Fc82E90dC19b141641"

GASPRICE_INCREASE_PERCENT="10"
GASPRICE_INCREASE_TIMEOUT_MS="40000"
Empty file.
84 changes: 84 additions & 0 deletions packages/brubeck-migration-script/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// import { task } from 'hardhat/config'
// import '@nomiclabs/hardhat-waffle'
import 'hardhat-typechain'
// import { HardhatUserConfig } from 'hardhat/types'
// import 'hardhat-deploy'
import 'hardhat-deploy-ethers'
require('@openzeppelin/hardhat-upgrades')

// require('solidity-coverage')
require('hardhat-dependency-compiler')

// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
// task('accounts', 'Prints the list of accounts', async (args, hre) => {
// const accounts = await hre.ethers.getSigners()
// // eslint-disable-next-line no-restricted-syntax
// for (const account of accounts) {
// // eslint-disable-next-line no-console
// console.log(account.address)
// }
// })

// TODO: add this to the hardhat-dependency-compiler repo as a pull request or whatever
// declare module 'hardhat/types/config' {
// interface HardhatUserConfig {
// dependencyCompiler?: any;
// }
// }

// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more

module.exports = {

defaultNetwork: 'hardhat',
networks: {
hardhat: {
gas: 12000000,
blockGasLimit: 0x1fffffffffffff,
allowUnlimitedContractSize: true
},
localsidechain: {
chainId: 8997,
url: 'http://10.200.10.1:8546',
accounts: ['0x5e98cce00cff5dea6b454889f359a4ec06b9fa6b88e9d69b86de8e1c81887da0']
},
polygonTestMumbai1: {
chainId: 80001,
url: 'https://rpc-mumbai.maticvigil.com',
// accounts: ['0x4059de411f15511a85ce332e7a428f36492ab4e87c7830099dadbf130f1896ae']
},
polygonTestMumbai2: {
chainId: 80001,
url: 'https://matic-mumbai.chainstacklabs.com/',
// accounts: ['0x4059de411f15511a85ce332e7a428f36492ab4e87c7830099dadbf130f1896ae']
},
polygonMainnet: {
chainId: 137,
// url: 'https://polygon-rpc.com',
url: 'https://wild-dark-thunder.matic.quiknode.pro/08b0fa6254499defc975c381ee21777cb197fac5/',
}
},
dependencyCompiler: {
paths: [
'smartcontracts/contracts/StreamRegistry/StreamRegistryV3.sol'
],
},
solidity: {
compilers: [
{
version: '0.8.9',
settings: {
optimizer: {
enabled: true,
runs: 100,
},
},
}],
},
typechain: {
outDir: './typechain',
target: 'ethers-v5',
}
}
Loading