1818// arbitrary data.
1919package main
2020
21+ //go:generate go-bindata -o bindata.go resources/4byte.json
22+ //go:generate gofmt -s -w bindata.go
23+
2124import (
2225 "bufio"
2326 "context"
@@ -57,16 +60,16 @@ import (
5760)
5861
5962const legalWarning = `
60- WARNING!
63+ WARNING!
6164
62- Clef is an account management tool. It may, like any software, contain bugs.
65+ Clef is an account management tool. It may, like any software, contain bugs.
6366
6467Please take care to
65- - backup your keystore files,
68+ - backup your keystore files,
6669- verify that the keystore(s) can be opened with your password.
6770
68- Clef is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
69- without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
71+ Clef is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
72+ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
7073PURPOSE. See the GNU General Public License for more details.
7174`
7275
@@ -104,11 +107,6 @@ var (
104107 Name : "signersecret" ,
105108 Usage : "A file containing the (encrypted) master seed to encrypt Clef data, e.g. keystore credentials and ruleset hash" ,
106109 }
107- dBFlag = cli.StringFlag {
108- Name : "4bytedb" ,
109- Usage : "File containing 4byte-identifiers" ,
110- Value : "./4byte.json" ,
111- }
112110 customDBFlag = cli.StringFlag {
113111 Name : "4bytedb-custom" ,
114112 Usage : "File used for writing new 4byte-identifiers submitted via API" ,
@@ -145,7 +143,7 @@ var (
145143 configdirFlag ,
146144 },
147145 Description : `
148- The init command generates a master seed which Clef can use to store credentials and data needed for
146+ The init command generates a master seed which Clef can use to store credentials and data needed for
149147the rule-engine to work.` ,
150148 }
151149 attestCommand = cli.Command {
@@ -159,10 +157,10 @@ the rule-engine to work.`,
159157 signerSecretFlag ,
160158 },
161159 Description : `
162- The attest command stores the sha256 of the rule.js-file that you want to use for automatic processing of
163- incoming requests.
160+ The attest command stores the sha256 of the rule.js-file that you want to use for automatic processing of
161+ incoming requests.
164162
165- Whenever you make an edit to the rule file, you need to use attestation to tell
163+ Whenever you make an edit to the rule file, you need to use attestation to tell
166164Clef that the file is 'safe' to execute.` ,
167165 }
168166
@@ -177,7 +175,7 @@ Clef that the file is 'safe' to execute.`,
177175 signerSecretFlag ,
178176 },
179177 Description : `
180- The setpw command stores a password for a given address (keyfile). If you enter a blank passphrase, it will
178+ The setpw command stores a password for a given address (keyfile). If you enter a blank passphrase, it will
181179remove any stored credential for that address (keyfile)
182180` }
183181 gendocCommand = cli.Command {
@@ -206,7 +204,6 @@ func init() {
206204 utils .RPCEnabledFlag ,
207205 rpcPortFlag ,
208206 signerSecretFlag ,
209- dBFlag ,
210207 customDBFlag ,
211208 auditLogFlag ,
212209 ruleFlag ,
@@ -273,12 +270,12 @@ func initializeSecrets(c *cli.Context) error {
273270 }
274271 fmt .Printf ("A master seed has been generated into %s\n " , location )
275272 fmt .Printf (`
276- This is required to be able to store credentials, such as :
273+ This is required to be able to store credentials, such as :
277274* Passwords for keystores (used by rule engine)
278275* Storage for javascript rules
279276* Hash of rule-file
280277
281- You should treat that file with utmost secrecy, and make a backup of it.
278+ You should treat that file with utmost secrecy, and make a backup of it.
282279NOTE: This file does not contain your accounts. Those need to be backed up separately!
283280
284281` )
@@ -365,13 +362,17 @@ func signer(c *cli.Context) error {
365362 log .Info ("Using CLI as UI-channel" )
366363 ui = core .NewCommandlineUI ()
367364 }
368- fourByteDb := c . GlobalString ( dBFlag . Name )
365+ // 4bytedb data
369366 fourByteLocal := c .GlobalString (customDBFlag .Name )
370- db , err := core .NewAbiDBFromFiles (fourByteDb , fourByteLocal )
367+ data , err := Asset ("resources/4byte.json" )
368+ if err != nil {
369+ utils .Fatalf (err .Error ())
370+ }
371+ db , err := core .NewAbiDBFromFiles (data , fourByteLocal )
371372 if err != nil {
372373 utils .Fatalf (err .Error ())
373374 }
374- log .Info ("Loaded 4byte db" , "signatures" , db .Size (), "file" , fourByteDb , " local" , fourByteLocal )
375+ log .Info ("Loaded 4byte db" , "signatures" , db .Size (), "local" , fourByteLocal )
375376
376377 var (
377378 api core.ExternalAPI
0 commit comments