-
Notifications
You must be signed in to change notification settings - Fork 34
Storage diffs over rpc #116
Changes from 39 commits
36533f7
34f8e16
9de631f
1b4a901
dc06991
ee244ac
8c4a4d6
a577811
70fcc22
b09b8a8
963479f
7cbad1d
7cd66b8
e637024
87252f4
045d78b
18f47b7
0cc90a1
9226e53
639c561
8e166f2
9831bad
a8a8fe4
66d695d
deb0315
3fb8e13
8111f4e
f574407
d06dddb
2ff88de
e1de3af
4166fb2
2931edc
6869330
f315988
6672ecf
9c6182c
5c0e559
267de00
f0d2741
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ var ( | |
recheckHeadersArg bool | ||
SubCommand string | ||
LogWithCommand log.Entry | ||
stateDiffSource string | ||
) | ||
|
||
const ( | ||
|
@@ -120,6 +121,7 @@ func init() { | |
rootCmd.PersistentFlags().String("filesystem-storageDiffsPath", "", "location of storage diffs csv file") | ||
rootCmd.PersistentFlags().String("exporter-name", "exporter", "name of exporter plugin") | ||
rootCmd.PersistentFlags().String("log-level", log.InfoLevel.String(), "Log level (trace, debug, info, warn, error, fatal, panic") | ||
rootCmd.PersistentFlags().StringVar(&stateDiffSource, "state-diff-source", "csv", "where to get the state diffs: csv or geth") | ||
|
||
viper.BindPFlag("database.name", rootCmd.PersistentFlags().Lookup("database-name")) | ||
viper.BindPFlag("database.port", rootCmd.PersistentFlags().Lookup("database-port")) | ||
|
@@ -152,15 +154,21 @@ func initConfig() { | |
} | ||
|
||
func getBlockChain() *geth.BlockChain { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it time to rename the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created a new story for this, so there's more time for conversation and thought put into this decision: VDB-778. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you remind me where these stories are located? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @i-norden sorry, i totally missed this question earlier! they're on the Jira board. I'd be happy to also add them to the issues on this repo too, if that's easier. |
||
rpcClient, ethClient := getClients() | ||
vdbEthClient := client.NewEthClient(ethClient) | ||
vdbNode := node.MakeNode(rpcClient) | ||
transactionConverter := vRpc.NewRpcTransactionConverter(ethClient) | ||
return geth.NewBlockChain(vdbEthClient, rpcClient, vdbNode, transactionConverter) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it time to rename There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created a new story for this, so there's more time for conversation and thought put into this decision: VDB-779. |
||
} | ||
|
||
func getClients() (client.RpcClient, *ethclient.Client) { | ||
rawRpcClient, err := rpc.Dial(ipc) | ||
|
||
if err != nil { | ||
LogWithCommand.Fatal(err) | ||
} | ||
rpcClient := client.NewRpcClient(rawRpcClient, ipc) | ||
ethClient := ethclient.NewClient(rawRpcClient) | ||
vdbEthClient := client.NewEthClient(ethClient) | ||
vdbNode := node.MakeNode(rpcClient) | ||
transactionConverter := vRpc.NewRpcTransactionConverter(ethClient) | ||
return geth.NewBlockChain(vdbEthClient, rpcClient, vdbNode, transactionConverter) | ||
|
||
return rpcClient, ethClient | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reuse code across execute and composeAndExecute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 pulled this into a story: VDB-777. I'd be happy to move it to an issue on this repo instead, if that makes more sense.