-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsign.js
40 lines (34 loc) · 994 Bytes
/
sign.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require("dotenv-flow").config();
const { toWei } = require("web3-utils");
const Web3 = require("web3");
const web3 = new Web3(process.env.PROVIDER);
const privKey = "8da4ef21b864d2cc526dbdb2a120bd2874c36c9d0a1fb7f8c63d7f7a8b41de8f";
const log4js = require('log4js');
log4js.configure(
{
appenders: {
out: {
type: 'stdout'
}
},
categories: {
default: { appenders: ['out'], level: 'debug' }
}
}
);
const logger = log4js.getLogger('test sign');
logger.info(`PROVIDER: ${process.env.PROVIDER}`);
(async () => {
for (let i = 0; i < 100000; i++) {
await testSend("0x41d4f4449cdd61fd88a8597d8ef9a2f4e74fcd074035bdf9eafe2820353f5036" + i);
if (i % 100==0) {
logger.info(`Signed: ${i}`);
}
}
})();
async function testSend(
message,
) {
var signature = await web3.eth.accounts.sign(message, privKey);
// logger.info(`Signed: ${signature.signature}`);
}