Skip to content

Commit

Permalink
Run DIP uploader CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
dgogel committed Jul 20, 2022
1 parent 56a99df commit d54c33e
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 4 deletions.
5 changes: 5 additions & 0 deletions content/ipfs-dips/DIP-10-Ipfs-hashes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dip": "9",
"hash": "QmPZUxV5jhvXyrDYmqGtU9oyJ4Skv5KY6PPBVgr65s2miF",
"encodedHash": "0x122535f140e09a7fc49c1e56a8fa9803807b524f32da79847824519972814210"
}
5 changes: 5 additions & 0 deletions content/ipfs-dips/DIP-11-Ipfs-hashes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dip": "10",
"hash": "QmbjEMoCCZdYuhUjCz5oNszbWCzk3GzSQ6KLeneoiiyut5",
"encodedHash": "0xc6f0c17e6e98915bcba72a9affc86a379df78119a75be808ae72a51ba7d49cd2"
}
5 changes: 5 additions & 0 deletions content/ipfs-dips/DIP-12-Ipfs-hashes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dip": "11",
"hash": "QmXESDnGmBAgjU44RUrea2vCszeNsUpCjqsePJjjGRSdkV",
"encodedHash": "0x842193abdf79d8611e365fd072cb5cd3cd679045c26ff4db5da28fdd81ab1f32"
}
5 changes: 5 additions & 0 deletions content/ipfs-dips/DIP-8-Ipfs-hashes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dip": "7",
"hash": "QmXQcrMc97RpPEvNTDpKNsi8vooTkUyvceVMsL4JrEbG1e",
"encodedHash": "0x86bd67ad5161344cd10a9f423c99c9178357fefbdd31cb33bae6df4e0113fcc1"
}
5 changes: 5 additions & 0 deletions content/ipfs-dips/DIP-9-Ipfs-hashes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dip": "8",
"hash": "QmSjSti6HL2qjhck3vn5i3JsQPuaDPXQ7n3WiHJ42xUkrf",
"encodedHash": "0x4145be9c05fd70e399f8253167b119f02dd16fcfd5a5bb0543ad336ce9da99d4"
}
70 changes: 70 additions & 0 deletions content/ipfs-dips/all-dips.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions dip-uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const rawJsonDips = JSON.parse(fs.readFileSync('./content/ipfs-dips/all-dips.jso
const jsonDips = Object.values(rawJsonDips);

async function main() {
const dipIds = Object.keys(jsonDips).sort(((a, b) => a.split('-')[1] - b.split('-')[1]));
dipNumbers = jsonDips.map((jsonDip) => jsonDip.DIP - 1).sort((a, b) => a - b)

for (let x = 0; x < dipIds.length; x++) {
const id = dipIds[x];
for (let x = 0; x < dipNumbers.length; x++) {
const id = dipNumbers[x].toString();

delete Object.assign(jsonDips[id], { 'description': jsonDips[id]['content'] })['content'];

Expand Down Expand Up @@ -54,13 +54,14 @@ async function main() {
}`
jsonDips[id].ipfsHash = hash
jsonDips[id].encodeIpfsHash = encodedHash
const dipId = jsonDips[id].DIP - 1
console.log(`${jsonDips[id].title}: ✅ Success!`)
console.log(` IPFS hash: ${hash}`)
console.log(` Encoded IPFS hash (for proposal creation): ${encodedHash}`)
console.log(` See the file here: https://gateway.pinata.cloud/ipfs/${hash}`)
fs.writeFileSync(
`./content/ipfs-dips/${jsonDips[id].basename}-Ipfs-hashes.json`,
JSON.stringify({ dip: id, hash, encodedHash }, null, 2)
JSON.stringify({ dip: dipId.toString(), hash, encodedHash }, null, 2)
)
fs.writeFileSync(
`./content/ipfs-dips/all-dips.json`,
Expand Down

0 comments on commit d54c33e

Please sign in to comment.