This is a simple implementation of blockchain using typescript.
You need sqlite and typescript to work.
To use this program, follow the steps:
npm install
Init prisma instance:
npx prisma init
Paste this table model into prisma/schema.prisma:
model Chain {
index Int @unique
timestamp BigInt
data String
previousHash String
merkle String
hash String
difficult Int
nonce Int
}
Create a migration:
npx prisma migrate dev --name init
tsc
node dist/index.js help